| 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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 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 | |
| 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 Loading... |
| 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 |
| OLD | NEW |