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

Side by Side Diff: chrome/browser/browsing_data/mock_browsing_data_cookie_helper.cc

Issue 2230203002: chrome: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed accidental components/ change Created 4 years, 4 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 "chrome/browser/browsing_data/mock_browsing_data_cookie_helper.h" 5 #include "chrome/browser/browsing_data/mock_browsing_data_cookie_helper.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 13 matching lines...) Expand all
24 const net::CookieStore::GetCookieListCallback &callback) { 24 const net::CookieStore::GetCookieListCallback &callback) {
25 ASSERT_FALSE(callback.is_null()); 25 ASSERT_FALSE(callback.is_null());
26 ASSERT_TRUE(callback_.is_null()); 26 ASSERT_TRUE(callback_.is_null());
27 callback_ = callback; 27 callback_ = callback;
28 } 28 }
29 29
30 void MockBrowsingDataCookieHelper::DeleteCookie( 30 void MockBrowsingDataCookieHelper::DeleteCookie(
31 const net::CanonicalCookie& cookie) { 31 const net::CanonicalCookie& cookie) {
32 ASSERT_FALSE(callback_.is_null()); 32 ASSERT_FALSE(callback_.is_null());
33 std::string key = cookie.Name() + "=" + cookie.Value(); 33 std::string key = cookie.Name() + "=" + cookie.Value();
34 ASSERT_TRUE(ContainsKey(cookies_, key)); 34 ASSERT_TRUE(base::ContainsKey(cookies_, key));
35 cookies_[key] = false; 35 cookies_[key] = false;
36 } 36 }
37 37
38 void MockBrowsingDataCookieHelper::AddCookieSamples( 38 void MockBrowsingDataCookieHelper::AddCookieSamples(
39 const GURL& url, const std::string& cookie_line) { 39 const GURL& url, const std::string& cookie_line) {
40 std::unique_ptr<net::CanonicalCookie> cc(net::CanonicalCookie::Create( 40 std::unique_ptr<net::CanonicalCookie> cc(net::CanonicalCookie::Create(
41 url, cookie_line, base::Time::Now(), net::CookieOptions())); 41 url, cookie_line, base::Time::Now(), net::CookieOptions()));
42 42
43 if (cc.get()) { 43 if (cc.get()) {
44 for (const auto& cookie : cookie_list_) { 44 for (const auto& cookie : cookie_list_) {
(...skipping 17 matching lines...) Expand all
62 pair.second = true; 62 pair.second = true;
63 } 63 }
64 64
65 bool MockBrowsingDataCookieHelper::AllDeleted() { 65 bool MockBrowsingDataCookieHelper::AllDeleted() {
66 for (const auto& pair : cookies_) { 66 for (const auto& pair : cookies_) {
67 if (pair.second) 67 if (pair.second)
68 return false; 68 return false;
69 } 69 }
70 return true; 70 return true;
71 } 71 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698