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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WrapperCreationSecurityCheck_h
6 #define WrapperCreationSecurityCheck_h
7
8 #include "core/CoreExport.h"
9 #include "platform/wtf/Allocator.h"
10 #include "v8/include/v8.h"
11
12 namespace blink {
13
14 struct WrapperTypeInfo;
15
16 class CORE_EXPORT WrapperCreationSecurityCheck {
haraken 2017/04/07 04:23:36 Add a class-level comment.
adithyas 2017/04/07 18:42:53 Done.
17 STATIC_ONLY(WrapperCreationSecurityCheck);
18
19 public:
20 using SecurityCheckFunction = bool (*)(v8::Isolate*,
21 v8::Local<v8::Context>,
22 const WrapperTypeInfo*);
23 using RethrowExceptionFunction = void (*)(v8::Isolate*,
24 v8::Local<v8::Context>,
25 const WrapperTypeInfo*,
26 v8::Local<v8::Value>);
27
28 static void setSecurityCheckFunction(SecurityCheckFunction);
29 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.
30
31 static bool verifyContextAccess(v8::Isolate*,
32 v8::Local<v8::Context> creationContext,
33 const WrapperTypeInfo*);
34 static void rethrowCrossContextException(
35 v8::Isolate*,
36 v8::Local<v8::Context> creationContext,
37 const WrapperTypeInfo*,
38 v8::Local<v8::Value> crossContextException);
39
40 private:
41 static SecurityCheckFunction s_securityCheck;
42 static RethrowExceptionFunction s_rethrowException;
43 };
44
45 } // namespace blink
46
47 #endif // WrapperCreationSecurityCheck_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698