| 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 "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" | 5 #include "chrome/browser/renderer_host/safe_browsing_resource_throttle.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/prerender/prerender_tracker.h" | 9 #include "chrome/browser/prerender/prerender_tracker.h" |
| 10 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" | 10 #include "chrome/browser/renderer_host/chrome_url_request_user_data.h" |
| 11 #include "content/public/browser/resource_throttle_controller.h" | 11 #include "content/public/browser/resource_controller.h" |
| 12 #include "net/base/load_flags.h" | 12 #include "net/base/load_flags.h" |
| 13 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
| 14 | 14 |
| 15 // Maximum time in milliseconds to wait for the safe browsing service to | 15 // Maximum time in milliseconds to wait for the safe browsing service to |
| 16 // verify a URL. After this amount of time the outstanding check will be | 16 // verify a URL. After this amount of time the outstanding check will be |
| 17 // aborted, and the URL will be treated as if it were safe. | 17 // aborted, and the URL will be treated as if it were safe. |
| 18 static const int kCheckUrlTimeoutMs = 5000; | 18 static const int kCheckUrlTimeoutMs = 5000; |
| 19 | 19 |
| 20 // TODO(eroman): Downgrade these CHECK()s to DCHECKs once there is more | 20 // TODO(eroman): Downgrade these CHECK()s to DCHECKs once there is more |
| 21 // unit test coverage. | 21 // unit test coverage. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 OnBrowseUrlCheckResult(url_being_checked_, SafeBrowsingService::SAFE); | 197 OnBrowseUrlCheckResult(url_being_checked_, SafeBrowsingService::SAFE); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void SafeBrowsingResourceThrottle::ResumeRequest() { | 200 void SafeBrowsingResourceThrottle::ResumeRequest() { |
| 201 CHECK(state_ == STATE_NONE); | 201 CHECK(state_ == STATE_NONE); |
| 202 CHECK(defer_state_ != DEFERRED_NONE); | 202 CHECK(defer_state_ != DEFERRED_NONE); |
| 203 | 203 |
| 204 defer_state_ = DEFERRED_NONE; | 204 defer_state_ = DEFERRED_NONE; |
| 205 controller()->Resume(); | 205 controller()->Resume(); |
| 206 } | 206 } |
| OLD | NEW |