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_driver_desktop.h" | 5 #include "components/gcm_driver/gcm_driver_desktop.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 const std::string& account_id) { | 328 const std::string& account_id) { |
329 DCHECK(io_thread_->RunsTasksOnCurrentThread()); | 329 DCHECK(io_thread_->RunsTasksOnCurrentThread()); |
330 | 330 |
331 if (gcm_client_.get()) | 331 if (gcm_client_.get()) |
332 gcm_client_->RemoveAccountMapping(account_id); | 332 gcm_client_->RemoveAccountMapping(account_id); |
333 } | 333 } |
334 | 334 |
335 GCMDriverDesktop::GCMDriverDesktop( | 335 GCMDriverDesktop::GCMDriverDesktop( |
336 scoped_ptr<GCMClientFactory> gcm_client_factory, | 336 scoped_ptr<GCMClientFactory> gcm_client_factory, |
337 const GCMClient::ChromeBuildInfo& chrome_build_info, | 337 const GCMClient::ChromeBuildInfo& chrome_build_info, |
| 338 const std::string& channel_status_request_url, |
| 339 const std::string& user_agent, |
338 PrefService* prefs, | 340 PrefService* prefs, |
339 const base::FilePath& store_path, | 341 const base::FilePath& store_path, |
340 const scoped_refptr<net::URLRequestContextGetter>& request_context, | 342 const scoped_refptr<net::URLRequestContextGetter>& request_context, |
341 const scoped_refptr<base::SequencedTaskRunner>& ui_thread, | 343 const scoped_refptr<base::SequencedTaskRunner>& ui_thread, |
342 const scoped_refptr<base::SequencedTaskRunner>& io_thread, | 344 const scoped_refptr<base::SequencedTaskRunner>& io_thread, |
343 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner) | 345 const scoped_refptr<base::SequencedTaskRunner>& blocking_task_runner) |
344 : gcm_channel_status_syncer_( | 346 : gcm_channel_status_syncer_( |
345 new GCMChannelStatusSyncer(this, prefs, request_context)), | 347 new GCMChannelStatusSyncer(this, |
| 348 prefs, |
| 349 channel_status_request_url, |
| 350 user_agent, |
| 351 request_context)), |
346 signed_in_(false), | 352 signed_in_(false), |
347 gcm_started_(false), | 353 gcm_started_(false), |
348 gcm_enabled_(true), | 354 gcm_enabled_(true), |
349 connected_(false), | 355 connected_(false), |
350 ui_thread_(ui_thread), | 356 ui_thread_(ui_thread), |
351 io_thread_(io_thread), | 357 io_thread_(io_thread), |
352 weak_ptr_factory_(this) { | 358 weak_ptr_factory_(this) { |
353 gcm_enabled_ = gcm_channel_status_syncer_->gcm_enabled(); | 359 gcm_enabled_ = gcm_channel_status_syncer_->gcm_enabled(); |
354 | 360 |
355 // Create and initialize the GCMClient. Note that this does not initiate the | 361 // Create and initialize the GCMClient. Note that this does not initiate the |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 | 768 |
763 // Normally request_gcm_statistics_callback_ would not be null. | 769 // Normally request_gcm_statistics_callback_ would not be null. |
764 if (!request_gcm_statistics_callback_.is_null()) | 770 if (!request_gcm_statistics_callback_.is_null()) |
765 request_gcm_statistics_callback_.Run(stats); | 771 request_gcm_statistics_callback_.Run(stats); |
766 else | 772 else |
767 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; | 773 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; |
768 } | 774 } |
769 | 775 |
770 } // namespace gcm | 776 } // namespace gcm |
771 | 777 |
OLD | NEW |