Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: sync/notifier/sync_system_resources.cc

Issue 140513002: Client-to-server messages in GCMNetworkChannel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sync/notifier/sync_system_resources.cc
diff --git a/sync/notifier/sync_system_resources.cc b/sync/notifier/sync_system_resources.cc
index c9ca21230fb8a04eda579bdc427452eb88180e32..68eb6bc7fe1ce0d1650d87646819211d3dbe7ebc 100644
--- a/sync/notifier/sync_system_resources.cc
+++ b/sync/notifier/sync_system_resources.cc
@@ -19,6 +19,7 @@
#include "google/cacheinvalidation/include/types.h"
#include "jingle/notifier/listener/push_client.h"
#include "sync/notifier/gcm_network_channel.h"
+#include "sync/notifier/gcm_network_channel_delegate.h"
#include "sync/notifier/invalidation_util.h"
#include "sync/notifier/push_client_channel.h"
@@ -179,8 +180,11 @@ scoped_ptr<SyncNetworkChannel> SyncNetworkChannel::CreatePushClientChannel(
new PushClientChannel(push_client.Pass()));
}
-scoped_ptr<SyncNetworkChannel> SyncNetworkChannel::CreateGCMNetworkChannel() {
- return scoped_ptr<SyncNetworkChannel>(new GCMNetworkChannel());
+scoped_ptr<SyncNetworkChannel> SyncNetworkChannel::CreateGCMNetworkChannel(
+ scoped_refptr<net::URLRequestContextGetter> request_context_getter,
+ scoped_ptr<GCMNetworkChannelDelegate> delegate) {
+ return scoped_ptr<SyncNetworkChannel>(new GCMNetworkChannel(
+ request_context_getter, delegate.Pass()));
}
const std::string& SyncNetworkChannel::GetServiceContextForTest() const {
@@ -207,8 +211,9 @@ bool SyncNetworkChannel::DecodeMessageForTest(
return DecodeMessage(data, message, service_context, scheduling_hash);
}
-void SyncNetworkChannel::NotifyStateChange(InvalidatorState invalidator_state) {
- // Remember state for future NetworkStatusReceivers.
+void SyncNetworkChannel::SetNetworkState(InvalidatorState invalidator_state) {
+ if (invalidator_state_ == invalidator_state)
+ return;
invalidator_state_ = invalidator_state;
// Notify NetworkStatusReceivers in cacheinvalidation.
for (NetworkStatusReceiverList::const_iterator it =

Powered by Google App Engine
This is Rietveld 408576698