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

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

Issue 1064523002: [sql] Clients should use sql::Connection::Delete(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Drop unnecessary change. Created 5 years, 8 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
« no previous file with comments | « components/password_manager/core/browser/login_database_unittest.cc ('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 "content/browser/net/sqlite_persistent_cookie_store.h" 5 #include "content/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 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 base::TimeTicks::Now() - start_time); 944 base::TimeTicks::Now() - start_time);
945 } 945 }
946 946
947 // Put future migration cases here. 947 // Put future migration cases here.
948 948
949 if (cur_version < kCurrentVersionNumber) { 949 if (cur_version < kCurrentVersionNumber) {
950 UMA_HISTOGRAM_COUNTS_100("Cookie.CorruptMetaTable", 1); 950 UMA_HISTOGRAM_COUNTS_100("Cookie.CorruptMetaTable", 1);
951 951
952 meta_table_.Reset(); 952 meta_table_.Reset();
953 db_.reset(new sql::Connection); 953 db_.reset(new sql::Connection);
954 if (!base::DeleteFile(path_, false) || 954 if (!sql::Connection::Delete(path_) ||
955 !db_->Open(path_) || 955 !db_->Open(path_) ||
956 !meta_table_.Init( 956 !meta_table_.Init(
957 db_.get(), kCurrentVersionNumber, kCompatibleVersionNumber)) { 957 db_.get(), kCurrentVersionNumber, kCompatibleVersionNumber)) {
958 UMA_HISTOGRAM_COUNTS_100("Cookie.CorruptMetaTableRecoveryFailed", 1); 958 UMA_HISTOGRAM_COUNTS_100("Cookie.CorruptMetaTableRecoveryFailed", 1);
959 NOTREACHED() << "Unable to reset the cookie DB."; 959 NOTREACHED() << "Unable to reset the cookie DB.";
960 meta_table_.Reset(); 960 meta_table_.Reset();
961 db_.reset(); 961 db_.reset();
962 return false; 962 return false;
963 } 963 }
964 } 964 }
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 (config.session_cookie_mode == 1386 (config.session_cookie_mode ==
1387 CookieStoreConfig::RESTORED_SESSION_COOKIES)) { 1387 CookieStoreConfig::RESTORED_SESSION_COOKIES)) {
1388 cookie_monster->SetPersistSessionCookies(true); 1388 cookie_monster->SetPersistSessionCookies(true);
1389 } 1389 }
1390 } 1390 }
1391 1391
1392 return cookie_monster; 1392 return cookie_monster;
1393 } 1393 }
1394 1394
1395 } // namespace content 1395 } // namespace content
OLDNEW
« no previous file with comments | « components/password_manager/core/browser/login_database_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698