| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/browser/url_fetcher_protect.h" | 5 #include "chrome/browser/url_fetcher_protect.h" |
| 6 | 6 |
| 7 // URLFetcherProtectEntry ---------------------------------------------------- | 7 // URLFetcherProtectEntry ---------------------------------------------------- |
| 8 | 8 |
| 9 using base::TimeDelta; |
| 10 using base::TimeTicks; |
| 9 | 11 |
| 10 // Default parameters. Time is in milliseconds. | 12 // Default parameters. Time is in milliseconds. |
| 11 // static | 13 // static |
| 12 const int URLFetcherProtectEntry::kDefaultSlidingWindowPeriod = 2000; | 14 const int URLFetcherProtectEntry::kDefaultSlidingWindowPeriod = 2000; |
| 13 | 15 |
| 14 const int URLFetcherProtectEntry::kDefaultMaxSendThreshold = 20; | 16 const int URLFetcherProtectEntry::kDefaultMaxSendThreshold = 20; |
| 15 const int URLFetcherProtectEntry::kDefaultMaxRetries = 0; | 17 const int URLFetcherProtectEntry::kDefaultMaxRetries = 0; |
| 16 | 18 |
| 17 const int URLFetcherProtectEntry::kDefaultInitialTimeout = 100; | 19 const int URLFetcherProtectEntry::kDefaultInitialTimeout = 100; |
| 18 const double URLFetcherProtectEntry::kDefaultMultiplier = 2.0; | 20 const double URLFetcherProtectEntry::kDefaultMultiplier = 2.0; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 164 |
| 163 ProtectService::iterator i = services_.find(id); | 165 ProtectService::iterator i = services_.find(id); |
| 164 if (i != services_.end()) { | 166 if (i != services_.end()) { |
| 165 // The entry exists. | 167 // The entry exists. |
| 166 delete i->second; | 168 delete i->second; |
| 167 } | 169 } |
| 168 | 170 |
| 169 services_[id] = entry; | 171 services_[id] = entry; |
| 170 return entry; | 172 return entry; |
| 171 } | 173 } |
| 172 | |
| OLD | NEW |