| Index: content/browser/storage_partition_impl.cc
|
| diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
|
| index fbee33d70bea79670fb3dcafe08856453e5cdea8..d8f7002c21a2ec453047143cc2f397bec0d40765 100644
|
| --- a/content/browser/storage_partition_impl.cc
|
| +++ b/content/browser/storage_partition_impl.cc
|
| @@ -8,6 +8,7 @@
|
| #include "content/browser/fileapi/browser_file_system_helper.h"
|
| #include "content/public/browser/browser_context.h"
|
| #include "content/public/browser/browser_thread.h"
|
| +#include "content/public/browser/content_browser_client.h"
|
| #include "content/public/browser/dom_storage_context.h"
|
| #include "content/public/browser/indexed_db_context.h"
|
| #include "net/base/completion_callback.h"
|
| @@ -44,6 +45,20 @@ void ClearQuotaManagedOriginsOnIOThread(
|
| }
|
| }
|
|
|
| +net::CookieMonster* GetCookieMonsterForOrigin(
|
| + const GURL& storage_origin,
|
| + net::URLRequestContext* default_request_context) {
|
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| + net::CookieStore* cookie_store =
|
| + content::GetContentClient()->browser()->OverrideCookieStoreForURL(
|
| + storage_origin, NULL);
|
| + if (!cookie_store) {
|
| + cookie_store = default_request_context->cookie_store();
|
| + }
|
| +
|
| + return cookie_store->GetCookieMonster();
|
| +}
|
| +
|
| void ClearOriginOnIOThread(
|
| uint32 storage_mask,
|
| const GURL& storage_origin,
|
| @@ -54,11 +69,12 @@ void ClearOriginOnIOThread(
|
| if (storage_mask & StoragePartition::kCookies) {
|
| // Handle the cookies.
|
| net::CookieMonster* cookie_monster =
|
| - request_context->GetURLRequestContext()->cookie_store()->
|
| - GetCookieMonster();
|
| - if (cookie_monster)
|
| + GetCookieMonsterForOrigin(storage_origin,
|
| + request_context->GetURLRequestContext());
|
| + if (cookie_monster) {
|
| cookie_monster->DeleteAllForHostAsync(
|
| storage_origin, net::CookieMonster::DeleteCallback());
|
| + }
|
| }
|
|
|
| // Handle all HTML5 storage other than DOMStorageContext.
|
| @@ -84,9 +100,11 @@ void ClearAllDataOnIOThread(
|
|
|
| if (storage_mask & StoragePartition::kCookies) {
|
| // Handle the cookies.
|
| - net::CookieMonster* cookie_monster =
|
| - request_context->GetURLRequestContext()->cookie_store()->
|
| - GetCookieMonster();
|
| + net::CookieMonster* cookie_monster = NULL;
|
| + /*
|
| + GetCookieMonsterForOrigin(storage_origin,
|
| + request_context->GetURLRequestContext());
|
| + */
|
| if (cookie_monster)
|
| cookie_monster->DeleteAllAsync(net::CookieMonster::DeleteCallback());
|
| }
|
| @@ -254,17 +272,13 @@ IndexedDBContextImpl* StoragePartitionImpl::GetIndexedDBContext() {
|
|
|
| void StoragePartitionImpl::AsyncClearDataForOrigin(
|
| uint32 storage_mask,
|
| - const GURL& storage_origin,
|
| - net::URLRequestContextGetter* request_context_getter) {
|
| + const GURL& storage_origin) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| BrowserThread::PostTask(
|
| BrowserThread::IO, FROM_HERE,
|
| - base::Bind(&ClearOriginOnIOThread,
|
| - storage_mask,
|
| - storage_origin,
|
| - make_scoped_refptr(request_context_getter),
|
| - quota_manager_));
|
| + base::Bind(&ClearOriginOnIOThread, storage_mask, storage_origin,
|
| + url_request_context_, quota_manager_));
|
|
|
| if (storage_mask & kLocalDomStorage)
|
| GetDOMStorageContext()->DeleteLocalStorage(storage_origin);
|
|
|