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

Side by Side Diff: net/extras/sqlite/sqlite_persistent_cookie_store.cc

Issue 2909533002: Fix loading bad cookies from disk. (Closed)
Patch Set: Use C++ loop syntax Created 3 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
« no previous file with comments | « no previous file | net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc » ('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 "net/extras/sqlite/sqlite_persistent_cookie_store.h" 5 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 Time::FromInternalValue(smt.ColumnInt64(6)), // expires_utc 825 Time::FromInternalValue(smt.ColumnInt64(6)), // expires_utc
826 Time::FromInternalValue(smt.ColumnInt64(10)), // last_access_utc 826 Time::FromInternalValue(smt.ColumnInt64(10)), // last_access_utc
827 smt.ColumnInt(7) != 0, // secure 827 smt.ColumnInt(7) != 0, // secure
828 smt.ColumnInt(8) != 0, // http_only 828 smt.ColumnInt(8) != 0, // http_only
829 DBCookieSameSiteToCookieSameSite( 829 DBCookieSameSiteToCookieSameSite(
830 static_cast<DBCookieSameSite>(smt.ColumnInt(9))), // samesite 830 static_cast<DBCookieSameSite>(smt.ColumnInt(9))), // samesite
831 DBCookiePriorityToCookiePriority( 831 DBCookiePriorityToCookiePriority(
832 static_cast<DBCookiePriority>(smt.ColumnInt(13))))); // priority 832 static_cast<DBCookiePriority>(smt.ColumnInt(13))))); // priority
833 DLOG_IF(WARNING, cc->CreationDate() > Time::Now()) 833 DLOG_IF(WARNING, cc->CreationDate() > Time::Now())
834 << L"CreationDate too recent"; 834 << L"CreationDate too recent";
835 cookies->push_back(std::move(cc)); 835 if (cc->IsCanonical())
836 cookies->push_back(std::move(cc));
836 ++num_cookies_read_; 837 ++num_cookies_read_;
837 } 838 }
838 } 839 }
839 840
840 bool SQLitePersistentCookieStore::Backend::EnsureDatabaseVersion() { 841 bool SQLitePersistentCookieStore::Backend::EnsureDatabaseVersion() {
841 // Version check. 842 // Version check.
842 if (!meta_table_.Init(db_.get(), kCurrentVersionNumber, 843 if (!meta_table_.Init(db_.get(), kCurrentVersionNumber,
843 kCompatibleVersionNumber)) { 844 kCompatibleVersionNumber)) {
844 return false; 845 return false;
845 } 846 }
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) { 1436 void SQLitePersistentCookieStore::Flush(const base::Closure& callback) {
1436 if (backend_) 1437 if (backend_)
1437 backend_->Flush(callback); 1438 backend_->Flush(callback);
1438 } 1439 }
1439 1440
1440 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() { 1441 SQLitePersistentCookieStore::~SQLitePersistentCookieStore() {
1441 Close(base::Closure()); 1442 Close(base::Closure());
1442 } 1443 }
1443 1444
1444 } // namespace net 1445 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698