OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |