| 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 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 virtual Value* ToValue() const { | 63 virtual Value* ToValue() const { |
| 64 DictionaryValue* dict = new DictionaryValue(); | 64 DictionaryValue* dict = new DictionaryValue(); |
| 65 dict->SetString("url", url_id_); | 65 dict->SetString("url", url_id_); |
| 66 dict->SetInteger("num_failures", num_failures_); | 66 dict->SetInteger("num_failures", num_failures_); |
| 67 dict->SetInteger("release_after_ms", release_after_ms_); | 67 dict->SetInteger("release_after_ms", release_after_ms_); |
| 68 return dict; | 68 return dict; |
| 69 } | 69 } |
| 70 | 70 |
| 71 protected: |
| 72 virtual ~RejectedRequestParameters() {} |
| 73 |
| 71 private: | 74 private: |
| 72 std::string url_id_; | 75 std::string url_id_; |
| 73 int num_failures_; | 76 int num_failures_; |
| 74 int release_after_ms_; | 77 int release_after_ms_; |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 URLRequestThrottlerEntry::URLRequestThrottlerEntry( | 80 URLRequestThrottlerEntry::URLRequestThrottlerEntry( |
| 78 URLRequestThrottlerManager* manager, | 81 URLRequestThrottlerManager* manager, |
| 79 const std::string& url_id) | 82 const std::string& url_id) |
| 80 : sliding_window_period_( | 83 : sliding_window_period_( |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 BackoffEntry* URLRequestThrottlerEntry::GetBackoffEntry() { | 360 BackoffEntry* URLRequestThrottlerEntry::GetBackoffEntry() { |
| 358 return &backoff_entry_; | 361 return &backoff_entry_; |
| 359 } | 362 } |
| 360 | 363 |
| 361 // static | 364 // static |
| 362 bool URLRequestThrottlerEntry::ExplicitUserRequest(const int load_flags) { | 365 bool URLRequestThrottlerEntry::ExplicitUserRequest(const int load_flags) { |
| 363 return (load_flags & LOAD_MAYBE_USER_GESTURE) != 0; | 366 return (load_flags & LOAD_MAYBE_USER_GESTURE) != 0; |
| 364 } | 367 } |
| 365 | 368 |
| 366 } // namespace net | 369 } // namespace net |
| OLD | NEW |