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

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

Issue 12096073: Implement sql::Connection::RazeAndClose(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DEATH test on android and ios. Created 7 years, 10 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/history/thumbnail_database.cc ('k') | sql/connection.h » ('j') | 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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 MessageLoop::current()->PostTask( 1037 MessageLoop::current()->PostTask(
1038 FROM_HERE, base::Bind(&Backend::KillDatabase, this)); 1038 FROM_HERE, base::Bind(&Backend::KillDatabase, this));
1039 } 1039 }
1040 1040
1041 void SQLitePersistentCookieStore::Backend::KillDatabase() { 1041 void SQLitePersistentCookieStore::Backend::KillDatabase() {
1042 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); 1042 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB));
1043 1043
1044 if (db_.get()) { 1044 if (db_.get()) {
1045 // This Backend will now be in-memory only. In a future run we will recreate 1045 // This Backend will now be in-memory only. In a future run we will recreate
1046 // the database. Hopefully things go better then! 1046 // the database. Hopefully things go better then!
1047 bool success = db_->Raze(); 1047 bool success = db_->RazeAndClose();
1048 UMA_HISTOGRAM_BOOLEAN("Cookie.KillDatabaseResult", success); 1048 UMA_HISTOGRAM_BOOLEAN("Cookie.KillDatabaseResult", success);
1049 db_->Close();
1050 meta_table_.Reset(); 1049 meta_table_.Reset();
1051 db_.reset(); 1050 db_.reset();
1052 } 1051 }
1053 } 1052 }
1054 1053
1055 void SQLitePersistentCookieStore::Backend::SetForceKeepSessionState() { 1054 void SQLitePersistentCookieStore::Backend::SetForceKeepSessionState() {
1056 base::AutoLock locked(lock_); 1055 base::AutoLock locked(lock_);
1057 force_keep_session_state_ = true; 1056 force_keep_session_state_ = true;
1058 } 1057 }
1059 1058
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 1099
1101 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) { 1100 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) {
1102 backend_->Flush(callback); 1101 backend_->Flush(callback);
1103 } 1102 }
1104 1103
1105 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { 1104 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() {
1106 backend_->Close(); 1105 backend_->Close();
1107 // We release our reference to the Backend, though it will probably still have 1106 // We release our reference to the Backend, though it will probably still have
1108 // a reference if the background thread has not run Close() yet. 1107 // a reference if the background thread has not run Close() yet.
1109 } 1108 }
OLDNEW
« no previous file with comments | « chrome/browser/history/thumbnail_database.cc ('k') | sql/connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698