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

Side by Side Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 961533002: Adding Send to Gaia ID feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removign the callback on shutdown Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/gcm_driver/gcm_driver_desktop.h" 5 #include "components/gcm_driver/gcm_driver_desktop.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 790
791 UMA_HISTOGRAM_BOOLEAN("GCM.UserSignedIn", signed_in_); 791 UMA_HISTOGRAM_BOOLEAN("GCM.UserSignedIn", signed_in_);
792 792
793 gcm_started_ = true; 793 gcm_started_ = true;
794 if (wake_from_suspend_enabled_) 794 if (wake_from_suspend_enabled_)
795 WakeFromSuspendForHeartbeat(wake_from_suspend_enabled_); 795 WakeFromSuspendForHeartbeat(wake_from_suspend_enabled_);
796 796
797 last_token_fetch_time_ = last_token_fetch_time; 797 last_token_fetch_time_ = last_token_fetch_time;
798 798
799 GCMDriver::AddAppHandler(kGCMAccountMapperAppId, account_mapper_.get()); 799 GCMDriver::AddAppHandler(kGCMAccountMapperAppId, account_mapper_.get());
800 account_mapper_->Initialize(account_mappings); 800 account_mapper_->Initialize(account_mappings,
801 base::Bind(&GCMDriverDesktop::MessageReceived,
802 weak_ptr_factory_.GetWeakPtr()));
801 803
802 delayed_task_controller_->SetReady(); 804 delayed_task_controller_->SetReady();
803 } 805 }
804 806
805 void GCMDriverDesktop::OnConnected(const net::IPEndPoint& ip_endpoint) { 807 void GCMDriverDesktop::OnConnected(const net::IPEndPoint& ip_endpoint) {
806 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); 808 DCHECK(ui_thread_->RunsTasksOnCurrentThread());
807 809
808 connected_ = true; 810 connected_ = true;
809 811
810 // Drop the event if the service has been stopped. 812 // Drop the event if the service has been stopped.
(...skipping 23 matching lines...) Expand all
834 DCHECK(ui_thread_->RunsTasksOnCurrentThread()); 836 DCHECK(ui_thread_->RunsTasksOnCurrentThread());
835 837
836 // Normally request_gcm_statistics_callback_ would not be null. 838 // Normally request_gcm_statistics_callback_ would not be null.
837 if (!request_gcm_statistics_callback_.is_null()) 839 if (!request_gcm_statistics_callback_.is_null())
838 request_gcm_statistics_callback_.Run(stats); 840 request_gcm_statistics_callback_.Run(stats);
839 else 841 else
840 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; 842 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL.";
841 } 843 }
842 844
843 } // namespace gcm 845 } // namespace gcm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698