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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.h

Issue 2745313003: Move securityCheck out of V8WrapperInstantiationScope (Closed)
Patch Set: Code review changes Created 3 years, 8 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: third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.h b/third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.h
new file mode 100644
index 0000000000000000000000000000000000000000..eac23edc869360a4eba96c821631d3735ec3a1df
--- /dev/null
+++ b/third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.h
@@ -0,0 +1,47 @@
+// Copyright 2017 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 WrapperCreationSecurityCheck_h
+#define WrapperCreationSecurityCheck_h
+
+#include "core/CoreExport.h"
+#include "platform/wtf/Allocator.h"
+#include "v8/include/v8.h"
+
+namespace blink {
+
+struct WrapperTypeInfo;
+
+class CORE_EXPORT WrapperCreationSecurityCheck {
haraken 2017/04/07 04:23:36 Add a class-level comment.
adithyas 2017/04/07 18:42:53 Done.
+ STATIC_ONLY(WrapperCreationSecurityCheck);
+
+ public:
+ using SecurityCheckFunction = bool (*)(v8::Isolate*,
+ v8::Local<v8::Context>,
+ const WrapperTypeInfo*);
+ using RethrowExceptionFunction = void (*)(v8::Isolate*,
+ v8::Local<v8::Context>,
+ const WrapperTypeInfo*,
+ v8::Local<v8::Value>);
+
+ static void setSecurityCheckFunction(SecurityCheckFunction);
+ static void setRethrowExceptionFunction(RethrowExceptionFunction);
haraken 2017/04/07 04:23:36 Is there any reason you adopted the function point
Yuki 2017/04/07 07:42:14 Just FYI, BindingSecurity is STATIC_ONLY so far.
haraken 2017/04/07 09:53:40 Makes sense.
+
+ static bool verifyContextAccess(v8::Isolate*,
+ v8::Local<v8::Context> creationContext,
+ const WrapperTypeInfo*);
+ static void rethrowCrossContextException(
+ v8::Isolate*,
+ v8::Local<v8::Context> creationContext,
+ const WrapperTypeInfo*,
+ v8::Local<v8::Value> crossContextException);
+
+ private:
+ static SecurityCheckFunction s_securityCheck;
+ static RethrowExceptionFunction s_rethrowException;
+};
+
+} // namespace blink
+
+#endif // WrapperCreationSecurityCheck_h

Powered by Google App Engine
This is Rietveld 408576698