Index: chrome/browser/profiles/profile_io_data.cc |
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc |
index 8c96daed749f4ab88f78f397537d61f98e6b2b04..6e00398f8c9c295b45af38a05a01f6373cf3cc84 100644 |
--- a/chrome/browser/profiles/profile_io_data.cc |
+++ b/chrome/browser/profiles/profile_io_data.cc |
@@ -36,12 +36,11 @@ |
#include "chrome/browser/io_thread.h" |
#include "chrome/browser/media/media_device_id_salt.h" |
#include "chrome/browser/net/about_protocol_handler.h" |
-#include "chrome/browser/net/chrome_cookie_notification_details.h" |
#include "chrome/browser/net/chrome_fraudulent_certificate_reporter.h" |
#include "chrome/browser/net/chrome_http_user_agent_settings.h" |
#include "chrome/browser/net/chrome_net_log.h" |
#include "chrome/browser/net/chrome_network_delegate.h" |
-#include "chrome/browser/net/evicted_domain_cookie_counter.h" |
+#include "chrome/browser/net/cookie_store_util.h" |
#include "chrome/browser/net/proxy_service_factory.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_manager.h" |
@@ -60,7 +59,6 @@ |
#include "extensions/common/constants.h" |
#include "net/base/keygen_handler.h" |
#include "net/cookies/canonical_cookie.h" |
-#include "net/cookies/cookie_monster.h" |
#include "net/http/http_transaction_factory.h" |
#include "net/http/http_util.h" |
#include "net/http/transport_security_persister.h" |
@@ -127,56 +125,6 @@ using content::ResourceContext; |
namespace { |
-// ---------------------------------------------------------------------------- |
-// CookieMonster::Delegate implementation |
-// ---------------------------------------------------------------------------- |
-class ChromeCookieMonsterDelegate : public net::CookieMonster::Delegate { |
- public: |
- explicit ChromeCookieMonsterDelegate( |
- const base::Callback<Profile*(void)>& profile_getter) |
- : profile_getter_(profile_getter) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- } |
- |
- // net::CookieMonster::Delegate implementation. |
- virtual void OnCookieChanged( |
- const net::CanonicalCookie& cookie, |
- bool removed, |
- net::CookieMonster::Delegate::ChangeCause cause) OVERRIDE { |
- BrowserThread::PostTask( |
- BrowserThread::UI, FROM_HERE, |
- base::Bind(&ChromeCookieMonsterDelegate::OnCookieChangedAsyncHelper, |
- this, cookie, removed, cause)); |
- } |
- |
- private: |
- virtual ~ChromeCookieMonsterDelegate() {} |
- |
- void OnCookieChangedAsyncHelper( |
- const net::CanonicalCookie& cookie, |
- bool removed, |
- net::CookieMonster::Delegate::ChangeCause cause) { |
- Profile* profile = profile_getter_.Run(); |
- if (profile) { |
- ChromeCookieDetails cookie_details(&cookie, removed, cause); |
- content::NotificationService::current()->Notify( |
- chrome::NOTIFICATION_COOKIE_CHANGED, |
- content::Source<Profile>(profile), |
- content::Details<ChromeCookieDetails>(&cookie_details)); |
- } |
- } |
- |
- const base::Callback<Profile*(void)> profile_getter_; |
-}; |
- |
-Profile* GetProfileOnUI(ProfileManager* profile_manager, Profile* profile) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- DCHECK(profile); |
- if (profile_manager->IsValidProfile(profile)) |
- return profile; |
- return NULL; |
-} |
- |
#if defined(DEBUG_DEVTOOLS) |
bool IsSupportedDevToolsURL(const GURL& url, base::FilePath* path) { |
std::string bundled_path_prefix(chrome::kChromeUIDevToolsBundledPath); |
@@ -370,12 +318,8 @@ void ProfileIOData::InitializeOnUIThread(Profile* profile) { |
params->cookie_settings = CookieSettings::Factory::GetForProfile(profile); |
params->host_content_settings_map = profile->GetHostContentSettingsMap(); |
params->ssl_config_service = profile->GetSSLConfigService(); |
- base::Callback<Profile*(void)> profile_getter = |
- base::Bind(&GetProfileOnUI, g_browser_process->profile_manager(), |
- profile); |
params->cookie_monster_delegate = |
- new chrome_browser_net::EvictedDomainCookieCounter( |
- new ChromeCookieMonsterDelegate(profile_getter)); |
+ chrome_browser_net::CreateCookieDelegate(profile); |
params->extension_info_map = |
extensions::ExtensionSystem::Get(profile)->info_map(); |