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

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

Issue 710903002: Revert of [GCM] Fetching OAuth2 tokens periodically in account tracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mapper-in-driver
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « components/gcm_driver/gcm_client_impl.h ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_client_impl.h" 5 #include "components/gcm_driver/gcm_client_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 void GCMClientImpl::RemoveAccountMapping(const std::string& account_id) { 467 void GCMClientImpl::RemoveAccountMapping(const std::string& account_id) {
468 gcm_store_->RemoveAccountMapping( 468 gcm_store_->RemoveAccountMapping(
469 account_id, 469 account_id,
470 base::Bind(&GCMClientImpl::DefaultStoreCallback, 470 base::Bind(&GCMClientImpl::DefaultStoreCallback,
471 weak_ptr_factory_.GetWeakPtr())); 471 weak_ptr_factory_.GetWeakPtr()));
472 } 472 }
473 473
474 void GCMClientImpl::SetLastTokenFetchTime(const base::Time& time) { 474 void GCMClientImpl::SetLastTokenFetchTime(const base::Time& time) {
475 gcm_store_->SetLastTokenFetchTime( 475 gcm_store_->SetLastTokenFetchTime(
476 time, 476 time,
477 base::Bind(&GCMClientImpl::IgnoreWriteResultCallback, 477 base::Bind(&GCMClientImpl::DefaultStoreCallback,
478 weak_ptr_factory_.GetWeakPtr())); 478 weak_ptr_factory_.GetWeakPtr()));
479 } 479 }
480 480
481 void GCMClientImpl::StartCheckin() { 481 void GCMClientImpl::StartCheckin() {
482 // Make sure no checkin is in progress. 482 // Make sure no checkin is in progress.
483 if (checkin_request_.get()) 483 if (checkin_request_.get())
484 return; 484 return;
485 485
486 checkin_proto::ChromeBuildProto chrome_build_proto; 486 checkin_proto::ChromeBuildProto chrome_build_proto;
487 ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto); 487 ToCheckinProtoVersion(chrome_build_info_, &chrome_build_proto);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 590
591 void GCMClientImpl::UpdateRegistrationCallback(bool success) { 591 void GCMClientImpl::UpdateRegistrationCallback(bool success) {
592 // TODO(fgorski): This is one of the signals that store needs a rebuild. 592 // TODO(fgorski): This is one of the signals that store needs a rebuild.
593 DCHECK(success); 593 DCHECK(success);
594 } 594 }
595 595
596 void GCMClientImpl::DefaultStoreCallback(bool success) { 596 void GCMClientImpl::DefaultStoreCallback(bool success) {
597 DCHECK(success); 597 DCHECK(success);
598 } 598 }
599 599
600 void GCMClientImpl::IgnoreWriteResultCallback(bool success) {
601 // TODO(fgorski): Ignoring the write result for now to make sure
602 // sync_intergration_tests are not broken.
603 }
604
605 void GCMClientImpl::Stop() { 600 void GCMClientImpl::Stop() {
606 DVLOG(1) << "Stopping the GCM Client"; 601 DVLOG(1) << "Stopping the GCM Client";
607 weak_ptr_factory_.InvalidateWeakPtrs(); 602 weak_ptr_factory_.InvalidateWeakPtrs();
608 device_checkin_info_.Reset(); 603 device_checkin_info_.Reset();
609 connection_factory_.reset(); 604 connection_factory_.reset();
610 delegate_->OnDisconnected(); 605 delegate_->OnDisconnected();
611 mcs_client_.reset(); 606 mcs_client_.reset();
612 checkin_request_.reset(); 607 checkin_request_.reset();
613 // Delete all of the pending registration requests, whithout telling the 608 // Delete all of the pending registration requests, whithout telling the
614 // consumers. 609 // consumers.
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 984
990 recorder_.RecordIncomingSendError( 985 recorder_.RecordIncomingSendError(
991 data_message_stanza.category(), 986 data_message_stanza.category(),
992 data_message_stanza.to(), 987 data_message_stanza.to(),
993 data_message_stanza.id()); 988 data_message_stanza.id());
994 delegate_->OnMessageSendError(data_message_stanza.category(), 989 delegate_->OnMessageSendError(data_message_stanza.category(),
995 send_error_details); 990 send_error_details);
996 } 991 }
997 992
998 } // namespace gcm 993 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_client_impl.h ('k') | components/gcm_driver/gcm_driver_desktop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698