| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "google_apis/gcm/gcm_client_impl.h" | 5 #include "google_apis/gcm/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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 gcm_store_.reset(new GCMStoreImpl(path, blocking_task_runner)); | 224 gcm_store_.reset(new GCMStoreImpl(path, blocking_task_runner)); |
| 225 | 225 |
| 226 delegate_ = delegate; | 226 delegate_ = delegate; |
| 227 | 227 |
| 228 recorder_.SetDelegate(this); | 228 recorder_.SetDelegate(this); |
| 229 | 229 |
| 230 state_ = INITIALIZED; | 230 state_ = INITIALIZED; |
| 231 } | 231 } |
| 232 | 232 |
| 233 void GCMClientImpl::Load() { | 233 void GCMClientImpl::Start() { |
| 234 DCHECK_EQ(INITIALIZED, state_); | 234 DCHECK_EQ(INITIALIZED, state_); |
| 235 | 235 |
| 236 // Once the loading is completed, the check-in will be initiated. | 236 // Once the loading is completed, the check-in will be initiated. |
| 237 gcm_store_->Load(base::Bind(&GCMClientImpl::OnLoadCompleted, | 237 gcm_store_->Load(base::Bind(&GCMClientImpl::OnLoadCompleted, |
| 238 weak_ptr_factory_.GetWeakPtr())); | 238 weak_ptr_factory_.GetWeakPtr())); |
| 239 state_ = LOADING; | 239 state_ = LOADING; |
| 240 } | 240 } |
| 241 | 241 |
| 242 void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) { | 242 void GCMClientImpl::OnLoadCompleted(scoped_ptr<GCMStore::LoadResult> result) { |
| 243 DCHECK_EQ(LOADING, state_); | 243 DCHECK_EQ(LOADING, state_); |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 | 802 |
| 803 recorder_.RecordIncomingSendError( | 803 recorder_.RecordIncomingSendError( |
| 804 data_message_stanza.category(), | 804 data_message_stanza.category(), |
| 805 data_message_stanza.to(), | 805 data_message_stanza.to(), |
| 806 data_message_stanza.id()); | 806 data_message_stanza.id()); |
| 807 delegate_->OnMessageSendError(data_message_stanza.category(), | 807 delegate_->OnMessageSendError(data_message_stanza.category(), |
| 808 send_error_details); | 808 send_error_details); |
| 809 } | 809 } |
| 810 | 810 |
| 811 } // namespace gcm | 811 } // namespace gcm |
| OLD | NEW |