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

Unified Diff: public/web/WebWorkerPermissionClientProxy.h

Issue 50773002: Introduce WebWorkerPermissionClientProxy to deprecate WorkerAllowMainThreadBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: updated comments, minor code fix 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
« no previous file with comments | « public/web/WebSharedWorkerClient.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/web/WebWorkerPermissionClientProxy.h
diff --git a/public/web/WebScriptBindings.h b/public/web/WebWorkerPermissionClientProxy.h
similarity index 67%
copy from public/web/WebScriptBindings.h
copy to public/web/WebWorkerPermissionClientProxy.h
index 12b9d43003da2406336fe284ccc181d7847605fd..c68cd362b5e93ea994c10ff768feeaa812e9257a 100644
--- a/public/web/WebScriptBindings.h
+++ b/public/web/WebWorkerPermissionClientProxy.h
@@ -28,32 +28,37 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef WebScriptBindings_h
-#define WebScriptBindings_h
-
-#include "../platform/WebCommon.h"
-
-namespace v8 {
-class Isolate;
-class String;
-template <class T> class Handle;
-template <class T> class Local;
-}
+#ifndef WebWorkerPermissionClientProxy_h
+#define WebWorkerPermissionClientProxy_h
namespace WebKit {
class WebString;
-class WebScriptBindings {
+// Proxy interface to talk to the document's PermissionClient implementation.
+// This proxy is created by the embedder and is passed to the worker's
+// WorkerGlobalScope in blink. Each allow method is called on the worker thread
+// and may destructed on the worker thread.
+class WebWorkerPermissionClientProxy {
public:
- // Efficiently converts a WebString to a v8::String. The caller must have
- // a HandleScope to guard the result's lifetime.
- BLINK_EXPORT static v8::Local<v8::String> toV8String(const WebString&, v8::Isolate*);
+ virtual ~WebWorkerPermissionClientProxy() { }
+
+ virtual bool allowDatabase(const WebString& name, const WebString& displayName, unsigned long estimatedSize)
+ {
+ return true;
+ }
+
+ virtual bool allowFileSystem()
+ {
+ return true;
+ }
- // You can use v8::Value::toString() to get a v8::String, but remember to wrap that in a v8::TryCatch.
- BLINK_EXPORT static WebString toWebString(v8::Handle<v8::String>);
+ virtual bool allowIndexedDB(const WebString& name)
+ {
+ return true;
+ }
};
} // namespace WebKit
-#endif
+#endif // WebWorkerPermissionClientProxy_h
« no previous file with comments | « public/web/WebSharedWorkerClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698