Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/safe_browsing/protocol_manager.h" | 5 #include "chrome/browser/safe_browsing/protocol_manager.h" |
| 6 | 6 |
| 7 #ifndef NDEBUG | 7 #ifndef NDEBUG |
| 8 #include "base/base64.h" | 8 #include "base/base64.h" |
| 9 #endif | 9 #endif |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 request_context_getter_(request_context_getter), | 110 request_context_getter_(request_context_getter), |
| 111 http_url_prefix_(http_url_prefix), | 111 http_url_prefix_(http_url_prefix), |
| 112 https_url_prefix_(https_url_prefix), | 112 https_url_prefix_(https_url_prefix), |
| 113 disable_auto_update_(disable_auto_update) { | 113 disable_auto_update_(disable_auto_update) { |
| 114 DCHECK(!http_url_prefix_.empty() && !https_url_prefix_.empty()); | 114 DCHECK(!http_url_prefix_.empty() && !https_url_prefix_.empty()); |
| 115 | 115 |
| 116 // Set the backoff multiplier fuzz to a random value between 0 and 1. | 116 // Set the backoff multiplier fuzz to a random value between 0 and 1. |
| 117 back_off_fuzz_ = static_cast<float>(base::RandDouble()); | 117 back_off_fuzz_ = static_cast<float>(base::RandDouble()); |
| 118 // The first update must happen between 1-5 minutes of start up. | 118 // The first update must happen between 1-5 minutes of start up. |
| 119 next_update_sec_ = base::RandInt(60, kSbTimerStartIntervalSec); | 119 next_update_sec_ = base::RandInt(60, kSbTimerStartIntervalSec); |
| 120 next_update_sec_ = 30; | |
|
lzheng
2011/03/04 00:29:06
This should not be in the change?
Scott Hess - ex-Googler
2011/03/04 00:40:08
Doh! Testing code. thx.
| |
| 120 | 121 |
| 121 chrome::VersionInfo version_info; | 122 chrome::VersionInfo version_info; |
| 122 if (!version_info.is_valid() || version_info.Version().empty()) | 123 if (!version_info.is_valid() || version_info.Version().empty()) |
| 123 version_ = "0.1"; | 124 version_ = "0.1"; |
| 124 else | 125 else |
| 125 version_ = version_info.Version(); | 126 version_ = version_info.Version(); |
| 126 } | 127 } |
| 127 | 128 |
| 128 // static | 129 // static |
| 129 void SafeBrowsingProtocolManager::RecordGetHashResult( | 130 void SafeBrowsingProtocolManager::RecordGetHashResult( |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 811 if (!additional_query_.empty()) { | 812 if (!additional_query_.empty()) { |
| 812 if (next_url.find("?") != std::string::npos) { | 813 if (next_url.find("?") != std::string::npos) { |
| 813 next_url.append("&"); | 814 next_url.append("&"); |
| 814 } else { | 815 } else { |
| 815 next_url.append("?"); | 816 next_url.append("?"); |
| 816 } | 817 } |
| 817 next_url.append(additional_query_); | 818 next_url.append(additional_query_); |
| 818 } | 819 } |
| 819 return GURL(next_url); | 820 return GURL(next_url); |
| 820 } | 821 } |
| OLD | NEW |