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

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

Issue 2745313003: Move securityCheck out of V8WrapperInstantiationScope (Closed)
Patch Set: Stop unecessary includes of BindingSecurity.h Created 3 years, 9 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/WrapperTypeInfo.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
index a5cd9434c2f756397ebf27292f4ee244f3fa847a..dfd179cdbc70773514ab42b5183485c2bae69f3f 100644
--- a/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
+++ b/third_party/WebKit/Source/bindings/core/v8/WrapperTypeInfo.h
@@ -58,6 +58,11 @@ static const int v8PrototypeInternalFieldcount = 1;
typedef v8::Local<v8::FunctionTemplate> (
*DomTemplateFunction)(v8::Isolate*, const DOMWrapperWorld&);
+typedef void (*SecurityCheckFunction)(v8::Isolate*,
+ v8::Local<v8::Context>,
+ v8::Local<v8::Context>,
+ const char*,
+ v8::Local<v8::Value>);
typedef void (*TraceFunction)(Visitor*, ScriptWrappable*);
typedef void (*TraceWrappersFunction)(WrapperVisitor*, ScriptWrappable*);
typedef ActiveScriptWrappableBase* (*ToActiveScriptWrappableFunction)(
@@ -129,6 +134,15 @@ struct WrapperTypeInfo {
return domTemplateFunction(isolate, world);
}
+ void securityCheck(v8::Isolate* isolate,
+ v8::Local<v8::Context> accessingContext,
+ v8::Local<v8::Context> creationContext,
+ const char* interfaceName,
+ v8::Local<v8::Value> crossContextException) const {
+ securityCheckFunction(isolate, accessingContext, creationContext,
+ interfaceName, crossContextException);
+ }
+
void wrapperCreated() const {
ThreadState::current()->heap().heapStats().increaseWrapperCount(1);
}
@@ -170,6 +184,7 @@ struct WrapperTypeInfo {
const gin::GinEmbedder ginEmbedder;
DomTemplateFunction domTemplateFunction;
+ SecurityCheckFunction securityCheckFunction;
const TraceFunction traceFunction;
const TraceWrappersFunction traceWrappersFunction;
PreparePrototypeAndInterfaceObjectFunction
@@ -180,7 +195,7 @@ struct WrapperTypeInfo {
const unsigned wrapperClassId : 2; // WrapperClassId
const unsigned
activeScriptWrappableInheritance : 1; // ActiveScriptWrappableInheritance
- const unsigned lifetime : 1; // Lifetime
+ const unsigned lifetime : 1; // Lifetime
};
template <typename T, int offset>

Powered by Google App Engine
This is Rietveld 408576698