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

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

Issue 561943002: Reland: Add GCMChannelStatusSyncer to schedule requests and enable/disable GCM (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOS test failures Created 6 years, 3 months 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_channel_status_request.h" 5 #include "components/gcm_driver/gcm_channel_status_request.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "components/gcm_driver/gcm_backoff_policy.h" 9 #include "components/gcm_driver/gcm_backoff_policy.h"
10 #include "components/gcm_driver/proto/gcm_channel_status.pb.h" 10 #include "components/gcm_driver/proto/gcm_channel_status.pb.h"
(...skipping 23 matching lines...) Expand all
34 : request_context_getter_(request_context_getter), 34 : request_context_getter_(request_context_getter),
35 callback_(callback), 35 callback_(callback),
36 backoff_entry_(&(GetGCMBackoffPolicy())), 36 backoff_entry_(&(GetGCMBackoffPolicy())),
37 weak_ptr_factory_(this) { 37 weak_ptr_factory_(this) {
38 } 38 }
39 39
40 GCMChannelStatusRequest::~GCMChannelStatusRequest() { 40 GCMChannelStatusRequest::~GCMChannelStatusRequest() {
41 } 41 }
42 42
43 // static 43 // static
44 int GCMChannelStatusRequest::default_poll_interval_seconds_for_testing() { 44 int GCMChannelStatusRequest::default_poll_interval_seconds() {
45 return kDefaultPollIntervalSeconds; 45 return kDefaultPollIntervalSeconds;
46 } 46 }
47 47
48 // static 48 // static
49 int GCMChannelStatusRequest::min_poll_interval_seconds_for_testing() { 49 int GCMChannelStatusRequest::min_poll_interval_seconds() {
50 return kMinPollIntervalSeconds; 50 return kMinPollIntervalSeconds;
51 } 51 }
52 52
53 void GCMChannelStatusRequest::Start() { 53 void GCMChannelStatusRequest::Start() {
54 DCHECK(!url_fetcher_.get()); 54 DCHECK(!url_fetcher_.get());
55 55
56 GURL request_url(kGCMChannelStatusRequestURL); 56 GURL request_url(kGCMChannelStatusRequestURL);
57 57
58 gcm_proto::ExperimentStatusRequest proto_data; 58 gcm_proto::ExperimentStatusRequest proto_data;
59 proto_data.add_experiment_name(kGCMChannelTag); 59 proto_data.add_experiment_name(kGCMChannelTag);
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 weak_ptr_factory_.GetWeakPtr(), 137 weak_ptr_factory_.GetWeakPtr(),
138 false), 138 false),
139 backoff_entry_.GetTimeUntilRelease()); 139 backoff_entry_.GetTimeUntilRelease());
140 return; 140 return;
141 } 141 }
142 142
143 Start(); 143 Start();
144 } 144 }
145 145
146 } // namespace gcm 146 } // namespace gcm
OLDNEW
« no previous file with comments | « components/gcm_driver/gcm_channel_status_request.h ('k') | components/gcm_driver/gcm_channel_status_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698