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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/WrapperCreationSecurityCheck.cpp

Issue 2843603002: Move ScriptWrappable and dependencies to platform/bindings (Closed)
Patch Set: Rebase and try again Created 3 years, 7 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 #include "bindings/core/v8/WrapperCreationSecurityCheck.h"
6
7 #include "bindings/core/v8/WrapperTypeInfo.h"
8
9 namespace blink {
10
11 WrapperCreationSecurityCheck::SecurityCheckFunction
12 WrapperCreationSecurityCheck::security_check_ = nullptr;
13 WrapperCreationSecurityCheck::RethrowExceptionFunction
14 WrapperCreationSecurityCheck::rethrow_exception_ = nullptr;
15
16 void WrapperCreationSecurityCheck::SetSecurityCheckFunction(
17 SecurityCheckFunction func) {
18 DCHECK(!security_check_);
19 security_check_ = func;
20 }
21
22 void WrapperCreationSecurityCheck::SetRethrowExceptionFunction(
23 RethrowExceptionFunction func) {
24 DCHECK(!rethrow_exception_);
25 rethrow_exception_ = func;
26 }
27
28 bool WrapperCreationSecurityCheck::VerifyContextAccess(
29 v8::Local<v8::Context> creation_context,
30 const WrapperTypeInfo* type) {
31 return (*security_check_)(creation_context, type);
32 }
33
34 void WrapperCreationSecurityCheck::RethrowCrossContextException(
35 v8::Local<v8::Context> creation_context,
36 const WrapperTypeInfo* type,
37 v8::Local<v8::Value> cross_context_exception) {
38 (*rethrow_exception_)(creation_context, type, cross_context_exception);
39 }
40
41 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698