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

Unified Diff: content/browser/browser_context.cc

Issue 9726022: Revert 127573 - DOMStorageContextImpl that's implemented in terms of the new dom_storage classes. A… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_context_impl_new.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_context.cc
===================================================================
--- content/browser/browser_context.cc (revision 127574)
+++ content/browser/browser_context.cc (working copy)
@@ -34,8 +34,6 @@
namespace content {
-namespace {
-
void CreateQuotaManagerAndClients(BrowserContext* context) {
if (context->GetUserData(kQuotaManagerKeyName)) {
DCHECK(context->GetUserData(kDatabaseTrackerKeyName));
@@ -117,7 +115,9 @@
}
void SaveSessionStateOnWebkitThread(
+ scoped_refptr<DOMStorageContextImpl> dom_storage_context,
scoped_refptr<IndexedDBContextImpl> indexed_db_context) {
+ dom_storage_context->SaveSessionState();
indexed_db_context->SaveSessionState();
}
@@ -125,13 +125,11 @@
ResourceContext::GetAppCacheService(resource_context)->PurgeMemory();
}
-DOMStorageContextImpl* GetDOMStorageContextImpl(BrowserContext* context) {
- return static_cast<DOMStorageContextImpl*>(
- BrowserContext::GetDOMStorageContext(context));
+void PurgeMemoryOnWebkitThread(
+ scoped_refptr<DOMStorageContextImpl> dom_storage_context) {
+ dom_storage_context->PurgeMemory();
}
-} // namespace
-
QuotaManager* BrowserContext::GetQuotaManager(BrowserContext* context) {
CreateQuotaManagerAndClients(context);
return UserDataAdapter<QuotaManager>::Get(context, kQuotaManagerKeyName);
@@ -190,20 +188,23 @@
browser_context->GetResourceContext()));
}
- GetDOMStorageContextImpl(browser_context)->SaveSessionState();
-
if (BrowserThread::IsMessageLoopValid(BrowserThread::WEBKIT_DEPRECATED)) {
+ DOMStorageContextImpl* dom_context = static_cast<DOMStorageContextImpl*>(
+ GetDOMStorageContext(browser_context));
IndexedDBContextImpl* indexed_db = static_cast<IndexedDBContextImpl*>(
GetIndexedDBContext(browser_context));
BrowserThread::PostTask(
BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
base::Bind(&SaveSessionStateOnWebkitThread,
+ make_scoped_refptr(dom_context),
make_scoped_refptr(indexed_db)));
}
}
void BrowserContext::ClearLocalOnDestruction(BrowserContext* browser_context) {
- GetDOMStorageContextImpl(browser_context)->SetClearLocalState(true);
+ DOMStorageContextImpl* dom_context = static_cast<DOMStorageContextImpl*>(
+ GetDOMStorageContext(browser_context));
+ dom_context->set_clear_local_state_on_exit(true);
IndexedDBContextImpl* indexed_db = static_cast<IndexedDBContextImpl*>(
GetIndexedDBContext(browser_context));
@@ -227,7 +228,14 @@
browser_context->GetResourceContext()));
}
- GetDOMStorageContextImpl(browser_context)->PurgeMemory();
+ if (BrowserThread::IsMessageLoopValid(BrowserThread::WEBKIT_DEPRECATED)) {
+ DOMStorageContextImpl* dom_context = static_cast<DOMStorageContextImpl*>(
+ GetDOMStorageContext(browser_context));
+ BrowserThread::PostTask(
+ BrowserThread::WEBKIT_DEPRECATED, FROM_HERE,
+ base::Bind(&PurgeMemoryOnWebkitThread,
+ make_scoped_refptr(dom_context)));
+ }
}
BrowserContext::~BrowserContext() {
@@ -240,10 +248,6 @@
GetDatabaseTracker(this)));
}
-#ifdef ENABLE_NEW_DOM_STORAGE_BACKEND
- if (GetUserData(kDOMStorageContextKeyName))
- GetDOMStorageContextImpl(this)->Shutdown();
-#else
if (GetUserData(kDOMStorageContextKeyName) &&
BrowserThread::IsMessageLoopValid(BrowserThread::WEBKIT_DEPRECATED)) {
DOMStorageContextImpl* dom_storage_context =
@@ -252,7 +256,6 @@
BrowserThread::ReleaseSoon(
BrowserThread::WEBKIT_DEPRECATED, FROM_HERE, dom_storage_context);
}
-#endif
}
} // namespace content
« no previous file with comments | « no previous file | content/browser/dom_storage/dom_storage_context_impl_new.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698