| 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/suggestions/suggestions_service.h" | 5 #include "components/suggestions/suggestions_service.h" |
| 6 | 6 |
| 7 #include <sstream> | 7 #include <sstream> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/metrics/sparse_histogram.h" | 13 #include "base/metrics/sparse_histogram.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 17 #include "components/pref_registry/pref_registry_syncable.h" | 17 #include "components/pref_registry/pref_registry_syncable.h" |
| 18 #include "components/suggestions/blacklist_store.h" | 18 #include "components/suggestions/blacklist_store.h" |
| 19 #include "components/suggestions/suggestions_store.h" | 19 #include "components/suggestions/suggestions_store.h" |
| 20 #include "components/variations/net/variations_http_header_provider.h" |
| 20 #include "components/variations/variations_associated_data.h" | 21 #include "components/variations/variations_associated_data.h" |
| 21 #include "components/variations/variations_http_header_provider.h" | |
| 22 #include "net/base/escape.h" | 22 #include "net/base/escape.h" |
| 23 #include "net/base/load_flags.h" | 23 #include "net/base/load_flags.h" |
| 24 #include "net/base/net_errors.h" | 24 #include "net/base/net_errors.h" |
| 25 #include "net/base/url_util.h" | 25 #include "net/base/url_util.h" |
| 26 #include "net/http/http_response_headers.h" | 26 #include "net/http/http_response_headers.h" |
| 27 #include "net/http/http_status_code.h" | 27 #include "net/http/http_status_code.h" |
| 28 #include "net/http/http_util.h" | 28 #include "net/http/http_util.h" |
| 29 #include "net/url_request/url_fetcher.h" | 29 #include "net/url_request/url_fetcher.h" |
| 30 #include "net/url_request/url_request_status.h" | 30 #include "net/url_request/url_request_status.h" |
| 31 #include "url/gurl.h" | 31 #include "url/gurl.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 if (last_request_successful) { | 416 if (last_request_successful) { |
| 417 blacklist_delay_sec_ = kBlacklistDefaultDelaySec; | 417 blacklist_delay_sec_ = kBlacklistDefaultDelaySec; |
| 418 } else { | 418 } else { |
| 419 int candidate_delay = blacklist_delay_sec_ * kBlacklistBackoffMultiplier; | 419 int candidate_delay = blacklist_delay_sec_ * kBlacklistBackoffMultiplier; |
| 420 if (candidate_delay < kBlacklistMaxDelaySec) | 420 if (candidate_delay < kBlacklistMaxDelaySec) |
| 421 blacklist_delay_sec_ = candidate_delay; | 421 blacklist_delay_sec_ = candidate_delay; |
| 422 } | 422 } |
| 423 } | 423 } |
| 424 | 424 |
| 425 } // namespace suggestions | 425 } // namespace suggestions |
| OLD | NEW |