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

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

Issue 1773133002: SameSite: Implement 'Strict'/'Lax' attribute parsing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mmenke@ Created 4 years, 9 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
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 <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 ASSERT_EQ(0u, cookies_.size()); 73 ASSERT_EQ(0u, cookies_.size());
74 // Creates 15000 cookies from 300 eTLD+1s. 74 // Creates 15000 cookies from 300 eTLD+1s.
75 base::Time t = base::Time::Now(); 75 base::Time t = base::Time::Now();
76 for (int domain_num = 0; domain_num < 300; domain_num++) { 76 for (int domain_num = 0; domain_num < 300; domain_num++) {
77 std::string domain_name(base::StringPrintf(".domain_%d.com", domain_num)); 77 std::string domain_name(base::StringPrintf(".domain_%d.com", domain_num));
78 GURL gurl("www" + domain_name); 78 GURL gurl("www" + domain_name);
79 for (int cookie_num = 0; cookie_num < 50; ++cookie_num) { 79 for (int cookie_num = 0; cookie_num < 50; ++cookie_num) {
80 t += base::TimeDelta::FromInternalValue(10); 80 t += base::TimeDelta::FromInternalValue(10);
81 store_->AddCookie(CanonicalCookie( 81 store_->AddCookie(CanonicalCookie(
82 gurl, base::StringPrintf("Cookie_%d", cookie_num), "1", domain_name, 82 gurl, base::StringPrintf("Cookie_%d", cookie_num), "1", domain_name,
83 "/", t, t, t, false, false, false, COOKIE_PRIORITY_DEFAULT)); 83 "/", t, t, t, false, false, CookieSameSite::DEFAULT_MODE,
84 COOKIE_PRIORITY_DEFAULT));
84 } 85 }
85 } 86 }
86 // Replace the store effectively destroying the current one and forcing it 87 // Replace the store effectively destroying the current one and forcing it
87 // to write its data to disk. 88 // to write its data to disk.
88 store_ = NULL; 89 store_ = NULL;
89 90
90 // Shut down the pool, causing deferred (no-op) commits to be discarded. 91 // Shut down the pool, causing deferred (no-op) commits to be discarded.
91 pool_owner_->pool()->Shutdown(); 92 pool_owner_->pool()->Shutdown();
92 // ~SequencedWorkerPoolOwner blocks on pool shutdown. 93 // ~SequencedWorkerPoolOwner blocks on pool shutdown.
93 pool_owner_.reset(new base::SequencedWorkerPoolOwner(1, "pool")); 94 pool_owner_.reset(new base::SequencedWorkerPoolOwner(1, "pool"));
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 // Test the performance of load 132 // Test the performance of load
132 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) { 133 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) {
133 base::PerfTimeLogger timer("Load all cookies"); 134 base::PerfTimeLogger timer("Load all cookies");
134 Load(); 135 Load();
135 timer.Done(); 136 timer.Done();
136 137
137 ASSERT_EQ(15000U, cookies_.size()); 138 ASSERT_EQ(15000U, cookies_.size());
138 } 139 }
139 140
140 } // namespace net 141 } // namespace net
OLDNEW
« no previous file with comments | « net/extras/sqlite/sqlite_persistent_cookie_store.cc ('k') | net/extras/sqlite/sqlite_persistent_cookie_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698