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/google/core/browser/google_url_tracker.h" | 5 #include "components/google/core/browser/google_url_tracker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/macros.h" |
10 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
11 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
13 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
14 #include "components/data_use_measurement/core/data_use_user_data.h" | 15 #include "components/data_use_measurement/core/data_use_user_data.h" |
15 #include "components/google/core/browser/google_pref_names.h" | 16 #include "components/google/core/browser/google_pref_names.h" |
16 #include "components/google/core/browser/google_switches.h" | 17 #include "components/google/core/browser/google_switches.h" |
17 #include "components/google/core/browser/google_util.h" | 18 #include "components/google/core/browser/google_util.h" |
18 #include "components/pref_registry/pref_registry_syncable.h" | 19 #include "components/pref_registry/pref_registry_syncable.h" |
19 #include "net/base/load_flags.h" | 20 #include "net/base/load_flags.h" |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 // Also retry kMaxRetries times on network change errors. A network change can | 182 // Also retry kMaxRetries times on network change errors. A network change can |
182 // propagate through Chrome in various stages, so it's possible for this code | 183 // propagate through Chrome in various stages, so it's possible for this code |
183 // to be reached via OnNetworkChanged(), and then have the fetch we kick off | 184 // to be reached via OnNetworkChanged(), and then have the fetch we kick off |
184 // be canceled due to e.g. the DNS server changing at a later time. In general | 185 // be canceled due to e.g. the DNS server changing at a later time. In general |
185 // it's not possible to ensure that by the time we reach here any requests we | 186 // it's not possible to ensure that by the time we reach here any requests we |
186 // start won't be canceled in this fashion, so retrying is the best we can do. | 187 // start won't be canceled in this fashion, so retrying is the best we can do. |
187 fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries); | 188 fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries); |
188 | 189 |
189 fetcher_->Start(); | 190 fetcher_->Start(); |
190 } | 191 } |
OLD | NEW |