Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 631343002: [GCM] Fetching OAuth2 tokens periodically in account tracker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mapper-in-driver
Patch Set: Adding tests and removing pref related code from tests Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 new GCMChannelStatusSyncer(this, 356 new GCMChannelStatusSyncer(this,
357 prefs, 357 prefs,
358 channel_status_request_url, 358 channel_status_request_url,
359 user_agent, 359 user_agent,
360 request_context)), 360 request_context)),
361 signed_in_(false), 361 signed_in_(false),
362 gcm_started_(false), 362 gcm_started_(false),
363 gcm_enabled_(true), 363 gcm_enabled_(true),
364 connected_(false), 364 connected_(false),
365 account_mapper_(new GCMAccountMapper(this)), 365 account_mapper_(new GCMAccountMapper(this)),
366 last_token_fetch_time_(base::Time::Max()), // set to max as a sentinel
Nicolas Zea 2014/11/06 21:43:17 Why Max, vs null?
fgorski 2014/11/07 01:42:13 Max > Now() which means reporting will not be trig
366 ui_thread_(ui_thread), 367 ui_thread_(ui_thread),
367 io_thread_(io_thread), 368 io_thread_(io_thread),
368 weak_ptr_factory_(this) { 369 weak_ptr_factory_(this) {
369 gcm_enabled_ = gcm_channel_status_syncer_->gcm_enabled(); 370 gcm_enabled_ = gcm_channel_status_syncer_->gcm_enabled();
370 371
371 // Create and initialize the GCMClient. Note that this does not initiate the 372 // Create and initialize the GCMClient. Note that this does not initiate the
372 // GCM check-in. 373 // GCM check-in.
373 io_worker_.reset(new IOWorker(ui_thread, io_thread)); 374 io_worker_.reset(new IOWorker(ui_thread, io_thread));
374 io_thread_->PostTask( 375 io_thread_->PostTask(
375 FROM_HERE, 376 FROM_HERE,
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 813
813 // Normally request_gcm_statistics_callback_ would not be null. 814 // Normally request_gcm_statistics_callback_ would not be null.
814 if (!request_gcm_statistics_callback_.is_null()) 815 if (!request_gcm_statistics_callback_.is_null())
815 request_gcm_statistics_callback_.Run(stats); 816 request_gcm_statistics_callback_.Run(stats);
816 else 817 else
817 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL."; 818 LOG(WARNING) << "request_gcm_statistics_callback_ is NULL.";
818 } 819 }
819 820
820 } // namespace gcm 821 } // namespace gcm
821 822
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698