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

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

Issue 1760143003: bindings: Remove the hidden prototype from HTMLDocument. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp b/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp
index c6eba598f80841588fddf2fa573ec7fae1ac564b..dcb048c0e03d30237a588e17309c8b541117093c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8DOMWrapper.cpp
@@ -31,8 +31,6 @@
#include "bindings/core/v8/V8DOMWrapper.h"
#include "bindings/core/v8/V8Binding.h"
-#include "bindings/core/v8/V8HTMLCollection.h"
-#include "bindings/core/v8/V8HTMLDocument.h"
#include "bindings/core/v8/V8Location.h"
#include "bindings/core/v8/V8ObjectConstructor.h"
#include "bindings/core/v8/V8PerContextData.h"
@@ -42,34 +40,6 @@
namespace blink {
-static v8::Local<v8::Object> wrapInShadowTemplate(v8::Local<v8::Object> wrapper, ScriptWrappable* scriptWrappable, v8::Isolate* isolate)
-{
- static int shadowTemplateKey; // This address is used for a key to look up the dom template.
- V8PerIsolateData* data = V8PerIsolateData::from(isolate);
- v8::Local<v8::FunctionTemplate> shadowTemplate = data->existingDOMTemplate(&shadowTemplateKey);
- if (shadowTemplate.IsEmpty()) {
- shadowTemplate = v8::FunctionTemplate::New(isolate);
- if (shadowTemplate.IsEmpty())
- return v8::Local<v8::Object>();
- shadowTemplate->SetClassName(v8AtomicString(isolate, "HTMLDocument"));
- shadowTemplate->Inherit(V8HTMLDocument::domTemplate(isolate));
- shadowTemplate->InstanceTemplate()->SetInternalFieldCount(V8HTMLDocument::internalFieldCount);
- data->setDOMTemplate(&shadowTemplateKey, shadowTemplate);
- }
-
- v8::Local<v8::Function> shadowConstructor;
- if (!shadowTemplate->GetFunction(isolate->GetCurrentContext()).ToLocal(&shadowConstructor))
- return v8::Local<v8::Object>();
-
- v8::Local<v8::Object> shadow;
- if (!V8ScriptRunner::instantiateObject(isolate, shadowConstructor).ToLocal(&shadow))
- return v8::Local<v8::Object>();
- if (!v8CallBoolean(shadow->SetPrototype(isolate->GetCurrentContext(), wrapper)))
- return v8::Local<v8::Object>();
- V8DOMWrapper::setNativeInfo(wrapper, &V8HTMLDocument::wrapperTypeInfo, scriptWrappable);
- return shadow;
-}
-
v8::Local<v8::Object> V8DOMWrapper::createWrapper(v8::Isolate* isolate, v8::Local<v8::Object> creationContext, const WrapperTypeInfo* type, ScriptWrappable* scriptWrappable)
{
ASSERT(!type->equals(&V8Window::wrapperTypeInfo));
@@ -88,9 +58,6 @@ v8::Local<v8::Object> V8DOMWrapper::createWrapper(v8::Isolate* isolate, v8::Loca
return v8::Local<v8::Object>();
}
- if (type == &V8HTMLDocument::wrapperTypeInfo && !wrapper.IsEmpty())
- wrapper = wrapInShadowTemplate(wrapper, scriptWrappable, isolate);
-
return wrapper;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/WindowProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698