summaryrefslogtreecommitdiffstats
path: root/sync/notifier
diff options
context:
space:
mode:
authorpavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 14:10:53 +0000
committerpavely@chromium.org <pavely@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-06 14:10:53 +0000
commitafb0fa38a076c4240ed1c6d931e249af7f68444f (patch)
tree892b73191e647fd2d16a4b09eae975d933f9d853 /sync/notifier
parentbe31e40c38864b0ee3fb90d7277b890c181aad9a (diff)
downloadchromium_src-afb0fa38a076c4240ed1c6d931e249af7f68444f.zip
chromium_src-afb0fa38a076c4240ed1c6d931e249af7f68444f.tar.gz
chromium_src-afb0fa38a076c4240ed1c6d931e249af7f68444f.tar.bz2
Refactor GCMNetworkChannelDelegateImpl
Receiving messages from GCM needed separate object with lifetime tied to TiclInvalidationService on UI thread. This change is to replace GCMNetworkChannelDelegateImpl with pair of objects: GCMInvalidationBridge/Core. Here is object diagram for this refactoring: http://www.plantuml.com:80/plantuml/png/VPBRQiCm343VynKYZuNs0xgoXsLZ17PZxPwBwwYf5sC7nqiPs_vzbfsB4sWXuDYHZexar8nNh4H8FtBOdGoo8eMV9D67J-GMqftWCbSjaw9WLcYrHTCAZYcm1gpxvc816gvhBFQrDPix8ueIR-7WrvlahoSzPiyFBIhxhhyich60Eu_v8T_Z0uBuPsGLqO5hWmuP9xyPVHGIOw-oRhpMjEG2SDoG63rrttt-6dL_rMszpfo5BqGwC14CpZF55xHdRQhin9H2UOyIIsO3eUWsZd8j9rGBxxE93uW8iFrMF1P_4er5XMQUgaAHVKUceJY8lzR5Sjat4nRGgrMO_tIiiFaTG_r0AB3VTyf46po7dYdJ4-d2j0kP_ICNso1SXmwsLF9Iz3y0 BUG=325020 R=rlarocque@chromium.org Review URL: https://codereview.chromium.org/186623006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@255337 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/notifier')
-rw-r--r--sync/notifier/gcm_network_channel.cc1
-rw-r--r--sync/notifier/gcm_network_channel_delegate.h1
-rw-r--r--sync/notifier/gcm_network_channel_unittest.cc2
3 files changed, 4 insertions, 0 deletions
diff --git a/sync/notifier/gcm_network_channel.cc b/sync/notifier/gcm_network_channel.cc
index 70478f6..b4ea4bc 100644
--- a/sync/notifier/gcm_network_channel.cc
+++ b/sync/notifier/gcm_network_channel.cc
@@ -49,6 +49,7 @@ GCMNetworkChannel::GCMNetworkChannel(
delegate_(delegate.Pass()),
register_backoff_entry_(new net::BackoffEntry(&kRegisterBackoffPolicy)),
weak_factory_(this) {
+ delegate_->Initialize();
Register();
}
diff --git a/sync/notifier/gcm_network_channel_delegate.h b/sync/notifier/gcm_network_channel_delegate.h
index 30c91f7..63b67f3 100644
--- a/sync/notifier/gcm_network_channel_delegate.h
+++ b/sync/notifier/gcm_network_channel_delegate.h
@@ -31,6 +31,7 @@ class GCMNetworkChannelDelegate {
virtual ~GCMNetworkChannelDelegate() {}
+ virtual void Initialize() = 0;
// Request access token. Callback should be called either with access token or
// error code.
virtual void RequestToken(RequestTokenCallback callback) = 0;
diff --git a/sync/notifier/gcm_network_channel_unittest.cc b/sync/notifier/gcm_network_channel_unittest.cc
index 006328b..a8ef9ac 100644
--- a/sync/notifier/gcm_network_channel_unittest.cc
+++ b/sync/notifier/gcm_network_channel_unittest.cc
@@ -17,6 +17,8 @@ class TestGCMNetworkChannelDelegate : public GCMNetworkChannelDelegate {
TestGCMNetworkChannelDelegate()
: register_call_count_(0) {}
+ virtual void Initialize() OVERRIDE {}
+
virtual void RequestToken(RequestTokenCallback callback) OVERRIDE {
request_token_callback = callback;
}