Chromium Code Reviews| Index: net/url_request/url_request_throttler_entry.cc |
| diff --git a/net/url_request/url_request_throttler_entry.cc b/net/url_request/url_request_throttler_entry.cc |
| index bf831caec1bacc90994495cd879f78e637c2a50c..4566c725f1767630f385f9ed44a19ac5b3823f16 100644 |
| --- a/net/url_request/url_request_throttler_entry.cc |
| +++ b/net/url_request/url_request_throttler_entry.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/rand_util.h" |
| #include "base/string_number_conversions.h" |
| #include "base/values.h" |
| +#include "net/base/load_flags.h" |
| #include "net/base/net_log.h" |
| #include "net/url_request/url_request_throttler_header_interface.h" |
| #include "net/url_request/url_request_throttler_manager.h" |
| @@ -178,9 +179,10 @@ void URLRequestThrottlerEntry::DetachManager() { |
| manager_ = NULL; |
| } |
| -bool URLRequestThrottlerEntry::IsDuringExponentialBackoff() const { |
| +bool URLRequestThrottlerEntry::ShouldRejectRequest(int load_flags) const { |
| bool reject_request = false; |
| - if (!is_backoff_disabled_ && GetBackoffEntry()->ShouldRejectRequest()) { |
| + if (!is_backoff_disabled_ && !ExplicitUserRequest(load_flags) && |
| + GetBackoffEntry()->ShouldRejectRequest()) { |
| int num_failures = GetBackoffEntry()->failure_count(); |
| int release_after_ms = |
| (GetBackoffEntry()->GetReleaseTime() - base::TimeTicks::Now()) |
| @@ -444,4 +446,9 @@ BackoffEntry* URLRequestThrottlerEntry::GetBackoffEntry() { |
| return &backoff_entry_; |
| } |
| +// static |
| +bool URLRequestThrottlerEntry::ExplicitUserRequest(const int load_flags) { |
| + return (load_flags & (LOAD_MAYBE_USER_GESTURE)) != 0; |
|
yzshen1
2011/08/05 21:50:41
nit: the inner parentheses seem unnecessary.
Jói
2011/08/08 17:09:45
Done.
|
| +} |
| + |
| } // namespace net |