| Index: components/gcm_driver/gcm_driver_desktop.cc
|
| diff --git a/components/gcm_driver/gcm_driver_desktop.cc b/components/gcm_driver/gcm_driver_desktop.cc
|
| index e7aecc89100ed1ff2d00efcc28db811482067c6f..9c3fa5524793405cc8110193c8cd18807c0908b5 100644
|
| --- a/components/gcm_driver/gcm_driver_desktop.cc
|
| +++ b/components/gcm_driver/gcm_driver_desktop.cc
|
| @@ -135,11 +135,11 @@ GCMDriverDesktop::IOWorker::IOWorker(
|
| const scoped_refptr<base::SequencedTaskRunner>& io_thread)
|
| : ui_thread_(ui_thread),
|
| io_thread_(io_thread) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| }
|
|
|
| GCMDriverDesktop::IOWorker::~IOWorker() {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::Initialize(
|
| @@ -152,7 +152,7 @@ void GCMDriverDesktop::IOWorker::Initialize(
|
| tracked_objects::ScopedTracker tracking_profile(
|
| FROM_HERE_WITH_EXPLICIT_FUNCTION(
|
| "477117 GCMDriverDesktop::IOWorker::Initialize"));
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| gcm_client_ = gcm_client_factory->BuildInstance();
|
|
|
| @@ -165,7 +165,7 @@ void GCMDriverDesktop::IOWorker::OnRegisterFinished(
|
| const linked_ptr<RegistrationInfo>& registration_info,
|
| const std::string& registration_id,
|
| GCMClient::Result result) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| const GCMRegistrationInfo* gcm_registration_info =
|
| GCMRegistrationInfo::FromRegistrationInfo(registration_info.get());
|
| @@ -197,7 +197,7 @@ void GCMDriverDesktop::IOWorker::OnRegisterFinished(
|
| void GCMDriverDesktop::IOWorker::OnUnregisterFinished(
|
| const linked_ptr<RegistrationInfo>& registration_info,
|
| GCMClient::Result result) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| const GCMRegistrationInfo* gcm_registration_info =
|
| GCMRegistrationInfo::FromRegistrationInfo(registration_info.get());
|
| @@ -227,7 +227,7 @@ void GCMDriverDesktop::IOWorker::OnUnregisterFinished(
|
| void GCMDriverDesktop::IOWorker::OnSendFinished(const std::string& app_id,
|
| const std::string& message_id,
|
| GCMClient::Result result) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| ui_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -238,7 +238,7 @@ void GCMDriverDesktop::IOWorker::OnSendFinished(const std::string& app_id,
|
| void GCMDriverDesktop::IOWorker::OnMessageReceived(
|
| const std::string& app_id,
|
| const IncomingMessage& message) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| ui_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -249,7 +249,7 @@ void GCMDriverDesktop::IOWorker::OnMessageReceived(
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::OnMessagesDeleted(const std::string& app_id) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| ui_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -259,7 +259,7 @@ void GCMDriverDesktop::IOWorker::OnMessagesDeleted(const std::string& app_id) {
|
| void GCMDriverDesktop::IOWorker::OnMessageSendError(
|
| const std::string& app_id,
|
| const GCMClient::SendErrorDetails& send_error_details) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| ui_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -270,7 +270,7 @@ void GCMDriverDesktop::IOWorker::OnMessageSendError(
|
| void GCMDriverDesktop::IOWorker::OnSendAcknowledged(
|
| const std::string& app_id,
|
| const std::string& message_id) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| ui_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -289,7 +289,7 @@ void GCMDriverDesktop::IOWorker::OnGCMReady(
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::OnActivityRecorded() {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
| // When an activity is recorded, get all the stats and refresh the UI of
|
| // gcm-internals page.
|
| GetGCMStatistics(GCMDriver::KEEP_LOGS);
|
| @@ -316,14 +316,14 @@ void GCMDriverDesktop::IOWorker::OnStoreReset() {
|
| void GCMDriverDesktop::IOWorker::Start(
|
| GCMClient::StartMode start_mode,
|
| const base::WeakPtr<GCMDriverDesktop>& service) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| service_ = service;
|
| gcm_client_->Start(start_mode);
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::Stop() {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| gcm_client_->Stop();
|
| }
|
| @@ -331,7 +331,7 @@ void GCMDriverDesktop::IOWorker::Stop() {
|
| void GCMDriverDesktop::IOWorker::Register(
|
| const std::string& app_id,
|
| const std::vector<std::string>& sender_ids) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| std::unique_ptr<GCMRegistrationInfo> gcm_info(new GCMRegistrationInfo);
|
| gcm_info->app_id = app_id;
|
| @@ -342,14 +342,14 @@ void GCMDriverDesktop::IOWorker::Register(
|
| bool GCMDriverDesktop::IOWorker::ValidateRegistration(
|
| std::unique_ptr<RegistrationInfo> registration_info,
|
| const std::string& registration_id) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| return gcm_client_->ValidateRegistration(
|
| make_linked_ptr(registration_info.release()), registration_id);
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::Unregister(const std::string& app_id) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| std::unique_ptr<GCMRegistrationInfo> gcm_info(new GCMRegistrationInfo);
|
| gcm_info->app_id = app_id;
|
| @@ -360,14 +360,14 @@ void GCMDriverDesktop::IOWorker::Unregister(const std::string& app_id) {
|
| void GCMDriverDesktop::IOWorker::Send(const std::string& app_id,
|
| const std::string& receiver_id,
|
| const OutgoingMessage& message) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| gcm_client_->Send(app_id, receiver_id, message);
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::GetGCMStatistics(
|
| ClearActivityLogs clear_logs) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
| gcm::GCMClient::GCMStatistics stats;
|
|
|
| if (gcm_client_.get()) {
|
| @@ -382,7 +382,7 @@ void GCMDriverDesktop::IOWorker::GetGCMStatistics(
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::SetGCMRecording(bool recording) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
| gcm::GCMClient::GCMStatistics stats;
|
|
|
| if (gcm_client_.get()) {
|
| @@ -398,7 +398,7 @@ void GCMDriverDesktop::IOWorker::SetGCMRecording(bool recording) {
|
|
|
| void GCMDriverDesktop::IOWorker::SetAccountTokens(
|
| const std::vector<GCMClient::AccountTokenInfo>& account_tokens) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_client_.get())
|
| gcm_client_->SetAccountTokens(account_tokens);
|
| @@ -406,7 +406,7 @@ void GCMDriverDesktop::IOWorker::SetAccountTokens(
|
|
|
| void GCMDriverDesktop::IOWorker::UpdateAccountMapping(
|
| const AccountMapping& account_mapping) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_client_.get())
|
| gcm_client_->UpdateAccountMapping(account_mapping);
|
| @@ -414,14 +414,14 @@ void GCMDriverDesktop::IOWorker::UpdateAccountMapping(
|
|
|
| void GCMDriverDesktop::IOWorker::RemoveAccountMapping(
|
| const std::string& account_id) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_client_.get())
|
| gcm_client_->RemoveAccountMapping(account_id);
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::SetLastTokenFetchTime(const base::Time& time) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_client_.get())
|
| gcm_client_->SetLastTokenFetchTime(time);
|
| @@ -431,7 +431,7 @@ void GCMDriverDesktop::IOWorker::AddInstanceIDData(
|
| const std::string& app_id,
|
| const std::string& instance_id,
|
| const std::string& extra_data) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_client_.get())
|
| gcm_client_->AddInstanceIDData(app_id, instance_id, extra_data);
|
| @@ -439,7 +439,7 @@ void GCMDriverDesktop::IOWorker::AddInstanceIDData(
|
|
|
| void GCMDriverDesktop::IOWorker::RemoveInstanceIDData(
|
| const std::string& app_id) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_client_.get())
|
| gcm_client_->RemoveInstanceIDData(app_id);
|
| @@ -447,7 +447,7 @@ void GCMDriverDesktop::IOWorker::RemoveInstanceIDData(
|
|
|
| void GCMDriverDesktop::IOWorker::GetInstanceIDData(
|
| const std::string& app_id) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| std::string instance_id;
|
| std::string extra_data;
|
| @@ -465,7 +465,7 @@ void GCMDriverDesktop::IOWorker::GetToken(
|
| const std::string& authorized_entity,
|
| const std::string& scope,
|
| const std::map<std::string, std::string>& options) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| std::unique_ptr<InstanceIDTokenInfo> instance_id_token_info(
|
| new InstanceIDTokenInfo);
|
| @@ -492,7 +492,7 @@ void GCMDriverDesktop::IOWorker::DeleteToken(
|
|
|
| void GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat(bool wake) {
|
| #if defined(OS_CHROMEOS)
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
|
|
| std::unique_ptr<base::Timer> timer;
|
| if (wake)
|
| @@ -506,20 +506,20 @@ void GCMDriverDesktop::IOWorker::WakeFromSuspendForHeartbeat(bool wake) {
|
|
|
| void GCMDriverDesktop::IOWorker::AddHeartbeatInterval(const std::string& scope,
|
| int interval_ms) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
| gcm_client_->AddHeartbeatInterval(scope, interval_ms);
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::RemoveHeartbeatInterval(
|
| const std::string& scope) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
| gcm_client_->RemoveHeartbeatInterval(scope);
|
| }
|
|
|
| void GCMDriverDesktop::IOWorker::RecordDecryptionFailure(
|
| const std::string& app_id,
|
| GCMEncryptionProvider::DecryptionResult result) {
|
| - DCHECK(io_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(io_thread_->RunsTasksInCurrentSequence());
|
| gcm_client_->RecordDecryptionFailure(app_id, result);
|
| }
|
|
|
| @@ -582,7 +582,7 @@ void GCMDriverDesktop::ValidateRegistration(
|
| DCHECK(!sender_ids.empty() && sender_ids.size() <= kMaxSenders);
|
| DCHECK(!registration_id.empty());
|
| DCHECK(!callback.is_null());
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START);
|
| if (result != GCMClient::SUCCESS) {
|
| @@ -623,7 +623,7 @@ void GCMDriverDesktop::DoValidateRegistration(
|
| }
|
|
|
| void GCMDriverDesktop::Shutdown() {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| Stop();
|
| GCMDriver::Shutdown();
|
| @@ -646,7 +646,7 @@ void GCMDriverDesktop::OnSignedOut() {
|
|
|
| void GCMDriverDesktop::AddAppHandler(const std::string& app_id,
|
| GCMAppHandler* handler) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| GCMDriver::AddAppHandler(app_id, handler);
|
|
|
| // Ensures that the GCM service is started when there is an interest.
|
| @@ -654,7 +654,7 @@ void GCMDriverDesktop::AddAppHandler(const std::string& app_id,
|
| }
|
|
|
| void GCMDriverDesktop::RemoveAppHandler(const std::string& app_id) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| GCMDriver::RemoveAppHandler(app_id);
|
|
|
| // Stops the GCM service when no app intends to consume it. Stop function will
|
| @@ -675,7 +675,7 @@ void GCMDriverDesktop::RemoveConnectionObserver(
|
| }
|
|
|
| void GCMDriverDesktop::Enable() {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_enabled_)
|
| return;
|
| @@ -685,7 +685,7 @@ void GCMDriverDesktop::Enable() {
|
| }
|
|
|
| void GCMDriverDesktop::Disable() {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (!gcm_enabled_)
|
| return;
|
| @@ -695,7 +695,7 @@ void GCMDriverDesktop::Disable() {
|
| }
|
|
|
| void GCMDriverDesktop::Stop() {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // No need to stop GCM service if not started yet.
|
| if (!gcm_started_)
|
| @@ -729,7 +729,7 @@ void GCMDriverDesktop::RegisterImpl(
|
|
|
| void GCMDriverDesktop::DoRegister(const std::string& app_id,
|
| const std::vector<std::string>& sender_ids) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| if (!HasRegisterCallback(app_id)) {
|
| // The callback could have been removed when the app is uninstalled.
|
| return;
|
| @@ -757,7 +757,7 @@ void GCMDriverDesktop::UnregisterImpl(const std::string& app_id) {
|
| }
|
|
|
| void GCMDriverDesktop::DoUnregister(const std::string& app_id) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // Ask the server to unregister it. There could be a small chance that the
|
| // unregister request fails. If this occurs, it does not bring any harm since
|
| @@ -788,7 +788,7 @@ void GCMDriverDesktop::SendImpl(const std::string& app_id,
|
| void GCMDriverDesktop::DoSend(const std::string& app_id,
|
| const std::string& receiver_id,
|
| const OutgoingMessage& message) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| io_thread_->PostTask(
|
| FROM_HERE,
|
| base::Bind(&GCMDriverDesktop::IOWorker::Send,
|
| @@ -801,7 +801,7 @@ void GCMDriverDesktop::DoSend(const std::string& app_id,
|
| void GCMDriverDesktop::RecordDecryptionFailure(
|
| const std::string& app_id,
|
| GCMEncryptionProvider::DecryptionResult result) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| io_thread_->PostTask(
|
| FROM_HERE,
|
| base::Bind(&GCMDriverDesktop::IOWorker::RecordDecryptionFailure,
|
| @@ -810,12 +810,12 @@ void GCMDriverDesktop::RecordDecryptionFailure(
|
| }
|
|
|
| GCMClient* GCMDriverDesktop::GetGCMClientForTesting() const {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| return io_worker_ ? io_worker_->gcm_client_for_testing() : NULL;
|
| }
|
|
|
| bool GCMDriverDesktop::IsStarted() const {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| return gcm_started_;
|
| }
|
|
|
| @@ -826,7 +826,7 @@ bool GCMDriverDesktop::IsConnected() const {
|
| void GCMDriverDesktop::GetGCMStatistics(
|
| const GetGCMStatisticsCallback& callback,
|
| ClearActivityLogs clear_logs) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| DCHECK(!callback.is_null());
|
|
|
| request_gcm_statistics_callback_ = callback;
|
| @@ -839,7 +839,7 @@ void GCMDriverDesktop::GetGCMStatistics(
|
|
|
| void GCMDriverDesktop::SetGCMRecording(const GetGCMStatisticsCallback& callback,
|
| bool recording) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| request_gcm_statistics_callback_ = callback;
|
| io_thread_->PostTask(
|
| @@ -851,7 +851,7 @@ void GCMDriverDesktop::SetGCMRecording(const GetGCMStatisticsCallback& callback,
|
|
|
| void GCMDriverDesktop::UpdateAccountMapping(
|
| const AccountMapping& account_mapping) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| io_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -861,7 +861,7 @@ void GCMDriverDesktop::UpdateAccountMapping(
|
| }
|
|
|
| void GCMDriverDesktop::RemoveAccountMapping(const std::string& account_id) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| io_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -875,7 +875,7 @@ base::Time GCMDriverDesktop::GetLastTokenFetchTime() {
|
| }
|
|
|
| void GCMDriverDesktop::SetLastTokenFetchTime(const base::Time& time) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| last_token_fetch_time_ = time;
|
|
|
| @@ -900,7 +900,7 @@ void GCMDriverDesktop::GetToken(
|
| DCHECK(!authorized_entity.empty());
|
| DCHECK(!scope.empty());
|
| DCHECK(!callback.is_null());
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START);
|
| if (result != GCMClient::SUCCESS) {
|
| @@ -937,7 +937,7 @@ void GCMDriverDesktop::DoGetToken(
|
| const std::string& authorized_entity,
|
| const std::string& scope,
|
| const std::map<std::string, std::string>& options) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| TokenTuple tuple_key(app_id, authorized_entity, scope);
|
| auto callback_iter = get_token_callbacks_.find(tuple_key);
|
| @@ -966,7 +966,7 @@ void GCMDriverDesktop::ValidateToken(const std::string& app_id,
|
| DCHECK(!scope.empty());
|
| DCHECK(!token.empty());
|
| DCHECK(!callback.is_null());
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START);
|
| if (result != GCMClient::SUCCESS) {
|
| @@ -1001,7 +1001,7 @@ void GCMDriverDesktop::DeleteToken(const std::string& app_id,
|
| DCHECK(!authorized_entity.empty());
|
| DCHECK(!scope.empty());
|
| DCHECK(!callback.is_null());
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START);
|
| if (result != GCMClient::SUCCESS) {
|
| @@ -1036,7 +1036,7 @@ void GCMDriverDesktop::DeleteToken(const std::string& app_id,
|
| void GCMDriverDesktop::DoDeleteToken(const std::string& app_id,
|
| const std::string& authorized_entity,
|
| const std::string& scope) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| io_thread_->PostTask(
|
| FROM_HERE,
|
| @@ -1051,7 +1051,7 @@ void GCMDriverDesktop::AddInstanceIDData(
|
| const std::string& app_id,
|
| const std::string& instance_id,
|
| const std::string& extra_data) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START);
|
| if (result != GCMClient::SUCCESS)
|
| @@ -1085,7 +1085,7 @@ void GCMDriverDesktop::DoAddInstanceIDData(
|
| }
|
|
|
| void GCMDriverDesktop::RemoveInstanceIDData(const std::string& app_id) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START);
|
| if (result != GCMClient::SUCCESS)
|
| @@ -1115,7 +1115,7 @@ void GCMDriverDesktop::GetInstanceIDData(
|
| const std::string& app_id,
|
| const GetInstanceIDDataCallback& callback) {
|
| DCHECK(!get_instance_id_data_callbacks_.count(app_id));
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| GCMClient::Result result = EnsureStarted(GCMClient::IMMEDIATE_START);
|
| if (result != GCMClient::SUCCESS) {
|
| @@ -1189,7 +1189,7 @@ void GCMDriverDesktop::DeleteTokenFinished(const std::string& app_id,
|
| }
|
|
|
| void GCMDriverDesktop::WakeFromSuspendForHeartbeat(bool wake) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| wake_from_suspend_enabled_ = wake;
|
|
|
| @@ -1217,7 +1217,7 @@ void GCMDriverDesktop::WakeFromSuspendForHeartbeat(bool wake) {
|
|
|
| void GCMDriverDesktop::AddHeartbeatInterval(const std::string& scope,
|
| int interval_ms) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // The GCM service has not been initialized.
|
| if (!delayed_task_controller_)
|
| @@ -1238,7 +1238,7 @@ void GCMDriverDesktop::AddHeartbeatInterval(const std::string& scope,
|
| }
|
|
|
| void GCMDriverDesktop::RemoveHeartbeatInterval(const std::string& scope) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // The GCM service has not been initialized.
|
| if (!delayed_task_controller_)
|
| @@ -1260,7 +1260,7 @@ void GCMDriverDesktop::RemoveHeartbeatInterval(const std::string& scope) {
|
|
|
| void GCMDriverDesktop::SetAccountTokens(
|
| const std::vector<GCMClient::AccountTokenInfo>& account_tokens) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| account_mapper_->SetAccountTokens(account_tokens);
|
|
|
| @@ -1273,7 +1273,7 @@ void GCMDriverDesktop::SetAccountTokens(
|
|
|
| GCMClient::Result GCMDriverDesktop::EnsureStarted(
|
| GCMClient::StartMode start_mode) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| if (gcm_started_)
|
| return GCMClient::SUCCESS;
|
| @@ -1305,7 +1305,7 @@ GCMClient::Result GCMDriverDesktop::EnsureStarted(
|
| }
|
|
|
| void GCMDriverDesktop::RemoveCachedData() {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
| // Remove all the queued tasks since they no longer make sense after
|
| // GCM service is stopped.
|
| weak_ptr_factory_.InvalidateWeakPtrs();
|
| @@ -1317,7 +1317,7 @@ void GCMDriverDesktop::RemoveCachedData() {
|
|
|
| void GCMDriverDesktop::MessageReceived(const std::string& app_id,
|
| const IncomingMessage& message) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // Drop the event if the service has been stopped.
|
| if (!gcm_started_)
|
| @@ -1327,7 +1327,7 @@ void GCMDriverDesktop::MessageReceived(const std::string& app_id,
|
| }
|
|
|
| void GCMDriverDesktop::MessagesDeleted(const std::string& app_id) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // Drop the event if the service has been stopped.
|
| if (!gcm_started_)
|
| @@ -1341,7 +1341,7 @@ void GCMDriverDesktop::MessagesDeleted(const std::string& app_id) {
|
| void GCMDriverDesktop::MessageSendError(
|
| const std::string& app_id,
|
| const GCMClient::SendErrorDetails& send_error_details) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // Drop the event if the service has been stopped.
|
| if (!gcm_started_)
|
| @@ -1354,7 +1354,7 @@ void GCMDriverDesktop::MessageSendError(
|
|
|
| void GCMDriverDesktop::SendAcknowledged(const std::string& app_id,
|
| const std::string& message_id) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // Drop the event if the service has been stopped.
|
| if (!gcm_started_)
|
| @@ -1368,7 +1368,7 @@ void GCMDriverDesktop::SendAcknowledged(const std::string& app_id,
|
| void GCMDriverDesktop::GCMClientReady(
|
| const std::vector<AccountMapping>& account_mappings,
|
| const base::Time& last_token_fetch_time) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| UMA_HISTOGRAM_BOOLEAN("GCM.UserSignedIn", signed_in_);
|
|
|
| @@ -1387,7 +1387,7 @@ void GCMDriverDesktop::GCMClientReady(
|
| }
|
|
|
| void GCMDriverDesktop::OnConnected(const net::IPEndPoint& ip_endpoint) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| connected_ = true;
|
|
|
| @@ -1400,7 +1400,7 @@ void GCMDriverDesktop::OnConnected(const net::IPEndPoint& ip_endpoint) {
|
| }
|
|
|
| void GCMDriverDesktop::OnDisconnected() {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| connected_ = false;
|
|
|
| @@ -1425,7 +1425,7 @@ void GCMDriverDesktop::OnStoreReset() {
|
|
|
| void GCMDriverDesktop::GetGCMStatisticsFinished(
|
| const GCMClient::GCMStatistics& stats) {
|
| - DCHECK(ui_thread_->RunsTasksOnCurrentThread());
|
| + DCHECK(ui_thread_->RunsTasksInCurrentSequence());
|
|
|
| // request_gcm_statistics_callback_ could be null when an activity, i.e.
|
| // network activity, is triggered while gcm-intenals page is not open.
|
|
|