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

Side by Side Diff: chrome/browser/fast_shutdown_uitest.cc

Issue 8289028: Revert 105639 - The change list splits loading of cookies from DB by the domain key(eTLD+1). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/net/sqlite_persistent_cookie_store.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/test/thread_test_helper.h" 8 #include "base/test/thread_test_helper.h"
9 #include "chrome/browser/net/sqlite_persistent_cookie_store.h" 9 #include "chrome/browser/net/sqlite_persistent_cookie_store.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
(...skipping 24 matching lines...) Expand all
35 // Looks for the given |cookie| in the cookie store. If it exists, puts the 35 // Looks for the given |cookie| in the cookie store. If it exists, puts the
36 // cookie's value in |cookie_value| and sets |has_cookie| to true. Sets 36 // cookie's value in |cookie_value| and sets |has_cookie| to true. Sets
37 // |has_cookie| to false if the |cookie| wasn't found. 37 // |has_cookie| to false if the |cookie| wasn't found.
38 void GetCookie(const net::CookieMonster::CanonicalCookie& cookie, 38 void GetCookie(const net::CookieMonster::CanonicalCookie& cookie,
39 bool* has_cookie, std::string* cookie_value) { 39 bool* has_cookie, std::string* cookie_value) {
40 scoped_refptr<SQLitePersistentCookieStore> cookie_store( 40 scoped_refptr<SQLitePersistentCookieStore> cookie_store(
41 new SQLitePersistentCookieStore( 41 new SQLitePersistentCookieStore(
42 user_data_dir_.AppendASCII(chrome::kInitialProfile) 42 user_data_dir_.AppendASCII(chrome::kInitialProfile)
43 .Append(chrome::kCookieFilename))); 43 .Append(chrome::kCookieFilename)));
44 std::vector<net::CookieMonster::CanonicalCookie*> cookies; 44 std::vector<net::CookieMonster::CanonicalCookie*> cookies;
45 cookie_store->Load( 45 ASSERT_TRUE(cookie_store->Load(
46 base::Bind(&FastShutdown::LoadCookiesCallback, 46 base::Bind(&FastShutdown::LoadCookiesCallback,
47 base::Unretained(this), 47 base::Unretained(this),
48 MessageLoop::current(), 48 MessageLoop::current(),
49 base::Unretained(&cookies))); 49 base::Unretained(&cookies))));
50 // Will receive a QuitTask when LoadCookiesCallback is invoked. 50 // Will receive a QuitTask when LoadCookiesCallback is invoked.
51 MessageLoop::current()->Run(); 51 MessageLoop::current()->Run();
52 *has_cookie = false; 52 *has_cookie = false;
53 for (size_t i = 0; i < cookies.size(); ++i) { 53 for (size_t i = 0; i < cookies.size(); ++i) {
54 if (cookies[i]->IsEquivalent(cookie)) { 54 if (cookies[i]->IsEquivalent(cookie)) {
55 *has_cookie = true; 55 *has_cookie = true;
56 *cookie_value = cookies[i]->Value(); 56 *cookie_value = cookies[i]->Value();
57 } 57 }
58 } 58 }
59 cookie_store = NULL; 59 cookie_store = NULL;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // cookie that's stored to disk. 121 // cookie that's stored to disk.
122 QuitBrowser(); 122 QuitBrowser();
123 123
124 bool has_cookie = false; 124 bool has_cookie = false;
125 std::string cookie_value; 125 std::string cookie_value;
126 // Read the cookie and check that it has the expected value. 126 // Read the cookie and check that it has the expected value.
127 GetCookie(cookie, &has_cookie, &cookie_value); 127 GetCookie(cookie, &has_cookie, &cookie_value);
128 EXPECT_TRUE(has_cookie); 128 EXPECT_TRUE(has_cookie);
129 EXPECT_EQ("ohyeah", cookie_value); 129 EXPECT_EQ("ohyeah", cookie_value);
130 } 130 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/sqlite_persistent_cookie_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698