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

Side by Side Diff: chrome/browser/renderer_host/safe_browsing_resource_throttle.cc

Issue 1110723002: Split to SafeBrowsingDatabaseManager into Local* and Remote*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to review. Tweak comments and list initializer. Created 5 years, 7 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 "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_contents.h" 9 #include "chrome/browser/prerender/prerender_contents.h"
10 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 10 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 // the URL has been classified. 84 // the URL has been classified.
85 void SafeBrowsingResourceThrottle::OnCheckBrowseUrlResult( 85 void SafeBrowsingResourceThrottle::OnCheckBrowseUrlResult(
86 const GURL& url, 86 const GURL& url,
87 SBThreatType threat_type, 87 SBThreatType threat_type,
88 const std::string& metadata) { 88 const std::string& metadata) {
89 CHECK(state_ == STATE_CHECKING_URL); 89 CHECK(state_ == STATE_CHECKING_URL);
90 CHECK(defer_state_ != DEFERRED_NONE); 90 CHECK(defer_state_ != DEFERRED_NONE);
91 CHECK(url == url_being_checked_) << "Was expecting: " << url_being_checked_ 91 CHECK(url == url_being_checked_) << "Was expecting: " << url_being_checked_
92 << " but got: " << url; 92 << " but got: " << url;
93 93
94 #if defined(OS_ANDROID)
95 // Temporarily disable SB interstitial during Finch experiment.
96 // The database check is still exercised, but the interstitial never shown.
97 threat_type = SB_THREAT_TYPE_SAFE;
98 #endif
Nico 2015/05/13 00:07:23 Same question
Nathan Parker 2015/05/13 00:11:23 Acknowledged.
99
100 timer_.Stop(); // Cancel the timeout timer. 94 timer_.Stop(); // Cancel the timeout timer.
101 threat_type_ = threat_type; 95 threat_type_ = threat_type;
102 state_ = STATE_NONE; 96 state_ = STATE_NONE;
103 97
104 if (threat_type == SB_THREAT_TYPE_SAFE) { 98 if (threat_type == SB_THREAT_TYPE_SAFE) {
105 // Log how much time the safe browsing check cost us. 99 // Log how much time the safe browsing check cost us.
106 ui_manager_->LogPauseDelay(base::TimeTicks::Now() - url_check_start_time_); 100 ui_manager_->LogPauseDelay(base::TimeTicks::Now() - url_check_start_time_);
107 101
108 // Continue the request. 102 // Continue the request.
109 ResumeRequest(); 103 ResumeRequest();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 url_being_checked_, SB_THREAT_TYPE_SAFE, std::string()); 218 url_being_checked_, SB_THREAT_TYPE_SAFE, std::string());
225 } 219 }
226 220
227 void SafeBrowsingResourceThrottle::ResumeRequest() { 221 void SafeBrowsingResourceThrottle::ResumeRequest() {
228 CHECK(state_ == STATE_NONE); 222 CHECK(state_ == STATE_NONE);
229 CHECK(defer_state_ != DEFERRED_NONE); 223 CHECK(defer_state_ != DEFERRED_NONE);
230 224
231 defer_state_ = DEFERRED_NONE; 225 defer_state_ = DEFERRED_NONE;
232 controller()->Resume(); 226 controller()->Resume();
233 } 227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698