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/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
11 #include "components/gcm_driver/gcm_backoff_policy.h" | 11 #include "components/gcm_driver/gcm_backoff_policy.h" |
| 12 #include "components/sync/protocol/experiment_status.pb.h" |
12 #include "net/base/escape.h" | 13 #include "net/base/escape.h" |
13 #include "net/base/load_flags.h" | 14 #include "net/base/load_flags.h" |
14 #include "net/http/http_status_code.h" | 15 #include "net/http/http_status_code.h" |
15 #include "net/url_request/url_fetcher.h" | 16 #include "net/url_request/url_fetcher.h" |
16 #include "net/url_request/url_request_status.h" | 17 #include "net/url_request/url_request_status.h" |
17 #include "sync/protocol/experiment_status.pb.h" | |
18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
19 | 19 |
20 namespace gcm { | 20 namespace gcm { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 const char kRequestContentType[] = "application/octet-stream"; | 24 const char kRequestContentType[] = "application/octet-stream"; |
25 const char kGCMChannelTag[] = "gcm_channel"; | 25 const char kGCMChannelTag[] = "gcm_channel"; |
26 const int kDefaultPollIntervalSeconds = 60 * 60; // 60 minutes. | 26 const int kDefaultPollIntervalSeconds = 60 * 60; // 60 minutes. |
27 const int kMinPollIntervalSeconds = 30 * 60; // 30 minutes. | 27 const int kMinPollIntervalSeconds = 30 * 60; // 30 minutes. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 FROM_HERE, base::Bind(&GCMChannelStatusRequest::RetryWithBackoff, | 148 FROM_HERE, base::Bind(&GCMChannelStatusRequest::RetryWithBackoff, |
149 weak_ptr_factory_.GetWeakPtr(), false), | 149 weak_ptr_factory_.GetWeakPtr(), false), |
150 backoff_entry_.GetTimeUntilRelease()); | 150 backoff_entry_.GetTimeUntilRelease()); |
151 return; | 151 return; |
152 } | 152 } |
153 | 153 |
154 Start(); | 154 Start(); |
155 } | 155 } |
156 | 156 |
157 } // namespace gcm | 157 } // namespace gcm |
OLD | NEW |