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

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

Issue 16703018: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
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/safe_browsing_database.h" 5 #include "chrome/browser/safe_browsing/safe_browsing_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 433
434 // static 434 // static
435 void SafeBrowsingDatabase::RecordFailure(FailureType failure_type) { 435 void SafeBrowsingDatabase::RecordFailure(FailureType failure_type) {
436 UMA_HISTOGRAM_ENUMERATION("SB2.DatabaseFailure", failure_type, 436 UMA_HISTOGRAM_ENUMERATION("SB2.DatabaseFailure", failure_type,
437 FAILURE_DATABASE_MAX); 437 FAILURE_DATABASE_MAX);
438 } 438 }
439 439
440 SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew() 440 SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew()
441 : creation_loop_(base::MessageLoop::current()), 441 : creation_loop_(base::MessageLoop::current()),
442 browse_store_(new SafeBrowsingStoreFile), 442 browse_store_(new SafeBrowsingStoreFile),
443 download_store_(NULL),
444 csd_whitelist_store_(NULL),
445 download_whitelist_store_(NULL),
446 reset_factory_(this), 443 reset_factory_(this),
447 corruption_detected_(false), 444 corruption_detected_(false),
448 change_detected_(false) { 445 change_detected_(false) {
449 DCHECK(browse_store_.get()); 446 DCHECK(browse_store_.get());
450 DCHECK(!download_store_.get()); 447 DCHECK(!download_store_.get());
451 DCHECK(!csd_whitelist_store_.get()); 448 DCHECK(!csd_whitelist_store_.get());
452 DCHECK(!download_whitelist_store_.get()); 449 DCHECK(!download_whitelist_store_.get());
453 DCHECK(!extension_blacklist_store_.get()); 450 DCHECK(!extension_blacklist_store_.get());
454 DCHECK(!side_effect_free_whitelist_store_.get()); 451 DCHECK(!side_effect_free_whitelist_store_.get());
455 } 452 }
(...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1601 if (std::binary_search(new_whitelist.begin(), new_whitelist.end(), 1598 if (std::binary_search(new_whitelist.begin(), new_whitelist.end(),
1602 kill_switch)) { 1599 kill_switch)) {
1603 // The kill switch is whitelisted hence we whitelist all URLs. 1600 // The kill switch is whitelisted hence we whitelist all URLs.
1604 WhitelistEverything(whitelist); 1601 WhitelistEverything(whitelist);
1605 } else { 1602 } else {
1606 base::AutoLock locked(lookup_lock_); 1603 base::AutoLock locked(lookup_lock_);
1607 whitelist->second = false; 1604 whitelist->second = false;
1608 whitelist->first.swap(new_whitelist); 1605 whitelist->first.swap(new_whitelist);
1609 } 1606 }
1610 } 1607 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698