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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 320993003: [GCM] Add app handler support for connection events (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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
« no previous file with comments | « components/gcm_driver/gcm_client.h ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_client_impl.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index 2f1988824a643afecc79a706f9ad77fc89327a76..f53071ef7e52eafb20865ef05900f02d0abfe74c 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -250,6 +250,7 @@ scoped_ptr<ConnectionFactory> GCMInternalsBuilder::BuildConnectionFactory(
GCMClientImpl::GCMClientImpl(scoped_ptr<GCMInternalsBuilder> internals_builder)
: internals_builder_(internals_builder.Pass()),
state_(UNINITIALIZED),
+ delegate_(NULL),
clock_(internals_builder_->BuildClock()),
url_request_context_getter_(NULL),
pending_registration_requests_deleter_(&pending_registration_requests_),
@@ -506,6 +507,7 @@ void GCMClientImpl::Stop() {
weak_ptr_factory_.InvalidateWeakPtrs();
device_checkin_info_.Reset();
connection_factory_.reset();
+ delegate_->OnDisconnected();
mcs_client_.reset();
checkin_request_.reset();
pending_registration_requests_.clear();
@@ -736,13 +738,14 @@ void GCMClientImpl::OnActivityRecorded() {
void GCMClientImpl::OnConnected(const GURL& current_server,
const net::IPEndPoint& ip_endpoint) {
- // TODO(zea): inform GCMClient::Delegate and app handlers as well.
+ // TODO(gcm): expose current server in debug page.
delegate_->OnActivityRecorded();
+ delegate_->OnConnected(ip_endpoint);
}
void GCMClientImpl::OnDisconnected() {
- // TODO(zea): inform GCMClient::Delegate and app handlers as well.
delegate_->OnActivityRecorded();
+ delegate_->OnDisconnected();
}
void GCMClientImpl::OnMessageReceivedFromMCS(const gcm::MCSMessage& message) {
« no previous file with comments | « components/gcm_driver/gcm_client.h ('k') | components/gcm_driver/gcm_client_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698