summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/net/chrome_cookie_notification_details.h22
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc101
-rw-r--r--chrome/browser/net/chrome_url_request_context.h2
-rw-r--r--chrome/browser/sync/glue/http_bridge.cc2
4 files changed, 5 insertions, 122 deletions
diff --git a/chrome/browser/net/chrome_cookie_notification_details.h b/chrome/browser/net/chrome_cookie_notification_details.h
deleted file mode 100644
index a4ee4a0..0000000
--- a/chrome/browser/net/chrome_cookie_notification_details.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2010 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.
-
-#ifndef CHROME_BROWSER_NET_CHROME_COOKIE_NOTIFICATION_DETAILS_H_
-#define CHROME_BROWSER_NET_CHROME_COOKIE_NOTIFICATION_DETAILS_H_
-
-#include "net/base/cookie_monster.h"
-
-struct ChromeCookieDetails {
- public:
- ChromeCookieDetails(net::CookieMonster::CookieListPair* cookie_pair_copy,
- bool is_removed)
- : cookie_pair(cookie_pair_copy),
- removed(is_removed) {
- }
-
- net::CookieMonster::CookieListPair* cookie_pair;
- bool removed;
-};
-
-#endif // CHROME_BROWSER_NET_CHROME_COOKIE_NOTIFICATION_DETAILS_H_
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index be1e63b..f19bd08 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -11,7 +11,6 @@
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/extensions/user_script_master.h"
#include "chrome/browser/io_thread.h"
-#include "chrome/browser/net/chrome_cookie_notification_details.h"
#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/net/sqlite_persistent_cookie_store.h"
#include "chrome/browser/net/dns_global.h"
@@ -108,92 +107,6 @@ net::ProxyService* CreateProxyService(
}
// ----------------------------------------------------------------------------
-// CookieMonster::Delegate implementation
-// ----------------------------------------------------------------------------
-class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate {
- public:
- explicit ChromeCookieMonsterDelegate(Profile* profile) {
- CheckCurrentlyOnMainThread();
- profile_getter_ = new ProfileGetter(profile);
- }
-
- // net::CookieMonster::Delegate implementation.
- virtual void OnCookieChanged(
- const std::string& domain_key,
- const net::CookieMonster::CanonicalCookie& cookie,
- bool removed) {
- ChromeThread::PostTask(
- ChromeThread::UI, FROM_HERE,
- NewRunnableMethod(this,
- &ChromeCookieMonsterDelegate::OnCookieChangedAsyncHelper,
- net::CookieMonster::CookieListPair(domain_key, cookie),
- removed));
- }
-
- private:
- // This class allows us to safely access the Profile pointer. The Delegate
- // itself cannot observe the PROFILE_DESTROYED notification, since it cannot
- // guarantee to be deleted on the UI thread and therefore unregister from
- // the notifications. All methods of ProfileGetter must be invoked on the UI
- // thread.
- class ProfileGetter
- : public base::RefCountedThreadSafe<ProfileGetter,
- ChromeThread::DeleteOnUIThread>,
- public NotificationObserver {
- public:
- explicit ProfileGetter(Profile* profile) : profile_(profile) {
- CheckCurrentlyOnMainThread();
- registrar_.Add(this,
- NotificationType::PROFILE_DESTROYED,
- Source<Profile>(profile_));
- }
-
- // NotificationObserver implementation.
- void Observe(NotificationType type,
- const NotificationSource& source,
- const NotificationDetails& details) {
- CheckCurrentlyOnMainThread();
- if (NotificationType::PROFILE_DESTROYED == type) {
- Profile* profile = Source<Profile>(source).ptr();
- if (profile_ == profile)
- profile_ = NULL;
- }
- }
-
- Profile* get() {
- CheckCurrentlyOnMainThread();
- return profile_;
- }
-
- private:
- friend class ::ChromeThread;
- friend class DeleteTask<ProfileGetter>;
-
- virtual ~ProfileGetter() {}
-
- NotificationRegistrar registrar_;
-
- Profile* profile_;
- };
-
- virtual ~ChromeCookieMonsterDelegate() {}
-
- void OnCookieChangedAsyncHelper(
- net::CookieMonster::CookieListPair cookie_pair,
- bool removed) {
- if (profile_getter_->get()) {
- ChromeCookieDetails cookie_details(&cookie_pair, removed);
- NotificationService::current()->Notify(
- NotificationType::COOKIE_CHANGED,
- Source<Profile>(profile_getter_->get()),
- Details<ChromeCookieDetails>(&cookie_details));
- }
- }
-
- scoped_refptr<ProfileGetter> profile_getter_;
-};
-
-// ----------------------------------------------------------------------------
// Helper factories
// ----------------------------------------------------------------------------
@@ -262,8 +175,7 @@ ChromeURLRequestContext* FactoryForOriginal::Create() {
if (record_mode || playback_mode) {
// Don't use existing cookies and use an in-memory store.
- context->set_cookie_store(new net::CookieMonster(NULL,
- cookie_monster_delegate_));
+ context->set_cookie_store(new net::CookieMonster(NULL));
cache->set_mode(
record_mode ? net::HttpCache::RECORD : net::HttpCache::PLAYBACK);
}
@@ -278,8 +190,7 @@ ChromeURLRequestContext* FactoryForOriginal::Create() {
scoped_refptr<SQLitePersistentCookieStore> cookie_db =
new SQLitePersistentCookieStore(cookie_store_path_);
- context->set_cookie_store(new net::CookieMonster(cookie_db.get(),
- cookie_monster_delegate_));
+ context->set_cookie_store(new net::CookieMonster(cookie_db.get()));
}
context->set_cookie_policy(
@@ -321,8 +232,7 @@ ChromeURLRequestContext* FactoryForExtensions::Create() {
scoped_refptr<SQLitePersistentCookieStore> cookie_db =
new SQLitePersistentCookieStore(cookie_store_path_);
- net::CookieMonster* cookie_monster =
- new net::CookieMonster(cookie_db.get(), NULL);
+ net::CookieMonster* cookie_monster = new net::CookieMonster(cookie_db.get());
// Enable cookies for extension URLs only.
const char* schemes[] = {chrome::kExtensionScheme};
@@ -372,8 +282,7 @@ ChromeURLRequestContext* FactoryForOffTheRecord::Create() {
context->ssl_config_service(),
context->http_auth_handler_factory(),
0);
- context->set_cookie_store(new net::CookieMonster(NULL,
- cookie_monster_delegate_));
+ context->set_cookie_store(new net::CookieMonster(NULL));
context->set_cookie_policy(
new ChromeCookiePolicy(host_content_settings_map_));
context->set_http_transaction_factory(cache);
@@ -956,8 +865,6 @@ ChromeURLRequestContextFactory::ChromeURLRequestContextFactory(Profile* profile)
ssl_config_service_ = profile->GetSSLConfigService();
profile_dir_path_ = profile->GetPath();
-
- cookie_monster_delegate_ = new ChromeCookieMonsterDelegate(profile);
}
ChromeURLRequestContextFactory::~ChromeURLRequestContextFactory() {
diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h
index d483600..7e44d04 100644
--- a/chrome/browser/net/chrome_url_request_context.h
+++ b/chrome/browser/net/chrome_url_request_context.h
@@ -7,7 +7,6 @@
#include "base/file_path.h"
#include "base/linked_ptr.h"
-#include "net/base/cookie_monster.h"
#include "net/base/cookie_policy.h"
#include "chrome/browser/appcache/chrome_appcache_service.h"
#include "chrome/browser/host_content_settings_map.h"
@@ -385,7 +384,6 @@ class ChromeURLRequestContextFactory {
scoped_refptr<Blacklist> privacy_blacklist_;
scoped_refptr<net::TransportSecurityState> transport_security_state_;
scoped_refptr<net::SSLConfigService> ssl_config_service_;
- scoped_refptr<net::CookieMonster::Delegate> cookie_monster_delegate_;
FilePath profile_dir_path_;
diff --git a/chrome/browser/sync/glue/http_bridge.cc b/chrome/browser/sync/glue/http_bridge.cc
index d22e780..37ae729 100644
--- a/chrome/browser/sync/glue/http_bridge.cc
+++ b/chrome/browser/sync/glue/http_bridge.cc
@@ -66,7 +66,7 @@ HttpBridge::RequestContext::RequestContext(URLRequestContext* baseline_context)
: baseline_context_(baseline_context) {
// Create empty, in-memory cookie store.
- cookie_store_ = new net::CookieMonster(NULL, NULL);
+ cookie_store_ = new net::CookieMonster(NULL);
// We don't use a cache for bridged loads, but we do want to share proxy info.
host_resolver_ = baseline_context->host_resolver();