Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(150)

Side by Side Diff: extensions/browser/extension_throttle_entry.cc

Issue 1549643002: Switch to standard integer types in extensions/browser/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@clean
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 GetBackoffEntry()->ShouldRejectRequest()) { 153 GetBackoffEntry()->ShouldRejectRequest()) {
154 net_log_.AddEvent(net::NetLog::TYPE_THROTTLING_REJECTED_REQUEST, 154 net_log_.AddEvent(net::NetLog::TYPE_THROTTLING_REJECTED_REQUEST,
155 base::Bind(&NetLogRejectedRequestCallback, &url_id_, 155 base::Bind(&NetLogRejectedRequestCallback, &url_id_,
156 GetBackoffEntry()->failure_count(), 156 GetBackoffEntry()->failure_count(),
157 GetBackoffEntry()->GetTimeUntilRelease())); 157 GetBackoffEntry()->GetTimeUntilRelease()));
158 reject_request = true; 158 reject_request = true;
159 } 159 }
160 return reject_request; 160 return reject_request;
161 } 161 }
162 162
163 int64 ExtensionThrottleEntry::ReserveSendingTimeForNextRequest( 163 int64_t ExtensionThrottleEntry::ReserveSendingTimeForNextRequest(
164 const base::TimeTicks& earliest_time) { 164 const base::TimeTicks& earliest_time) {
165 base::TimeTicks now = ImplGetTimeNow(); 165 base::TimeTicks now = ImplGetTimeNow();
166 166
167 // If a lot of requests were successfully made recently, 167 // If a lot of requests were successfully made recently,
168 // sliding_window_release_time_ may be greater than 168 // sliding_window_release_time_ may be greater than
169 // exponential_backoff_release_time_. 169 // exponential_backoff_release_time_.
170 base::TimeTicks recommended_sending_time = 170 base::TimeTicks recommended_sending_time =
171 std::max(std::max(now, earliest_time), 171 std::max(std::max(now, earliest_time),
172 std::max(GetBackoffEntry()->GetReleaseTime(), 172 std::max(GetBackoffEntry()->GetReleaseTime(),
173 sliding_window_release_time_)); 173 sliding_window_release_time_));
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 net::BackoffEntry* ExtensionThrottleEntry::GetBackoffEntry() { 278 net::BackoffEntry* ExtensionThrottleEntry::GetBackoffEntry() {
279 return &backoff_entry_; 279 return &backoff_entry_;
280 } 280 }
281 281
282 // static 282 // static
283 bool ExtensionThrottleEntry::ExplicitUserRequest(const int load_flags) { 283 bool ExtensionThrottleEntry::ExplicitUserRequest(const int load_flags) {
284 return (load_flags & net::LOAD_MAYBE_USER_GESTURE) != 0; 284 return (load_flags & net::LOAD_MAYBE_USER_GESTURE) != 0;
285 } 285 }
286 286
287 } // namespace extensions 287 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_throttle_entry.h ('k') | extensions/browser/extension_throttle_entry_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698