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

Side by Side Diff: chrome/browser/safe_browsing/database_manager.cc

Issue 15080009: Enable the side-effect free whitelist and use it for local browsing based (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/database_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/safe_browsing/database_manager.h" 5 #include "chrome/browser/safe_browsing/database_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 check, 263 check,
264 base::Bind(&SafeBrowsingDatabaseManager::CheckExtensionIDsOnSBThread, 264 base::Bind(&SafeBrowsingDatabaseManager::CheckExtensionIDsOnSBThread,
265 this, 265 this,
266 check)); 266 check));
267 return false; 267 return false;
268 } 268 }
269 269
270 bool SafeBrowsingDatabaseManager::CheckSideEffectFreeWhitelistUrl( 270 bool SafeBrowsingDatabaseManager::CheckSideEffectFreeWhitelistUrl(
271 const GURL& url) { 271 const GURL& url) {
272 if (!enabled_) 272 if (!enabled_)
273 return true; 273 return false;
274 274
275 if (!CanCheckUrl(url)) 275 if (!CanCheckUrl(url))
276 return true; 276 return false;
277 277
278 return database_->ContainsSideEffectFreeWhitelistUrl(url); 278 return database_->ContainsSideEffectFreeWhitelistUrl(url);
279 } 279 }
280 280
281 bool SafeBrowsingDatabaseManager::MatchCsdWhitelistUrl(const GURL& url) { 281 bool SafeBrowsingDatabaseManager::MatchCsdWhitelistUrl(const GURL& url) {
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
283 if (!enabled_ || !enable_csd_whitelist_ || !MakeDatabaseAvailable()) { 283 if (!enabled_ || !enable_csd_whitelist_ || !MakeDatabaseAvailable()) {
284 // There is something funky going on here -- for example, perhaps the user 284 // There is something funky going on here -- for example, perhaps the user
285 // has not restarted since enabling metrics reporting, so we haven't 285 // has not restarted since enabling metrics reporting, so we haven't
286 // enabled the csd whitelist yet. Just to be safe we return true in this 286 // enabled the csd whitelist yet. Just to be safe we return true in this
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this)); 1038 new base::WeakPtrFactory<SafeBrowsingDatabaseManager>(this));
1039 checks_.insert(check); 1039 checks_.insert(check);
1040 1040
1041 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); 1041 safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task);
1042 1042
1043 MessageLoop::current()->PostDelayedTask(FROM_HERE, 1043 MessageLoop::current()->PostDelayedTask(FROM_HERE,
1044 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, 1044 base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback,
1045 check->timeout_factory_->GetWeakPtr(), check), 1045 check->timeout_factory_->GetWeakPtr(), check),
1046 check_timeout_); 1046 check_timeout_);
1047 } 1047 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/database_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698