summaryrefslogtreecommitdiffstats
path: root/chrome/browser/mock_browsing_data_cookie_helper.cc
diff options
context:
space:
mode:
authoryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 04:18:52 +0000
committeryzshen@chromium.org <yzshen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 04:18:52 +0000
commite7ff519084d384ed51d11e66c1b029329f14eba9 (patch)
treea4492c4f277c59304aa251ab023529e4436a2812 /chrome/browser/mock_browsing_data_cookie_helper.cc
parent575a95d355333194e2f2e4981c6a18b0adc8226c (diff)
downloadchromium_src-e7ff519084d384ed51d11e66c1b029329f14eba9.zip
chromium_src-e7ff519084d384ed51d11e66c1b029329f14eba9.tar.gz
chromium_src-e7ff519084d384ed51d11e66c1b029329f14eba9.tar.bz2
Revert 95534 - Creat BrowsingDataCookieHelper and CannedBrowsingDataCookieHelper for logging cookies at UI thread.
BUG=XXX TEST=XXX Review URL: http://codereview.chromium.org/7355025 TBR=ycxiao@chromium.org Review URL: http://codereview.chromium.org/7491049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95575 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/mock_browsing_data_cookie_helper.cc')
-rw-r--r--chrome/browser/mock_browsing_data_cookie_helper.cc69
1 files changed, 0 insertions, 69 deletions
diff --git a/chrome/browser/mock_browsing_data_cookie_helper.cc b/chrome/browser/mock_browsing_data_cookie_helper.cc
deleted file mode 100644
index 2d85cab..0000000
--- a/chrome/browser/mock_browsing_data_cookie_helper.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/mock_browsing_data_cookie_helper.h"
-
-MockBrowsingDataCookieHelper::MockBrowsingDataCookieHelper(Profile* profile)
- : BrowsingDataCookieHelper(profile),
- profile_(profile) {
-}
-
-MockBrowsingDataCookieHelper::~MockBrowsingDataCookieHelper() {
-}
-
-void MockBrowsingDataCookieHelper::StartFetching(
- const net::CookieMonster::GetCookieListCallback &callback) {
- callback_ = callback;
-}
-
-void MockBrowsingDataCookieHelper::CancelNotification() {
- callback_.Reset();
-}
-
-void MockBrowsingDataCookieHelper::DeleteCookie(
- const net::CookieMonster::CanonicalCookie& cookie) {
- std::string key = cookie.Name() + "=" + cookie.Value();
- CHECK(cookies_.find(key) != cookies_.end());
- cookies_[key] = false;
-}
-
-void MockBrowsingDataCookieHelper::AddCookieSamples(
- const GURL& url, const std::string& cookie_line) {
- typedef net::CookieList::const_iterator cookie_iterator;
- net::CookieMonster::ParsedCookie pc(cookie_line);
- scoped_ptr<net::CookieMonster::CanonicalCookie> cc;
- cc.reset(new net::CookieMonster::CanonicalCookie(url, pc));
-
- if (cc.get()) {
- for (cookie_iterator cookie = cookie_list_.begin();
- cookie != cookie_list_.end(); ++cookie) {
- if (cookie->Name() == cc->Name() &&
- cookie->Domain() == cc->Domain()&&
- cookie->Path() == cc->Path()) {
- return;
- }
- }
- cookie_list_.push_back(*cc);
- cookies_[cookie_line] = true;
- }
-}
-
-void MockBrowsingDataCookieHelper::Notify() {
- if (!callback_.is_null())
- callback_.Run(cookie_list_);
-}
-
-void MockBrowsingDataCookieHelper::Reset() {
- for (std::map<const std::string, bool>::iterator i = cookies_.begin();
- i != cookies_.end(); ++i)
- i->second = true;
-}
-
-bool MockBrowsingDataCookieHelper::AllDeleted() {
- for (std::map<const std::string, bool>::const_iterator i = cookies_.begin();
- i != cookies_.end(); ++i)
- if (i->second)
- return false;
- return true;
-}