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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp

Issue 2005433002: [Origin Trials] Install origin trial bindings on V8 context conditionally (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-ef-install
Patch Set: Fix multiple definition of signature; addressing nits Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
index 0396898eebd7e46c7576985d3328c75425483b16..75998cd4faef55a876d90911f864e7accb3e9d9e 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMConfiguration.cpp
@@ -29,6 +29,7 @@
#include "bindings/core/v8/V8DOMConfiguration.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
+#include "bindings/core/v8/V8PerContextData.h"
#include "platform/TraceEvent.h"
namespace blink {
@@ -68,7 +69,16 @@ void installAttributeInternal(v8::Isolate* isolate, v8::Local<v8::Object> instan
return;
v8::Local<v8::Name> name = v8AtomicString(isolate, attribute.name);
- v8::Local<v8::Value> data = v8::External::New(isolate, const_cast<WrapperTypeInfo*>(attribute.data));
+
+ // This method is only being used for installing interfaces which are
+ // enabled through origin trials. Assert here that it is being called with
+ // an attribute configuration for a constructor.
+ // TODO(iclelland): Relax this constraint and allow arbitrary data-type
+ // properties to be added here.
+ DCHECK_EQ(&v8ConstructorAttributeGetter, attribute.getter);
+
+ V8PerContextData* perContextData = V8PerContextData::from(isolate->GetCurrentContext());
+ v8::Local<v8::Function> data = perContextData->constructorForType(attribute.data);
DCHECK(attribute.propertyLocationConfiguration);
if (attribute.propertyLocationConfiguration & V8DOMConfiguration::OnInstance)
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp ('k') | third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698