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

Unified Diff: content/worker/shared_worker_permission_client_proxy.cc

Issue 46583005: Send Allow{Database,FileSystem,IndexedDB} sync IPCs directly from worker thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 7 years, 2 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/worker/shared_worker_permission_client_proxy.cc
diff --git a/content/worker/shared_worker_permission_client_proxy.cc b/content/worker/shared_worker_permission_client_proxy.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dae30ffdab64b556ce62853f53455534550c6fe5
--- /dev/null
+++ b/content/worker/shared_worker_permission_client_proxy.cc
@@ -0,0 +1,52 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/worker/shared_worker_permission_client_proxy.h"
+
+#include "content/child/thread_safe_sender.h"
+#include "content/common/worker_messages.h"
+#include "third_party/WebKit/public/platform/WebString.h"
+#include "url/gurl.h"
+
+namespace content {
+
+SharedWorkerPermissionClientProxy::SharedWorkerPermissionClientProxy(
+ const GURL& origin_url,
+ int routing_id,
+ ThreadSafeSender* thread_safe_sender)
+ : origin_url_(origin_url),
+ routing_id_(routing_id),
+ thread_safe_sender_(thread_safe_sender) {
+}
+
+SharedWorkerPermissionClientProxy::~SharedWorkerPermissionClientProxy() {
+}
+
+bool SharedWorkerPermissionClientProxy::allowDatabase(
+ const WebKit::WebString& name,
+ const WebKit::WebString& display_name,
+ unsigned long estimated_size) {
+ bool result = false;
+ thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowDatabase(
+ routing_id_, origin_url_, name, display_name,
+ estimated_size, &result));
+ return result;
+}
+
+bool SharedWorkerPermissionClientProxy::allowFileSystem() {
+ bool result = false;
+ thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowFileSystem(
+ routing_id_, origin_url_, &result));
+ return result;
+}
+
+bool SharedWorkerPermissionClientProxy::allowIndexedDB(
+ const WebKit::WebString& name) {
+ bool result = false;
+ thread_safe_sender_->Send(new WorkerProcessHostMsg_AllowIndexedDB(
+ routing_id_, origin_url_, name, &result));
+ return result;
+}
+
+} // namespace content
« no previous file with comments | « content/worker/shared_worker_permission_client_proxy.h ('k') | content/worker/websharedworkerclient_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698