X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fbindings%2Ftests%2Fresults%2FV8TestInterfaceEventTarget.cpp;h=006b6a4efed1a2217d84a859c890d52910f726eb;hb=4a1a0bdd01eef90b0826a0e761d3379d3715c10f;hp=36b77f0373ac37bf39f650dda9a2b9d3d2cb47b0;hpb=b1be5ca53587d23e7aeb77b26861fdc0a181ffd8;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/bindings/tests/results/V8TestInterfaceEventTarget.cpp b/src/third_party/WebKit/Source/bindings/tests/results/V8TestInterfaceEventTarget.cpp index 36b77f0..006b6a4 100644 --- a/src/third_party/WebKit/Source/bindings/tests/results/V8TestInterfaceEventTarget.cpp +++ b/src/third_party/WebKit/Source/bindings/tests/results/V8TestInterfaceEventTarget.cpp @@ -7,10 +7,10 @@ #include "config.h" #include "V8TestInterfaceEventTarget.h" -#include "bindings/v8/ExceptionState.h" -#include "bindings/v8/V8DOMConfiguration.h" -#include "bindings/v8/V8HiddenValue.h" -#include "bindings/v8/V8ObjectConstructor.h" +#include "bindings/core/v8/ExceptionState.h" +#include "bindings/core/v8/V8DOMConfiguration.h" +#include "bindings/core/v8/V8HiddenValue.h" +#include "bindings/core/v8/V8ObjectConstructor.h" #include "core/dom/ContextFeatures.h" #include "core/dom/Document.h" #include "core/frame/LocalDOMWindow.h" @@ -19,7 +19,7 @@ #include "wtf/GetPtr.h" #include "wtf/RefPtr.h" -namespace WebCore { +namespace blink { static void initializeScriptWrappableForInterface(TestInterfaceEventTarget* object) { @@ -29,15 +29,15 @@ static void initializeScriptWrappableForInterface(TestInterfaceEventTarget* obje ASSERT_NOT_REACHED(); } -} // namespace WebCore +} // namespace blink -void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceEventTarget* object) +void webCoreInitializeScriptWrappableForInterface(blink::TestInterfaceEventTarget* object) { - WebCore::initializeScriptWrappableForInterface(object); + blink::initializeScriptWrappableForInterface(object); } -namespace WebCore { -const WrapperTypeInfo V8TestInterfaceEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEventTarget::domTemplate, V8TestInterfaceEventTarget::derefObject, 0, V8TestInterfaceEventTarget::toEventTarget, 0, V8TestInterfaceEventTarget::installPerContextEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype, WillBeGarbageCollectedObject }; +namespace blink { +const WrapperTypeInfo V8TestInterfaceEventTarget::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEventTarget::domTemplate, V8TestInterfaceEventTarget::derefObject, 0, V8TestInterfaceEventTarget::toEventTarget, 0, V8TestInterfaceEventTarget::installConditionallyEnabledMethods, &V8EventTarget::wrapperTypeInfo, WrapperTypeObjectPrototype, WillBeGarbageCollectedObject }; namespace TestInterfaceEventTargetV8Internal { @@ -45,33 +45,23 @@ template void V8_USE(T) { } } // namespace TestInterfaceEventTargetV8Internal -const WrapperTypeInfo V8TestInterfaceEventTargetConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEventTargetConstructor::domTemplate, V8TestInterfaceEventTarget::derefObject, 0, V8TestInterfaceEventTarget::toEventTarget, 0, V8TestInterfaceEventTarget::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype, WillBeGarbageCollectedObject }; +const WrapperTypeInfo V8TestInterfaceEventTargetConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEventTargetConstructor::domTemplate, V8TestInterfaceEventTarget::derefObject, 0, V8TestInterfaceEventTarget::toEventTarget, 0, V8TestInterfaceEventTarget::installConditionallyEnabledMethods, 0, WrapperTypeObjectPrototype, WillBeGarbageCollectedObject }; static void V8TestInterfaceEventTargetConstructorCallback(const v8::FunctionCallbackInfo& info) { - v8::Isolate* isolate = info.GetIsolate(); if (!info.IsConstructCall()) { - throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Name"), isolate); + V8ThrowException::throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Name"), info.GetIsolate()); return; } - if (ConstructorMode::current(isolate) == ConstructorMode::WrapExistingObject) { + if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) { v8SetReturnValue(info, info.Holder()); return; } - - Document* documentPtr = currentDOMWindow(isolate)->document(); - ASSERT(documentPtr); - Document& document = *documentPtr; - - // Make sure the document is added to the DOM Node map. Otherwise, the TestInterfaceEventTarget instance - // may end up being the only node in the map and get garbage-collected prematurely. - toV8(documentPtr, info.Holder(), isolate); - + Document& document = *toDocument(currentExecutionContext(info.GetIsolate())); RefPtrWillBeRawPtr impl = TestInterfaceEventTarget::createForJSConstructor(document); - v8::Handle wrapper = info.Holder(); - V8DOMWrapper::associateObjectWithWrapper(impl.release(), &V8TestInterfaceEventTargetConstructor::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); + V8DOMWrapper::associateObjectWithWrapper(impl.release(), &V8TestInterfaceEventTargetConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Independent); v8SetReturnValue(info, wrapper); } @@ -83,7 +73,7 @@ v8::Handle V8TestInterfaceEventTargetConstructor::domTempl if (!result.IsEmpty()) return result; - TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); + TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "BuildDOMTemplate"); result = v8::FunctionTemplate::New(isolate, V8TestInterfaceEventTargetConstructorCallback); v8::Local instanceTemplate = result->InstanceTemplate(); instanceTemplate->SetInternalFieldCount(V8TestInterfaceEventTarget::internalFieldCount); @@ -93,7 +83,7 @@ v8::Handle V8TestInterfaceEventTargetConstructor::domTempl return result; } -static void configureV8TestInterfaceEventTargetTemplate(v8::Handle functionTemplate, v8::Isolate* isolate) +static void installV8TestInterfaceEventTargetTemplate(v8::Handle functionTemplate, v8::Isolate* isolate) { functionTemplate->ReadOnlyPrototype(); @@ -112,7 +102,7 @@ static void configureV8TestInterfaceEventTargetTemplate(v8::Handle V8TestInterfaceEventTarget::domTemplate(v8::Isolate* isolate) { - return V8DOMConfiguration::domClassTemplate(isolate, const_cast(&wrapperTypeInfo), configureV8TestInterfaceEventTargetTemplate); + return V8DOMConfiguration::domClassTemplate(isolate, const_cast(&wrapperTypeInfo), installV8TestInterfaceEventTargetTemplate); } bool V8TestInterfaceEventTarget::hasInstance(v8::Handle v8Value, v8::Isolate* isolate) @@ -127,7 +117,7 @@ v8::Handle V8TestInterfaceEventTarget::findInstanceInPrototypeChain( TestInterfaceEventTarget* V8TestInterfaceEventTarget::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle value) { - return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0; + return hasInstance(value, isolate) ? fromInternalPointer(blink::toInternalPointer(v8::Handle::Cast(value))) : 0; } EventTarget* V8TestInterfaceEventTarget::toEventTarget(v8::Handle object) @@ -157,15 +147,15 @@ v8::Handle V8TestInterfaceEventTarget::createWrapper(PassRefPtrWillB if (UNLIKELY(wrapper.IsEmpty())) return wrapper; - installPerContextEnabledProperties(wrapper, impl.get(), isolate); + installConditionallyEnabledProperties(wrapper, isolate); V8DOMWrapper::associateObjectWithWrapper(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent); return wrapper; } -void V8TestInterfaceEventTarget::derefObject(void* object) +void V8TestInterfaceEventTarget::derefObject(ScriptWrappableBase* internalPointer) { #if !ENABLE(OILPAN) - fromInternalPointer(object)->deref(); + fromInternalPointer(internalPointer)->deref(); #endif // !ENABLE(OILPAN) } @@ -175,4 +165,4 @@ v8::Handle toV8NoInline(TestInterfaceEventTarget* impl, v8::Handle