| 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/fake_gcm_client.h" | 5 #include "components/gcm_driver/fake_gcm_client.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 | 74 |
| 75 void FakeGCMClient::Initialize( | 75 void FakeGCMClient::Initialize( |
| 76 const ChromeBuildInfo& chrome_build_info, | 76 const ChromeBuildInfo& chrome_build_info, |
| 77 const base::FilePath& store_path, | 77 const base::FilePath& store_path, |
| 78 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, | 78 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner, |
| 79 const scoped_refptr<net::URLRequestContextGetter>& | 79 const scoped_refptr<net::URLRequestContextGetter>& |
| 80 url_request_context_getter, | 80 url_request_context_getter, |
| 81 std::unique_ptr<Encryptor> encryptor, | 81 std::unique_ptr<Encryptor> encryptor, |
| 82 Delegate* delegate) { | 82 Delegate* delegate) { |
| 83 product_category_for_subtypes_ = |
| 84 chrome_build_info.product_category_for_subtypes; |
| 83 delegate_ = delegate; | 85 delegate_ = delegate; |
| 84 } | 86 } |
| 85 | 87 |
| 86 void FakeGCMClient::Start(StartMode start_mode) { | 88 void FakeGCMClient::Start(StartMode start_mode) { |
| 87 DCHECK(io_thread_->RunsTasksOnCurrentThread()); | 89 DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
| 88 | 90 |
| 89 if (started_) | 91 if (started_) |
| 90 return; | 92 return; |
| 91 | 93 |
| 92 if (start_mode == IMMEDIATE_START) | 94 if (start_mode == IMMEDIATE_START) |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 delegate_->OnMessageSendError(app_id, send_error_details); | 320 delegate_->OnMessageSendError(app_id, send_error_details); |
| 319 } | 321 } |
| 320 | 322 |
| 321 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, | 323 void FakeGCMClient::SendAcknowledgement(const std::string& app_id, |
| 322 const std::string& message_id) { | 324 const std::string& message_id) { |
| 323 if (delegate_) | 325 if (delegate_) |
| 324 delegate_->OnSendAcknowledged(app_id, message_id); | 326 delegate_->OnSendAcknowledged(app_id, message_id); |
| 325 } | 327 } |
| 326 | 328 |
| 327 } // namespace gcm | 329 } // namespace gcm |
| OLD | NEW |