OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "net/url_request/url_request_throttler_entry.h" | 5 #include "net/url_request/url_request_throttler_entry.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
13 #include "base/rand_util.h" | 13 #include "base/rand_util.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "net/base/load_flags.h" | 16 #include "net/base/load_flags.h" |
17 #include "net/log/net_log.h" | 17 #include "net/log/net_log_capture_mode.h" |
18 #include "net/log/net_log_event_type.h" | 18 #include "net/log/net_log_event_type.h" |
19 #include "net/log/net_log_source_type.h" | 19 #include "net/log/net_log_source_type.h" |
20 #include "net/url_request/url_request.h" | 20 #include "net/url_request/url_request.h" |
21 #include "net/url_request/url_request_context.h" | 21 #include "net/url_request/url_request_context.h" |
22 #include "net/url_request/url_request_throttler_manager.h" | 22 #include "net/url_request/url_request_throttler_manager.h" |
23 | 23 |
24 namespace net { | 24 namespace net { |
25 | 25 |
26 const int URLRequestThrottlerEntry::kDefaultSlidingWindowPeriodMs = 2000; | 26 const int URLRequestThrottlerEntry::kDefaultSlidingWindowPeriodMs = 2000; |
27 const int URLRequestThrottlerEntry::kDefaultMaxSendThreshold = 20; | 27 const int URLRequestThrottlerEntry::kDefaultMaxSendThreshold = 20; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 BackoffEntry* URLRequestThrottlerEntry::GetBackoffEntry() { | 284 BackoffEntry* URLRequestThrottlerEntry::GetBackoffEntry() { |
285 return &backoff_entry_; | 285 return &backoff_entry_; |
286 } | 286 } |
287 | 287 |
288 // static | 288 // static |
289 bool URLRequestThrottlerEntry::ExplicitUserRequest(const int load_flags) { | 289 bool URLRequestThrottlerEntry::ExplicitUserRequest(const int load_flags) { |
290 return (load_flags & LOAD_MAYBE_USER_GESTURE) != 0; | 290 return (load_flags & LOAD_MAYBE_USER_GESTURE) != 0; |
291 } | 291 } |
292 | 292 |
293 } // namespace net | 293 } // namespace net |
OLD | NEW |