OLD | NEW |
---|---|
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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 } | 465 } |
466 | 466 |
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( |
Nicolas Zea
2014/11/07 22:19:25
How about just not calling this at all if we're un
fgorski
2014/11/07 22:57:02
tracker does not call the other methods. GCMAccoun
Nicolas Zea
2014/11/07 23:03:23
Okay, maybe file followup bug?
| |
476 time, | 476 time, |
477 base::Bind(&GCMClientImpl::DefaultStoreCallback, | 477 base::Bind(&GCMClientImpl::IgnoreWriteResultCallback, |
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 Loading... | |
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 | |
600 void GCMClientImpl::Stop() { | 605 void GCMClientImpl::Stop() { |
601 DVLOG(1) << "Stopping the GCM Client"; | 606 DVLOG(1) << "Stopping the GCM Client"; |
602 weak_ptr_factory_.InvalidateWeakPtrs(); | 607 weak_ptr_factory_.InvalidateWeakPtrs(); |
603 device_checkin_info_.Reset(); | 608 device_checkin_info_.Reset(); |
604 connection_factory_.reset(); | 609 connection_factory_.reset(); |
605 delegate_->OnDisconnected(); | 610 delegate_->OnDisconnected(); |
606 mcs_client_.reset(); | 611 mcs_client_.reset(); |
607 checkin_request_.reset(); | 612 checkin_request_.reset(); |
608 // Delete all of the pending registration requests, whithout telling the | 613 // Delete all of the pending registration requests, whithout telling the |
609 // consumers. | 614 // consumers. |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
984 | 989 |
985 recorder_.RecordIncomingSendError( | 990 recorder_.RecordIncomingSendError( |
986 data_message_stanza.category(), | 991 data_message_stanza.category(), |
987 data_message_stanza.to(), | 992 data_message_stanza.to(), |
988 data_message_stanza.id()); | 993 data_message_stanza.id()); |
989 delegate_->OnMessageSendError(data_message_stanza.category(), | 994 delegate_->OnMessageSendError(data_message_stanza.category(), |
990 send_error_details); | 995 send_error_details); |
991 } | 996 } |
992 | 997 |
993 } // namespace gcm | 998 } // namespace gcm |
OLD | NEW |