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

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

Issue 2030663002: Migrate WaitableEvent to enum-based constructor in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: Created 4 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
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 16 matching lines...) Expand all
27 namespace { 27 namespace {
28 28
29 const base::FilePath::CharType cookie_filename[] = FILE_PATH_LITERAL("Cookies"); 29 const base::FilePath::CharType cookie_filename[] = FILE_PATH_LITERAL("Cookies");
30 30
31 } // namespace 31 } // namespace
32 32
33 class SQLitePersistentCookieStorePerfTest : public testing::Test { 33 class SQLitePersistentCookieStorePerfTest : public testing::Test {
34 public: 34 public:
35 SQLitePersistentCookieStorePerfTest() 35 SQLitePersistentCookieStorePerfTest()
36 : pool_owner_(new base::SequencedWorkerPoolOwner(1, "Background Pool")), 36 : pool_owner_(new base::SequencedWorkerPoolOwner(1, "Background Pool")),
37 loaded_event_(false, false), 37 loaded_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
38 key_loaded_event_(false, false) {} 38 base::WaitableEvent::InitialState::NOT_SIGNALED),
39 key_loaded_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
40 base::WaitableEvent::InitialState::NOT_SIGNALED) {}
39 41
40 void OnLoaded(const std::vector<CanonicalCookie*>& cookies) { 42 void OnLoaded(const std::vector<CanonicalCookie*>& cookies) {
41 cookies_ = cookies; 43 cookies_ = cookies;
42 loaded_event_.Signal(); 44 loaded_event_.Signal();
43 } 45 }
44 46
45 void OnKeyLoaded(const std::vector<CanonicalCookie*>& cookies) { 47 void OnKeyLoaded(const std::vector<CanonicalCookie*>& cookies) {
46 cookies_ = cookies; 48 cookies_ = cookies;
47 key_loaded_event_.Signal(); 49 key_loaded_event_.Signal();
48 } 50 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 // Test the performance of load 134 // Test the performance of load
133 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) { 135 TEST_F(SQLitePersistentCookieStorePerfTest, TestLoadPerformance) {
134 base::PerfTimeLogger timer("Load all cookies"); 136 base::PerfTimeLogger timer("Load all cookies");
135 Load(); 137 Load();
136 timer.Done(); 138 timer.Done();
137 139
138 ASSERT_EQ(15000U, cookies_.size()); 140 ASSERT_EQ(15000U, cookies_.size());
139 } 141 }
140 142
141 } // namespace net 143 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/serial_worker_unittest.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