[Chromecast] Pass in |io_task_runner| to GCM components.

When |io_task_runner| is power managed, delayed tasks and timers running on it
can wake up the system.

Bug: internal b/132993317

Change-Id: Iee07e47e51e8c5f0ac011d351ba9fff3822f32b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1637997
Reviewed-by: Dmitry Titov <[email protected]>
Reviewed-by: Jian Li <[email protected]>
Reviewed-by: Yue Li <[email protected]>
Reviewed-by: Kenneth MacKay <[email protected]>
Commit-Queue: Steven Zhu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#665936}
diff --git a/components/gcm_driver/gcm_client.h b/components/gcm_driver/gcm_client.h
index fe61e64..0242d9d9 100644
--- a/components/gcm_driver/gcm_client.h
+++ b/components/gcm_driver/gcm_client.h
@@ -230,10 +230,14 @@
   virtual ~GCMClient();
 
   // Begins initialization of the GCM Client. This will not trigger a
-  // connection.
+  // connection. Must be called on |io_task_runner|.
   // |chrome_build_info|: chrome info, i.e., version, channel and etc.
   // |store_path|: path to the GCM store.
   // |blocking_task_runner|: for running blocking file tasks.
+  // |io_task_runner|: for running IO tasks. When provided, it could be a
+  //     wrapper on top of base::ThreadTaskRunnerHandle::Get() to provide power
+  //     management featueres so that a delayed task posted to it can wake the
+  //     system up from sleep to perform the task.
   // |get_socket_factory_callback|: a callback that can accept a request for a
   //     network::mojom::ProxyResolvingSocketFactoryPtr. It needs to be safe to
   //     run on any thread.
@@ -243,6 +247,7 @@
       const ChromeBuildInfo& chrome_build_info,
       const base::FilePath& store_path,
       const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner,
+      scoped_refptr<base::SequencedTaskRunner> io_task_runner,
       base::RepeatingCallback<
           void(network::mojom::ProxyResolvingSocketFactoryRequest)>
           get_socket_factory_callback,