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

Side by Side Diff: chrome/browser/net/sqlite_persistent_cookie_store.cc

Issue 10255019: net: Use operator!= from scoped_ptr to check if |db_| is NULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « no previous file | 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/net/sqlite_persistent_cookie_store.h" 5 #include "chrome/browser/net/sqlite_persistent_cookie_store.h"
6 6
7 #include <list> 7 #include <list>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 455
456 loaded_callback.Run(cookies); 456 loaded_callback.Run(cookies);
457 } 457 }
458 458
459 bool SQLitePersistentCookieStore::Backend::InitializeDatabase() { 459 bool SQLitePersistentCookieStore::Backend::InitializeDatabase() {
460 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 460 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
461 461
462 if (initialized_) { 462 if (initialized_) {
463 // Return false if we were previously initialized but the DB has since been 463 // Return false if we were previously initialized but the DB has since been
464 // closed. 464 // closed.
465 return db_.get() ? true : false; 465 return db_ != NULL;
466 } 466 }
467 467
468 base::Time start = base::Time::Now(); 468 base::Time start = base::Time::Now();
469 469
470 const FilePath dir = path_.DirName(); 470 const FilePath dir = path_.DirName();
471 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) { 471 if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir)) {
472 return false; 472 return false;
473 } 473 }
474 474
475 int64 db_size = 0; 475 int64 db_size = 0;
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 } 967 }
968 968
969 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { 969 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() {
970 if (backend_.get()) { 970 if (backend_.get()) {
971 backend_->Close(); 971 backend_->Close();
972 // Release our reference, it will probably still have a reference if the 972 // Release our reference, it will probably still have a reference if the
973 // background thread has not run Close() yet. 973 // background thread has not run Close() yet.
974 backend_ = NULL; 974 backend_ = NULL;
975 } 975 }
976 } 976 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698