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

Unified Diff: chrome/browser/in_process_webkit/webkit_context.cc

Issue 545054: Introduce all the plumbing for Session Storage. This mostly consists of crea... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 | « chrome/browser/in_process_webkit/webkit_context.h ('k') | chrome/browser/renderer_host/render_view_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/in_process_webkit/webkit_context.cc
===================================================================
--- chrome/browser/in_process_webkit/webkit_context.cc (revision 36257)
+++ chrome/browser/in_process_webkit/webkit_context.cc (working copy)
@@ -14,45 +14,43 @@
}
WebKitContext::~WebKitContext() {
- // If the WebKit thread was ever spun up, delete the object there. The task
- // will just get deleted if the WebKit thread isn't created.
- DOMStorageContext* dom_storage_context = dom_storage_context_.release();
- if (!ChromeThread::DeleteSoon(
- ChromeThread::WEBKIT, FROM_HERE, dom_storage_context)) {
- // The WebKit thread wasn't created, and the task got deleted without
- // freeing the DOMStorageContext, so delete it manually.
- delete dom_storage_context;
- }
+ ChromeThread::DeleteSoon(ChromeThread::WEBKIT, FROM_HERE,
+ dom_storage_context_.release());
}
void WebKitContext::PurgeMemory() {
- // DOMStorageContext::PurgeMemory() should only be called on the WebKit
- // thread.
- //
- // Note that if there is no WebKit thread, then there's nothing in
- // LocalStorage and it's OK to no-op here.
- if (ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)) {
- dom_storage_context_->PurgeMemory();
- } else {
- // Since we're not on the WebKit thread, proxy the call over to it. We
- // can't post a task to call DOMStorageContext::PurgeMemory() directly
- // because that class is not refcounted.
+ if (!ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)) {
ChromeThread::PostTask(
ChromeThread::WEBKIT, FROM_HERE,
NewRunnableMethod(this, &WebKitContext::PurgeMemory));
+ return;
}
+
+ dom_storage_context_->PurgeMemory();
}
void WebKitContext::DeleteDataModifiedSince(const base::Time& cutoff) {
- // DOMStorageContext::DeleteDataModifiedSince() should only be called on the
- // WebKit thread.
- if (ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)) {
- dom_storage_context_->DeleteDataModifiedSince(cutoff);
- } else {
- bool result = ChromeThread::PostTask(
+ if (!ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)) {
+ ChromeThread::PostTask(
ChromeThread::WEBKIT, FROM_HERE,
NewRunnableMethod(this, &WebKitContext::DeleteDataModifiedSince,
cutoff));
- DCHECK(result);
+ return;
}
+
+ dom_storage_context_->DeleteDataModifiedSince(cutoff);
}
+
+void WebKitContext::DeleteSessionStorageNamespace(
+ int64 session_storage_namespace_id) {
+ if (!ChromeThread::CurrentlyOn(ChromeThread::WEBKIT)) {
+ ChromeThread::PostTask(
+ ChromeThread::WEBKIT, FROM_HERE,
+ NewRunnableMethod(this, &WebKitContext::DeleteSessionStorageNamespace,
+ session_storage_namespace_id));
+ return;
+ }
+
+ dom_storage_context_->DeleteSessionStorageNamespace(
+ session_storage_namespace_id);
+}
« no previous file with comments | « chrome/browser/in_process_webkit/webkit_context.h ('k') | chrome/browser/renderer_host/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698