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 "extensions/browser/extension_throttle_entry.h" | 5 #include "extensions/browser/extension_throttle_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/rand_util.h" | 11 #include "base/rand_util.h" |
12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "extensions/browser/extension_throttle_manager.h" | 14 #include "extensions/browser/extension_throttle_manager.h" |
15 #include "net/base/load_flags.h" | 15 #include "net/base/load_flags.h" |
16 #include "net/log/net_log.h" | 16 #include "net/log/net_log_capture_mode.h" |
17 #include "net/log/net_log_event_type.h" | 17 #include "net/log/net_log_event_type.h" |
18 #include "net/log/net_log_source_type.h" | 18 #include "net/log/net_log_source_type.h" |
19 #include "net/url_request/url_request.h" | 19 #include "net/url_request/url_request.h" |
20 #include "net/url_request/url_request_context.h" | 20 #include "net/url_request/url_request_context.h" |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 const int ExtensionThrottleEntry::kDefaultSlidingWindowPeriodMs = 2000; | 24 const int ExtensionThrottleEntry::kDefaultSlidingWindowPeriodMs = 2000; |
25 const int ExtensionThrottleEntry::kDefaultMaxSendThreshold = 20; | 25 const int ExtensionThrottleEntry::kDefaultMaxSendThreshold = 20; |
26 | 26 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 net::BackoffEntry* ExtensionThrottleEntry::GetBackoffEntry() { | 280 net::BackoffEntry* ExtensionThrottleEntry::GetBackoffEntry() { |
281 return &backoff_entry_; | 281 return &backoff_entry_; |
282 } | 282 } |
283 | 283 |
284 // static | 284 // static |
285 bool ExtensionThrottleEntry::ExplicitUserRequest(const int load_flags) { | 285 bool ExtensionThrottleEntry::ExplicitUserRequest(const int load_flags) { |
286 return (load_flags & net::LOAD_MAYBE_USER_GESTURE) != 0; | 286 return (load_flags & net::LOAD_MAYBE_USER_GESTURE) != 0; |
287 } | 287 } |
288 | 288 |
289 } // namespace extensions | 289 } // namespace extensions |
OLD | NEW |