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

Unified Diff: third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp

Issue 2837923003: Make NodeFilter a legacy callback interface. (Closed)
Patch Set: legacy_callback_interface.*.tmpl, etc. 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/platform/bindings/V8PerContextData.cpp
diff --git a/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp b/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp
index 15db3d12ff4162670166d0b9fb23fb85ae56c18b..f78b72d4c0d0bfa1a3cba93ca081ab4ca4a13431 100644
--- a/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp
+++ b/third_party/WebKit/Source/platform/bindings/V8PerContextData.cpp
@@ -129,28 +129,32 @@ v8::Local<v8::Function> V8PerContextData::ConstructorForTypeSlowCase(
return v8::Local<v8::Function>();
}
- v8::Local<v8::Value> prototype_value;
- if (!interface_object
- ->Get(current_context, V8AtomicString(isolate_, "prototype"))
- .ToLocal(&prototype_value) ||
- !prototype_value->IsObject())
- return v8::Local<v8::Function>();
- v8::Local<v8::Object> prototype_object = prototype_value.As<v8::Object>();
- if (prototype_object->InternalFieldCount() ==
- kV8PrototypeInternalFieldcount &&
- type->wrapper_type_prototype ==
- WrapperTypeInfo::kWrapperTypeObjectPrototype) {
- prototype_object->SetAlignedPointerInInternalField(
- kV8PrototypeTypeIndex, const_cast<WrapperTypeInfo*>(type));
- }
- type->PreparePrototypeAndInterfaceObject(current_context, world,
- prototype_object, interface_object,
- interface_template);
- if (type->wrapper_type_prototype ==
- WrapperTypeInfo::kWrapperTypeExceptionPrototype) {
- if (!V8CallBoolean(prototype_object->SetPrototype(
- current_context, error_prototype_.NewLocal(isolate_)))) {
+ v8::Local<v8::Object> prototype_object;
+ if (type->wrapper_type_prototype !=
+ WrapperTypeInfo::kWrapperTypeNoPrototype) {
+ v8::Local<v8::Value> prototype_value;
+ if (!interface_object
+ ->Get(current_context, V8AtomicString(isolate_, "prototype"))
+ .ToLocal(&prototype_value) ||
+ !prototype_value->IsObject())
return v8::Local<v8::Function>();
+ prototype_object = prototype_value.As<v8::Object>();
+ if (prototype_object->InternalFieldCount() ==
+ kV8PrototypeInternalFieldcount &&
+ type->wrapper_type_prototype ==
+ WrapperTypeInfo::kWrapperTypeObjectPrototype) {
+ prototype_object->SetAlignedPointerInInternalField(
+ kV8PrototypeTypeIndex, const_cast<WrapperTypeInfo*>(type));
+ }
+ type->PreparePrototypeAndInterfaceObject(current_context, world,
+ prototype_object, interface_object,
+ interface_template);
+ if (type->wrapper_type_prototype ==
+ WrapperTypeInfo::kWrapperTypeExceptionPrototype) {
+ if (!V8CallBoolean(prototype_object->SetPrototype(
+ current_context, error_prototype_.NewLocal(isolate_)))) {
+ return v8::Local<v8::Function>();
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698