summaryrefslogtreecommitdiffstats
path: root/content/worker/shared_worker_permission_client_proxy.h
diff options
context:
space:
mode:
authorkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 05:38:17 +0000
committerkinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-01 05:38:17 +0000
commit44fb3fe66e0bad06ed5da0e930bba8e0d34d1667 (patch)
tree569300704710f79d961ebaaca1ae20c0a48f11ac /content/worker/shared_worker_permission_client_proxy.h
parent4814ed220f72cdf35d40e22b0afa66d8cf1ee044 (diff)
downloadchromium_src-44fb3fe66e0bad06ed5da0e930bba8e0d34d1667.zip
chromium_src-44fb3fe66e0bad06ed5da0e930bba8e0d34d1667.tar.gz
chromium_src-44fb3fe66e0bad06ed5da0e930bba8e0d34d1667.tar.bz2
Send Allow{Database,FileSystem,IndexedDB} sync IPCs directly from worker thread
- To deprecate the notorious WorkerAllowMainThreadBridge & runInMode code in Blink - To simplify the worker class inheritance chain Blink-side change: https://codereview.chromium.org/50773002/ BUG=none Review URL: https://codereview.chromium.org/46583005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@232302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/worker/shared_worker_permission_client_proxy.h')
-rw-r--r--content/worker/shared_worker_permission_client_proxy.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/content/worker/shared_worker_permission_client_proxy.h b/content/worker/shared_worker_permission_client_proxy.h
new file mode 100644
index 0000000..0a4fdc8
--- /dev/null
+++ b/content/worker/shared_worker_permission_client_proxy.h
@@ -0,0 +1,45 @@
+// 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.
+
+#ifndef CONTENT_WORKER_SHARED_WORKER_PERMISSION_CLIENT_PROXY_H_
+#define CONTENT_WORKER_SHARED_WORKER_PERMISSION_CLIENT_PROXY_H_
+
+#include "base/basictypes.h"
+#include "base/memory/ref_counted.h"
+#include "third_party/WebKit/public/web/WebWorkerPermissionClientProxy.h"
+#include "url/gurl.h"
+
+namespace content {
+
+class ThreadSafeSender;
+
+// This proxy is created on the main renderer thread then passed onto
+// the blink's worker thread.
+class SharedWorkerPermissionClientProxy
+ : public WebKit::WebWorkerPermissionClientProxy {
+ public:
+ SharedWorkerPermissionClientProxy(
+ const GURL& origin_url,
+ int routing_id,
+ ThreadSafeSender* thread_safe_sender);
+ virtual ~SharedWorkerPermissionClientProxy();
+
+ // WebWorkerPermissionClientProxy overrides.
+ virtual bool allowDatabase(const WebKit::WebString& name,
+ const WebKit::WebString& display_name,
+ unsigned long estimated_size);
+ virtual bool allowFileSystem();
+ virtual bool allowIndexedDB(const WebKit::WebString& name);
+
+ private:
+ const GURL origin_url_;
+ const int routing_id_;
+ scoped_refptr<ThreadSafeSender> thread_safe_sender_;
+
+ DISALLOW_COPY_AND_ASSIGN(SharedWorkerPermissionClientProxy);
+};
+
+} // namespace content
+
+#endif // CONTENT_WORKER_SHARED_WORKER_PERMISSION_CLIENT_PROXY_H_