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_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 Loading... |
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 Loading... |
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 |
OLD | NEW |