OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/web_resource/web_resource_service.h" | 5 #include "components/web_resource/web_resource_service.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/prefs/pref_service.h" | |
10 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
11 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
13 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
14 #include "base/thread_task_runner_handle.h" | 13 #include "base/thread_task_runner_handle.h" |
15 #include "base/time/time.h" | 14 #include "base/time/time.h" |
16 #include "base/values.h" | 15 #include "base/values.h" |
17 #include "components/google/core/browser/google_util.h" | 16 #include "components/google/core/browser/google_util.h" |
| 17 #include "components/prefs/pref_service.h" |
18 #include "net/base/load_flags.h" | 18 #include "net/base/load_flags.h" |
19 #include "net/url_request/url_fetcher.h" | 19 #include "net/url_request/url_fetcher.h" |
20 #include "net/url_request/url_request_context_getter.h" | 20 #include "net/url_request/url_request_context_getter.h" |
21 #include "net/url_request/url_request_status.h" | 21 #include "net/url_request/url_request_status.h" |
22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
23 | 23 |
24 // No anonymous namespace, because const variables automatically get internal | 24 // No anonymous namespace, because const variables automatically get internal |
25 // linkage. | 25 // linkage. |
26 const char kInvalidDataTypeError[] = | 26 const char kInvalidDataTypeError[] = |
27 "Data from web resource server is missing or not valid JSON."; | 27 "Data from web resource server is missing or not valid JSON."; |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 // Wait at least |start_fetch_delay_ms_|. | 180 // Wait at least |start_fetch_delay_ms_|. |
181 if (ms_until_update > start_fetch_delay_ms_) | 181 if (ms_until_update > start_fetch_delay_ms_) |
182 delay = ms_until_update; | 182 delay = ms_until_update; |
183 } | 183 } |
184 } | 184 } |
185 // Start fetch and wait for UpdateResourceCache. | 185 // Start fetch and wait for UpdateResourceCache. |
186 ScheduleFetch(delay); | 186 ScheduleFetch(delay); |
187 } | 187 } |
188 | 188 |
189 } // namespace web_resource | 189 } // namespace web_resource |
OLD | NEW |