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

Unified Diff: Source/bindings/v8/CustomElementConstructorBuilder.cpp

Issue 135843008: Remove V8HiddenPropertyName (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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: Source/bindings/v8/CustomElementConstructorBuilder.cpp
diff --git a/Source/bindings/v8/CustomElementConstructorBuilder.cpp b/Source/bindings/v8/CustomElementConstructorBuilder.cpp
index df4bdbbd2d9998d78b611ee4b6962c21c546b025..c54260c5c1a5ddf9644b9cdc8bca8977b1975dd3 100644
--- a/Source/bindings/v8/CustomElementConstructorBuilder.cpp
+++ b/Source/bindings/v8/CustomElementConstructorBuilder.cpp
@@ -43,7 +43,6 @@
#include "bindings/v8/ScriptState.h"
#include "bindings/v8/UnsafePersistent.h"
#include "bindings/v8/V8Binding.h"
-#include "bindings/v8/V8HiddenPropertyName.h"
#include "bindings/v8/V8PerContextData.h"
#include "core/dom/Document.h"
#include "core/dom/custom/CustomElementCallbackDispatcher.h"
@@ -191,10 +190,10 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
m_constructor->SetName(v8Type->IsNull() ? v8TagName : v8Type.As<v8::String>());
- V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementDocument", toV8(document, m_context->Global(), isolate));
- V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementNamespaceURI", v8String(isolate, descriptor.namespaceURI()));
- V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementTagName", v8TagName);
- V8HiddenPropertyName::setNamedHiddenReference(m_constructor, "customElementType", v8Type);
+ setHiddenValue(m_constructor, v8AtomicString(isolate, "customElementDocument"), toV8(document, m_context->Global(), isolate));
+ setHiddenValue(m_constructor, v8AtomicString(isolate, "customElementNamespaceURI"), v8String(isolate, descriptor.namespaceURI()));
+ setHiddenValue(m_constructor, v8AtomicString(isolate, "customElementTagName"), v8TagName);
+ setHiddenValue(m_constructor, v8AtomicString(isolate, "customElementType"), v8Type);
v8::Handle<v8::String> prototypeKey = v8String(isolate, "prototype");
ASSERT(m_constructor->HasOwnProperty(prototypeKey));
@@ -207,7 +206,7 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
// property.
m_constructor->ForceSet(prototypeKey, m_prototype, v8::PropertyAttribute(v8::ReadOnly | v8::DontEnum | v8::DontDelete));
- V8HiddenPropertyName::setNamedHiddenReference(m_prototype, "customElementIsInterfacePrototypeObject", v8::True(isolate));
+ setHiddenValue(m_prototype, v8AtomicString(isolate, "customElementIsInterfacePrototypeObject"), v8::True(isolate));
m_prototype->ForceSet(v8String(isolate, "constructor"), m_constructor, v8::DontEnum);
return true;
@@ -215,7 +214,7 @@ bool CustomElementConstructorBuilder::createConstructor(Document* document, Cust
bool CustomElementConstructorBuilder::prototypeIsValid(const AtomicString& type, ExceptionState& exceptionState) const
{
- if (m_prototype->InternalFieldCount() || !m_prototype->GetHiddenValue(V8HiddenPropertyName::customElementIsInterfacePrototypeObject(m_context->GetIsolate())).IsEmpty()) {
+ if (m_prototype->InternalFieldCount() || !getHiddenValue(m_prototype, v8AtomicString(m_context->GetIsolate(), "customElementIsInterfacePrototypeObject")).IsEmpty()) {
CustomElementException::throwException(CustomElementException::PrototypeInUse, type, exceptionState);
return false;
}
@@ -270,10 +269,10 @@ static void constructCustomElement(const v8::FunctionCallbackInfo<v8::Value>& in
return;
}
- Document* document = V8Document::toNative(info.Callee()->GetHiddenValue(V8HiddenPropertyName::customElementDocument(isolate)).As<v8::Object>());
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, info.Callee()->GetHiddenValue(V8HiddenPropertyName::customElementNamespaceURI(isolate)));
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, tagName, info.Callee()->GetHiddenValue(V8HiddenPropertyName::customElementTagName(isolate)));
- v8::Handle<v8::Value> maybeType = info.Callee()->GetHiddenValue(V8HiddenPropertyName::customElementType(isolate));
+ Document* document = V8Document::toNative(getHiddenValue(info.Callee(), v8AtomicString(isolate, "customElementDocument")).As<v8::Object>());
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, namespaceURI, getHiddenValue(info.Callee(), v8AtomicString(isolate, "customElementNamespaceURI")));
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, tagName, getHiddenValue(info.Callee(), v8AtomicString(isolate, "customElementTagName")));
+ v8::Handle<v8::Value> maybeType = getHiddenValue(info.Callee(), v8AtomicString(isolate, "customElementType"));
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, type, maybeType);
ExceptionState exceptionState(ExceptionState::ConstructionContext, "CustomElement", info.Holder(), info.GetIsolate());

Powered by Google App Engine
This is Rietveld 408576698