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

Unified Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 20015002: Make Platform::queryStorageUsageAndQuota work from worker threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use map Created 7 years, 5 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
Index: content/renderer/renderer_webkitplatformsupport_impl.cc
diff --git a/content/renderer/renderer_webkitplatformsupport_impl.cc b/content/renderer/renderer_webkitplatformsupport_impl.cc
index 211c567114cbfd638a28ed9185a84cba2ffdb8f2..e94c29a38823759d992998749488e2d7e98ab597 100644
--- a/content/renderer/renderer_webkitplatformsupport_impl.cc
+++ b/content/renderer/renderer_webkitplatformsupport_impl.cc
@@ -19,6 +19,7 @@
#include "content/child/indexed_db/proxy_webidbfactory_impl.h"
#include "content/child/npapi/npobject_util.h"
#include "content/child/quota_dispatcher.h"
+#include "content/child/quota_message_filter.h"
#include "content/child/thread_safe_sender.h"
#include "content/child/webblobregistry_impl.h"
#include "content/child/webmessageportchannel_impl.h"
@@ -248,6 +249,7 @@ RendererWebKitPlatformSupportImpl::RendererWebKitPlatformSupportImpl()
if (ChildThread::current()) {
sync_message_filter_ = ChildThread::current()->sync_message_filter();
thread_safe_sender_ = ChildThread::current()->thread_safe_sender();
+ quota_message_filter_ = ChildThread::current()->quota_message_filter();
}
}
@@ -1162,10 +1164,14 @@ void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
const WebKit::WebURL& storage_partition,
WebKit::WebStorageQuotaType type,
WebKit::WebStorageQuotaCallbacks* callbacks) {
- ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota(
- storage_partition,
- static_cast<quota::StorageType>(type),
- QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
+ if (!thread_safe_sender_.get() || !quota_message_filter_.get())
+ return;
+ QuotaDispatcher::ThreadSpecificInstance(
+ thread_safe_sender_.get(),
+ quota_message_filter_.get())->QueryStorageUsageAndQuota(
+ storage_partition,
+ static_cast<quota::StorageType>(type),
+ QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698