OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 #include "V8TestObject.h" | 8 #include "V8TestObject.h" |
9 | 9 |
10 #include "bindings/core/v8/BindingSecurity.h" | 10 #include "bindings/core/v8/BindingSecurity.h" |
(...skipping 1863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1874 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedArrayAttribute"); | 1874 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedArrayAttribute"); |
1875 TestObject* impl = V8TestObject::toNative(holder); | 1875 TestObject* impl = V8TestObject::toNative(holder); |
1876 if (!impl->isArrayDirty()) { | 1876 if (!impl->isArrayDirty()) { |
1877 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIs olate(), holder, propertyName); | 1877 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIs olate(), holder, propertyName); |
1878 if (!v8Value.IsEmpty()) { | 1878 if (!v8Value.IsEmpty()) { |
1879 v8SetReturnValue(info, v8Value); | 1879 v8SetReturnValue(info, v8Value); |
1880 return; | 1880 return; |
1881 } | 1881 } |
1882 } | 1882 } |
1883 Vector<String> cppValue(impl->cachedArrayAttribute()); | 1883 Vector<String> cppValue(impl->cachedArrayAttribute()); |
1884 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Arr ay(cppValue, info.Holder(), info.GetIsolate())); | 1884 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Arr ay(cppValue, scriptState->context()->Global(), scriptState->isolate())); |
Jens Widell
2014/07/03 11:33:14
This change (and several below) looks wrong; there
haraken
2014/07/03 11:56:09
Fixed (by resolving the conflict for cpp_value_to_
| |
1885 v8SetReturnValue(info, v8Array(cppValue, info.Holder(), info.GetIsolate())); | 1885 v8SetReturnValue(info, v8Array(cppValue, info.Holder(), info.GetIsolate())); |
1886 } | 1886 } |
1887 | 1887 |
1888 static void cachedArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, c onst v8::PropertyCallbackInfo<v8::Value>& info) | 1888 static void cachedArrayAttributeAttributeGetterCallback(v8::Local<v8::String>, c onst v8::PropertyCallbackInfo<v8::Value>& info) |
1889 { | 1889 { |
1890 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 1890 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
1891 TestObjectV8Internal::cachedArrayAttributeAttributeGetter(info); | 1891 TestObjectV8Internal::cachedArrayAttributeAttributeGetter(info); |
1892 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 1892 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
1893 } | 1893 } |
1894 | 1894 |
(...skipping 19 matching lines...) Expand all Loading... | |
1914 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedStringOrNoneAttribute"); | 1914 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedStringOrNoneAttribute"); |
1915 TestObject* impl = V8TestObject::toNative(holder); | 1915 TestObject* impl = V8TestObject::toNative(holder); |
1916 if (!impl->isStringDirty()) { | 1916 if (!impl->isStringDirty()) { |
1917 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIs olate(), holder, propertyName); | 1917 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIs olate(), holder, propertyName); |
1918 if (!v8Value.IsEmpty()) { | 1918 if (!v8Value.IsEmpty()) { |
1919 v8SetReturnValue(info, v8Value); | 1919 v8SetReturnValue(info, v8Value); |
1920 return; | 1920 return; |
1921 } | 1921 } |
1922 } | 1922 } |
1923 String cppValue(impl->cachedStringOrNoneAttribute()); | 1923 String cppValue(impl->cachedStringOrNoneAttribute()); |
1924 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, cppVa lue.isNull() ? v8::Handle<v8::Value>(v8::Null(info.GetIsolate())) : v8String(inf o.GetIsolate(), cppValue)); | 1924 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, cppVa lue.isNull() ? v8::Handle<v8::Value>(v8::Null(scriptState->isolate())) : v8Strin g(scriptState->isolate(), cppValue)); |
1925 v8SetReturnValueStringOrNull(info, cppValue, info.GetIsolate()); | 1925 v8SetReturnValueStringOrNull(info, cppValue, info.GetIsolate()); |
1926 } | 1926 } |
1927 | 1927 |
1928 static void cachedStringOrNoneAttributeAttributeGetterCallback(v8::Local<v8::Str ing>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1928 static void cachedStringOrNoneAttributeAttributeGetterCallback(v8::Local<v8::Str ing>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1929 { | 1929 { |
1930 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 1930 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
1931 TestObjectV8Internal::cachedStringOrNoneAttributeAttributeGetter(info); | 1931 TestObjectV8Internal::cachedStringOrNoneAttributeAttributeGetter(info); |
1932 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 1932 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
1933 } | 1933 } |
1934 | 1934 |
(...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4286 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedTreatReturnedNullStringAsUndefinedStringAttribute"); | 4286 v8::Handle<v8::String> propertyName = v8AtomicString(info.GetIsolate(), "cac hedTreatReturnedNullStringAsUndefinedStringAttribute"); |
4287 TestObject* impl = V8TestObject::toNative(holder); | 4287 TestObject* impl = V8TestObject::toNative(holder); |
4288 if (!impl->isStringDirty()) { | 4288 if (!impl->isStringDirty()) { |
4289 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIs olate(), holder, propertyName); | 4289 v8::Handle<v8::Value> v8Value = V8HiddenValue::getHiddenValue(info.GetIs olate(), holder, propertyName); |
4290 if (!v8Value.IsEmpty()) { | 4290 if (!v8Value.IsEmpty()) { |
4291 v8SetReturnValue(info, v8Value); | 4291 v8SetReturnValue(info, v8Value); |
4292 return; | 4292 return; |
4293 } | 4293 } |
4294 } | 4294 } |
4295 String cppValue(impl->cachedTreatReturnedNullStringAsUndefinedStringAttribut e()); | 4295 String cppValue(impl->cachedTreatReturnedNullStringAsUndefinedStringAttribut e()); |
4296 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, cppVa lue.isNull() ? v8Undefined() : v8String(info.GetIsolate(), cppValue)); | 4296 V8HiddenValue::setHiddenValue(info.GetIsolate(), holder, propertyName, v8Str ing(scriptState->isolate(), cppValue)); |
4297 v8SetReturnValueStringOrUndefined(info, cppValue, info.GetIsolate()); | 4297 v8SetReturnValueStringOrUndefined(info, cppValue, info.GetIsolate()); |
4298 } | 4298 } |
4299 | 4299 |
4300 static void cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeGett erCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& inf o) | 4300 static void cachedTreatReturnedNullStringAsUndefinedStringAttributeAttributeGett erCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& inf o) |
4301 { | 4301 { |
4302 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | 4302 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); |
4303 TestObjectV8Internal::cachedTreatReturnedNullStringAsUndefinedStringAttribut eAttributeGetter(info); | 4303 TestObjectV8Internal::cachedTreatReturnedNullStringAsUndefinedStringAttribut eAttributeGetter(info); |
4304 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 4304 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
4305 } | 4305 } |
4306 | 4306 |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4655 } | 4655 } |
4656 | 4656 |
4657 static void activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSetterCal lback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCal lbackInfo<void>& info) | 4657 static void activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSetterCal lback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCal lbackInfo<void>& info) |
4658 { | 4658 { |
4659 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 4659 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
4660 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); | 4660 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); |
4661 V8PerContextData* contextData = scriptState->perContextData(); | 4661 V8PerContextData* contextData = scriptState->perContextData(); |
4662 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) { | 4662 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) { |
4663 TestObject* impl = V8TestObject::toNative(info.Holder()); | 4663 TestObject* impl = V8TestObject::toNative(info.Holder()); |
4664 String cppValue(impl->activityLoggingSetterOnlyLogPreviousValueAttribute ()); | 4664 String cppValue(impl->activityLoggingSetterOnlyLogPreviousValueAttribute ()); |
4665 v8::Handle<v8::Value> originalValue = cppValue.isNull() ? v8::Handle<v8: :Value>(v8::Null(info.GetIsolate())) : v8String(info.GetIsolate(), cppValue); | 4665 v8::Handle<v8::Value> originalValue = cppValue.isNull() ? v8::Handle<v8: :Value>(v8::Null(scriptState->isolate())) : v8String(scriptState->isolate(), cpp Value); |
4666 contextData->activityLogger()->logSetter("TestObject.activityLoggingSett erOnlyLogPreviousValueAttribute", v8Value, originalValue); | 4666 contextData->activityLogger()->logSetter("TestObject.activityLoggingSett erOnlyLogPreviousValueAttribute", v8Value, originalValue); |
4667 } | 4667 } |
4668 TestObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttr ibuteSetter(v8Value, info); | 4668 TestObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttr ibuteSetter(v8Value, info); |
4669 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 4669 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
4670 } | 4670 } |
4671 | 4671 |
4672 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeGetter(con st v8::PropertyCallbackInfo<v8::Value>& info) | 4672 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeGetter(con st v8::PropertyCallbackInfo<v8::Value>& info) |
4673 { | 4673 { |
4674 v8::Handle<v8::Object> holder = info.Holder(); | 4674 v8::Handle<v8::Object> holder = info.Holder(); |
4675 TestObject* impl = V8TestObject::toNative(holder); | 4675 TestObject* impl = V8TestObject::toNative(holder); |
(...skipping 21 matching lines...) Expand all Loading... | |
4697 } | 4697 } |
4698 | 4698 |
4699 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeSetterCall back(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCall backInfo<void>& info) | 4699 static void activityLoggingLogPreviousValueInterfaceAttributeAttributeSetterCall back(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCall backInfo<void>& info) |
4700 { | 4700 { |
4701 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 4701 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
4702 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); | 4702 ScriptState* scriptState = ScriptState::from(info.GetIsolate()->GetCurrentCo ntext()); |
4703 V8PerContextData* contextData = scriptState->perContextData(); | 4703 V8PerContextData* contextData = scriptState->perContextData(); |
4704 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) { | 4704 if (scriptState->world().isIsolatedWorld() && contextData && contextData->ac tivityLogger()) { |
4705 TestObject* impl = V8TestObject::toNative(info.Holder()); | 4705 TestObject* impl = V8TestObject::toNative(info.Holder()); |
4706 RefPtr<TestInterfaceEmpty> cppValue(impl->activityLoggingLogPreviousValu eInterfaceAttribute()); | 4706 RefPtr<TestInterfaceEmpty> cppValue(impl->activityLoggingLogPreviousValu eInterfaceAttribute()); |
4707 v8::Handle<v8::Value> originalValue = toV8(cppValue, info.Holder(), info .GetIsolate()); | 4707 v8::Handle<v8::Value> originalValue = toV8(cppValue, scriptState->contex t()->Global(), scriptState->isolate()); |
4708 contextData->activityLogger()->logSetter("TestObject.activityLoggingLogP reviousValueInterfaceAttribute", v8Value, originalValue); | 4708 contextData->activityLogger()->logSetter("TestObject.activityLoggingLogP reviousValueInterfaceAttribute", v8Value, originalValue); |
4709 } | 4709 } |
4710 TestObjectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttri buteSetter(v8Value, info); | 4710 TestObjectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttri buteSetter(v8Value, info); |
4711 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 4711 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
4712 } | 4712 } |
4713 | 4713 |
4714 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info) | 4714 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info) |
4715 { | 4715 { |
4716 v8::Handle<v8::Object> holder = info.Holder(); | 4716 v8::Handle<v8::Object> holder = info.Holder(); |
4717 TestObject* impl = V8TestObject::toNative(holder); | 4717 TestObject* impl = V8TestObject::toNative(holder); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4849 impl->setTestInterfaceWillBeGarbageCollectedOrNullAttribute(WTF::getPtr(cppV alue)); | 4849 impl->setTestInterfaceWillBeGarbageCollectedOrNullAttribute(WTF::getPtr(cppV alue)); |
4850 } | 4850 } |
4851 | 4851 |
4852 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetterCal lback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCal lbackInfo<void>& info) | 4852 static void testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSetterCal lback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCal lbackInfo<void>& info) |
4853 { | 4853 { |
4854 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | 4854 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); |
4855 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttr ibuteSetter(v8Value, info); | 4855 TestObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttr ibuteSetter(v8Value, info); |
4856 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 4856 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |
4857 } | 4857 } |
4858 | 4858 |
4859 static bool readonlyShortAttributeAttributeGetterImplementedInPrivateScript(Loca lFrame* frame, TestObject* holderImpl, int* result) | |
4860 { | |
4861 if (!frame) | |
4862 return false; | |
4863 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); | |
4864 if (context.IsEmpty()) | |
4865 return false; | |
4866 ScriptState* scriptState = ScriptState::from(context); | |
4867 if (!scriptState->executionContext()) | |
4868 return false; | |
4869 | |
4870 ScriptState::Scope scope(scriptState); | |
4871 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | |
4872 | |
4873 // FIXME: Support exceptions thrown from Blink-in-JS. | |
4874 v8::TryCatch block; | |
4875 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "readonlyShortAttribute", holder); | |
4876 if (block.HasCaught()) | |
4877 return false; | |
4878 ExceptionState exceptionState(ExceptionState::ExecutionContext, "readonlySho rtAttribute", "TestObject", scriptState->context()->Global(), scriptState->isola te()); | |
4879 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); | |
4880 if (block.HasCaught()) | |
4881 return false; | |
4882 *result = cppValue; | |
4883 return true; | |
4884 } | |
4885 | |
4886 static void readonlyShortAttributeAttributeGetter(const v8::PropertyCallbackInfo <v8::Value>& info) | |
4887 { | |
4888 v8::Handle<v8::Object> holder = info.Holder(); | |
4889 TestObject* impl = V8TestObject::toNative(holder); | |
4890 int result; | |
4891 if (!readonlyShortAttributeAttributeGetterImplementedInPrivateScript(toFrame IfNotDetached(info.GetIsolate()->GetCurrentContext()), impl, &result)) | |
4892 return; | |
4893 v8SetReturnValueInt(info, result); | |
4894 } | |
4895 | |
4896 static void readonlyShortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
4897 { | |
4898 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
4899 TestObjectV8Internal::readonlyShortAttributeAttributeGetter(info); | |
4900 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
4901 } | |
4902 | |
4903 static bool shortAttributeAttributeGetterImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, int* result) | |
4904 { | |
4905 if (!frame) | |
4906 return false; | |
4907 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); | |
4908 if (context.IsEmpty()) | |
4909 return false; | |
4910 ScriptState* scriptState = ScriptState::from(context); | |
4911 if (!scriptState->executionContext()) | |
4912 return false; | |
4913 | |
4914 ScriptState::Scope scope(scriptState); | |
4915 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | |
4916 | |
4917 // FIXME: Support exceptions thrown from Blink-in-JS. | |
4918 v8::TryCatch block; | |
4919 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "shortAttribute", holder); | |
4920 if (block.HasCaught()) | |
4921 return false; | |
4922 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortAttrib ute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | |
4923 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); | |
4924 if (block.HasCaught()) | |
4925 return false; | |
4926 *result = cppValue; | |
4927 return true; | |
4928 } | |
4929 | |
4930 static bool shortAttributeAttributeSetterImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, int cppValue) | |
4931 { | |
4932 if (!frame) | |
4933 return false; | |
4934 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); | |
4935 if (context.IsEmpty()) | |
4936 return false; | |
4937 ScriptState* scriptState = ScriptState::from(context); | |
4938 if (!scriptState->executionContext()) | |
4939 return false; | |
4940 | |
4941 ScriptState::Scope scope(scriptState); | |
4942 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | |
4943 | |
4944 // FIXME: Support exceptions thrown from Blink-in-JS. | |
4945 v8::TryCatch block; | |
4946 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); | |
4947 if (block.HasCaught()) | |
4948 return false; | |
4949 return true; | |
4950 } | |
4951 | |
4952 static void shortAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info) | |
4953 { | |
4954 v8::Handle<v8::Object> holder = info.Holder(); | |
4955 TestObject* impl = V8TestObject::toNative(holder); | |
4956 int result; | |
4957 if (!shortAttributeAttributeGetterImplementedInPrivateScript(toFrameIfNotDet ached(info.GetIsolate()->GetCurrentContext()), impl, &result)) | |
4958 return; | |
4959 v8SetReturnValueInt(info, result); | |
4960 } | |
4961 | |
4962 static void shortAttributeAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info) | |
4963 { | |
4964 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
4965 TestObjectV8Internal::shortAttributeAttributeGetter(info); | |
4966 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
4967 } | |
4968 | |
4969 static void shortAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::PropertyCallbackInfo<void>& info) | |
4970 { | |
4971 v8::Handle<v8::Object> holder = info.Holder(); | |
4972 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute ", "TestObject", holder, info.GetIsolate()); | |
4973 TestObject* impl = V8TestObject::toNative(holder); | |
4974 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionState) , exceptionState); | |
4975 shortAttributeAttributeSetterImplementedInPrivateScript(toFrameIfNotDetached (info.GetIsolate()->GetCurrentContext()), impl, cppValue); | |
4976 } | |
4977 | |
4978 static void shortAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
4979 { | |
4980 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
4981 TestObjectV8Internal::shortAttributeAttributeSetter(v8Value, info); | |
4982 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
4983 } | |
4984 | |
4985 static bool stringAttributeAttributeGetterImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, String* result) | |
4986 { | |
4987 if (!frame) | |
4988 return false; | |
4989 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); | |
4990 if (context.IsEmpty()) | |
4991 return false; | |
4992 ScriptState* scriptState = ScriptState::from(context); | |
4993 if (!scriptState->executionContext()) | |
4994 return false; | |
4995 | |
4996 ScriptState::Scope scope(scriptState); | |
4997 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | |
4998 | |
4999 // FIXME: Support exceptions thrown from Blink-in-JS. | |
5000 v8::TryCatch block; | |
5001 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "stringAttribute", holder); | |
5002 if (block.HasCaught()) | |
5003 return false; | |
5004 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringAttri bute", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | |
5005 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | |
5006 if (block.HasCaught()) | |
5007 return false; | |
5008 *result = cppValue; | |
5009 return true; | |
5010 } | |
5011 | |
5012 static bool stringAttributeAttributeSetterImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, String cppValue) | |
5013 { | |
5014 if (!frame) | |
5015 return false; | |
5016 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); | |
5017 if (context.IsEmpty()) | |
5018 return false; | |
5019 ScriptState* scriptState = ScriptState::from(context); | |
5020 if (!scriptState->executionContext()) | |
5021 return false; | |
5022 | |
5023 ScriptState::Scope scope(scriptState); | |
5024 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | |
5025 | |
5026 // FIXME: Support exceptions thrown from Blink-in-JS. | |
5027 v8::TryCatch block; | |
5028 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin gAttribute", holder, v8String(scriptState->isolate(), cppValue)); | |
5029 if (block.HasCaught()) | |
5030 return false; | |
5031 return true; | |
5032 } | |
5033 | |
5034 static void stringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info) | |
5035 { | |
5036 v8::Handle<v8::Object> holder = info.Holder(); | |
5037 TestObject* impl = V8TestObject::toNative(holder); | |
5038 String result; | |
5039 if (!stringAttributeAttributeGetterImplementedInPrivateScript(toFrameIfNotDe tached(info.GetIsolate()->GetCurrentContext()), impl, &result)) | |
5040 return; | |
5041 v8SetReturnValueString(info, result, info.GetIsolate()); | |
5042 } | |
5043 | |
5044 static void stringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
5045 { | |
5046 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
5047 TestObjectV8Internal::stringAttributeAttributeGetter(info); | |
5048 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
5049 } | |
5050 | |
5051 static void stringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::PropertyCallbackInfo<void>& info) | |
5052 { | |
5053 v8::Handle<v8::Object> holder = info.Holder(); | |
5054 TestObject* impl = V8TestObject::toNative(holder); | |
5055 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value); | |
5056 stringAttributeAttributeSetterImplementedInPrivateScript(toFrameIfNotDetache d(info.GetIsolate()->GetCurrentContext()), impl, cppValue); | |
5057 } | |
5058 | |
5059 static void stringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
5060 { | |
5061 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
5062 TestObjectV8Internal::stringAttributeAttributeSetter(v8Value, info); | |
5063 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
5064 } | |
5065 | |
5066 static bool nodeAttributeAttributeGetterImplementedInPrivateScript(LocalFrame* f rame, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) | |
5067 { | |
5068 if (!frame) | |
5069 return false; | |
5070 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); | |
5071 if (context.IsEmpty()) | |
5072 return false; | |
5073 ScriptState* scriptState = ScriptState::from(context); | |
5074 if (!scriptState->executionContext()) | |
5075 return false; | |
5076 | |
5077 ScriptState::Scope scope(scriptState); | |
5078 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | |
5079 | |
5080 // FIXME: Support exceptions thrown from Blink-in-JS. | |
5081 v8::TryCatch block; | |
5082 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "nodeAttribute", holder); | |
5083 if (block.HasCaught()) | |
5084 return false; | |
5085 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeAttribu te", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | |
5086 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false); | |
5087 if (block.HasCaught()) | |
5088 return false; | |
5089 *result = cppValue; | |
5090 return true; | |
5091 } | |
5092 | |
5093 static bool nodeAttributeAttributeSetterImplementedInPrivateScript(LocalFrame* f rame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) | |
5094 { | |
5095 if (!frame) | |
5096 return false; | |
5097 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); | |
5098 if (context.IsEmpty()) | |
5099 return false; | |
5100 ScriptState* scriptState = ScriptState::from(context); | |
5101 if (!scriptState->executionContext()) | |
5102 return false; | |
5103 | |
5104 ScriptState::Scope scope(scriptState); | |
5105 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | |
5106 | |
5107 // FIXME: Support exceptions thrown from Blink-in-JS. | |
5108 v8::TryCatch block; | |
5109 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState- >isolate())); | |
5110 if (block.HasCaught()) | |
5111 return false; | |
5112 return true; | |
5113 } | |
5114 | |
5115 static void nodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Valu e>& info) | |
5116 { | |
5117 v8::Handle<v8::Object> holder = info.Holder(); | |
5118 TestObject* impl = V8TestObject::toNative(holder); | |
5119 RefPtrWillBeRawPtr<Node> result; | |
5120 if (!nodeAttributeAttributeGetterImplementedInPrivateScript(toFrameIfNotDeta ched(info.GetIsolate()->GetCurrentContext()), impl, &result)) | |
5121 return; | |
5122 v8SetReturnValueFast(info, WTF::getPtr(result.release()), impl); | |
5123 } | |
5124 | |
5125 static void nodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8 ::PropertyCallbackInfo<v8::Value>& info) | |
5126 { | |
5127 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMGetter"); | |
5128 TestObjectV8Internal::nodeAttributeAttributeGetter(info); | |
5129 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
5130 } | |
5131 | |
5132 static void nodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8: :PropertyCallbackInfo<void>& info) | |
5133 { | |
5134 v8::Handle<v8::Object> holder = info.Holder(); | |
5135 TestObject* impl = V8TestObject::toNative(holder); | |
5136 TONATIVE_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate (), v8Value)); | |
5137 nodeAttributeAttributeSetterImplementedInPrivateScript(toFrameIfNotDetached( info.GetIsolate()->GetCurrentContext()), impl, cppValue); | |
5138 } | |
5139 | |
5140 static void nodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Loca l<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
5141 { | |
5142 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMSetter"); | |
5143 TestObjectV8Internal::nodeAttributeAttributeSetter(v8Value, info); | |
5144 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | |
5145 } | |
5146 | |
4859 static void TestObjectConstructorGetter(v8::Local<v8::String>, const v8::Propert yCallbackInfo<v8::Value>& info) | 5147 static void TestObjectConstructorGetter(v8::Local<v8::String>, const v8::Propert yCallbackInfo<v8::Value>& info) |
4860 { | 5148 { |
4861 v8::Handle<v8::Value> data = info.Data(); | 5149 v8::Handle<v8::Value> data = info.Data(); |
4862 ASSERT(data->IsExternal()); | 5150 ASSERT(data->IsExternal()); |
4863 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext()); | 5151 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre ationContext()); |
4864 if (!perContextData) | 5152 if (!perContextData) |
4865 return; | 5153 return; |
4866 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data))); | 5154 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u nwrap(data))); |
4867 } | 5155 } |
4868 | 5156 |
(...skipping 4860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9729 ScriptState::Scope scope(scriptState); | 10017 ScriptState::Scope scope(scriptState); |
9730 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | 10018 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); |
9731 | 10019 |
9732 v8::Handle<v8::Value> *argv = 0; | 10020 v8::Handle<v8::Value> *argv = 0; |
9733 // FIXME: Support exceptions thrown from Blink-in-JS. | 10021 // FIXME: Support exceptions thrown from Blink-in-JS. |
9734 v8::TryCatch block; | 10022 v8::TryCatch block; |
9735 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); | 10023 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); |
9736 if (block.HasCaught()) | 10024 if (block.HasCaught()) |
9737 return false; | 10025 return false; |
9738 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr iptState->isolate()); | 10026 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr iptState->isolate()); |
9739 int cppValue = toInt16(v8Value, exceptionState); | 10027 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); |
9740 if (block.HasCaught()) | 10028 if (block.HasCaught()) |
9741 return false; | 10029 return false; |
9742 *result = cppValue; | 10030 *result = cppValue; |
9743 return true; | 10031 return true; |
9744 } | 10032 } |
9745 | 10033 |
9746 static void shortMethodImplementedInPrivateScriptMethod(const v8::FunctionCallba ckInfo<v8::Value>& info) | 10034 static void shortMethodImplementedInPrivateScriptMethod(const v8::FunctionCallba ckInfo<v8::Value>& info) |
9747 { | 10035 { |
9748 TestObject* impl = V8TestObject::toNative(info.Holder()); | 10036 TestObject* impl = V8TestObject::toNative(info.Holder()); |
9749 int result; | 10037 int result; |
(...skipping 24 matching lines...) Expand all Loading... | |
9774 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | 10062 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); |
9775 | 10063 |
9776 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); | 10064 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); |
9777 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10065 v8::Handle<v8::Value> argv[] = { valueHandle }; |
9778 // FIXME: Support exceptions thrown from Blink-in-JS. | 10066 // FIXME: Support exceptions thrown from Blink-in-JS. |
9779 v8::TryCatch block; | 10067 v8::TryCatch block; |
9780 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde r, 1, argv); | 10068 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde r, 1, argv); |
9781 if (block.HasCaught()) | 10069 if (block.HasCaught()) |
9782 return false; | 10070 return false; |
9783 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context ()->Global(), scriptState->isolate()); | 10071 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context ()->Global(), scriptState->isolate()); |
9784 int cppValue = toInt16(v8Value, exceptionState); | 10072 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); |
9785 if (block.HasCaught()) | 10073 if (block.HasCaught()) |
9786 return false; | 10074 return false; |
9787 *result = cppValue; | 10075 *result = cppValue; |
9788 return true; | 10076 return true; |
9789 } | 10077 } |
9790 | 10078 |
9791 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v 8::FunctionCallbackInfo<v8::Value>& info) | 10079 static void shortMethodWithShortArgumentImplementedInPrivateScriptMethod(const v 8::FunctionCallbackInfo<v8::Value>& info) |
9792 { | 10080 { |
9793 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", info.Holder(), info. GetIsolate()); | 10081 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", info.Holder(), info. GetIsolate()); |
9794 if (UNLIKELY(info.Length() < 1)) { | 10082 if (UNLIKELY(info.Length() < 1)) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9830 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | 10118 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); |
9831 | 10119 |
9832 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); | 10120 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); |
9833 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10121 v8::Handle<v8::Value> argv[] = { valueHandle }; |
9834 // FIXME: Support exceptions thrown from Blink-in-JS. | 10122 // FIXME: Support exceptions thrown from Blink-in-JS. |
9835 v8::TryCatch block; | 10123 v8::TryCatch block; |
9836 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol der, 1, argv); | 10124 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol der, 1, argv); |
9837 if (block.HasCaught()) | 10125 if (block.HasCaught()) |
9838 return false; | 10126 return false; |
9839 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); | 10127 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); |
9840 V8StringResource<> cppValue = v8Value; | 10128 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
9841 if (block.HasCaught()) | 10129 if (block.HasCaught()) |
9842 return false; | 10130 return false; |
9843 *result = cppValue; | 10131 *result = cppValue; |
9844 return true; | 10132 return true; |
9845 } | 10133 } |
9846 | 10134 |
9847 static void stringMethodWithStringArgumentImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 10135 static void stringMethodWithStringArgumentImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
9848 { | 10136 { |
9849 if (UNLIKELY(info.Length() < 1)) { | 10137 if (UNLIKELY(info.Length() < 1)) { |
9850 throwMinimumArityTypeErrorForMethod("stringMethodWithStringArgumentImple mentedInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()); | 10138 throwMinimumArityTypeErrorForMethod("stringMethodWithStringArgumentImple mentedInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9883 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); | 10171 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); |
9884 | 10172 |
9885 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob al(), scriptState->isolate()); | 10173 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob al(), scriptState->isolate()); |
9886 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10174 v8::Handle<v8::Value> argv[] = { valueHandle }; |
9887 // FIXME: Support exceptions thrown from Blink-in-JS. | 10175 // FIXME: Support exceptions thrown from Blink-in-JS. |
9888 v8::TryCatch block; | 10176 v8::TryCatch block; |
9889 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder, 1, argv); | 10177 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder, 1, argv); |
9890 if (block.HasCaught()) | 10178 if (block.HasCaught()) |
9891 return false; | 10179 return false; |
9892 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context() ->Global(), scriptState->isolate()); | 10180 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context() ->Global(), scriptState->isolate()); |
9893 Node* cppValue = V8Node::toNativeWithTypeCheck(scriptState->isolate(), v8Val ue); | 10181 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false); |
9894 if (block.HasCaught()) | 10182 if (block.HasCaught()) |
9895 return false; | 10183 return false; |
9896 *result = cppValue; | 10184 *result = cppValue; |
9897 return true; | 10185 return true; |
9898 } | 10186 } |
9899 | 10187 |
9900 static void nodeMethodWithNodeArgumentImplementedInPrivateScriptMethod(const v8: :FunctionCallbackInfo<v8::Value>& info) | 10188 static void nodeMethodWithNodeArgumentImplementedInPrivateScriptMethod(const v8: :FunctionCallbackInfo<v8::Value>& info) |
9901 { | 10189 { |
9902 if (UNLIKELY(info.Length() < 1)) { | 10190 if (UNLIKELY(info.Length() < 1)) { |
9903 throwMinimumArityTypeErrorForMethod("nodeMethodWithNodeArgumentImplement edInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()); | 10191 throwMinimumArityTypeErrorForMethod("nodeMethodWithNodeArgumentImplement edInPrivateScript", "TestObject", 1, info.Length(), info.GetIsolate()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9942 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate() , value1); | 10230 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate() , value1); |
9943 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(), value2); | 10231 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(), value2); |
9944 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string ); | 10232 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string ); |
9945 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v alue2Handle, stringHandle }; | 10233 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v alue2Handle, stringHandle }; |
9946 // FIXME: Support exceptions thrown from Blink-in-JS. | 10234 // FIXME: Support exceptions thrown from Blink-in-JS. |
9947 v8::TryCatch block; | 10235 v8::TryCatch block; |
9948 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol der, 5, argv); | 10236 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol der, 5, argv); |
9949 if (block.HasCaught()) | 10237 if (block.HasCaught()) |
9950 return false; | 10238 return false; |
9951 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); | 10239 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); |
9952 Node* cppValue = V8Node::toNativeWithTypeCheck(scriptState->isolate(), v8Val ue); | 10240 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false); |
9953 if (block.HasCaught()) | 10241 if (block.HasCaught()) |
9954 return false; | 10242 return false; |
9955 *result = cppValue; | 10243 *result = cppValue; |
9956 return true; | 10244 return true; |
9957 } | 10245 } |
9958 | 10246 |
9959 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 10247 static void nodeMethodWithVariousArgumentsImplementedInPrivateScriptMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
9960 { | 10248 { |
9961 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", info.Holder(), inf o.GetIsolate()); | 10249 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", info.Holder(), inf o.GetIsolate()); |
9962 if (UNLIKELY(info.Length() < 5)) { | 10250 if (UNLIKELY(info.Length() < 5)) { |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10158 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGett erCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri bute>(v8::None), 0 /* on instance */}, | 10446 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGett erCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri bute>(v8::None), 0 /* on instance */}, |
10159 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGett erCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri bute>(v8::None), 0 /* on instance */}, | 10447 {"urlStringAttribute", TestObjectV8Internal::urlStringAttributeAttributeGett erCallback, TestObjectV8Internal::urlStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri bute>(v8::None), 0 /* on instance */}, |
10160 {"unforgeableLongAttribute", TestObjectV8Internal::unforgeableLongAttributeA ttributeGetterCallback, TestObjectV8Internal::unforgeableLongAttributeAttributeS etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS_OVERWRITING ), static_cast<v8::PropertyAttribute>(v8::DontDelete), 0 /* on instance */}, | 10448 {"unforgeableLongAttribute", TestObjectV8Internal::unforgeableLongAttributeA ttributeGetterCallback, TestObjectV8Internal::unforgeableLongAttributeAttributeS etterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::PROHIBITS_OVERWRITING ), static_cast<v8::PropertyAttribute>(v8::DontDelete), 0 /* on instance */}, |
10161 {"activityLoggingSetterOnlyLogPreviousValueAttribute", TestObjectV8Internal: :activityLoggingSetterOnlyLogPreviousValueAttributeAttributeGetterCallback, Test ObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSet terCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v 8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 10449 {"activityLoggingSetterOnlyLogPreviousValueAttribute", TestObjectV8Internal: :activityLoggingSetterOnlyLogPreviousValueAttributeAttributeGetterCallback, Test ObjectV8Internal::activityLoggingSetterOnlyLogPreviousValueAttributeAttributeSet terCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v 8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
10162 {"activityLoggingLogPreviousValueInterfaceAttribute", TestObjectV8Internal:: activityLoggingLogPreviousValueInterfaceAttributeAttributeGetterCallback, TestOb jectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttributeSetter Callback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8:: PropertyAttribute>(v8::None), 0 /* on instance */}, | 10450 {"activityLoggingLogPreviousValueInterfaceAttribute", TestObjectV8Internal:: activityLoggingLogPreviousValueInterfaceAttributeAttributeGetterCallback, TestOb jectV8Internal::activityLoggingLogPreviousValueInterfaceAttributeAttributeSetter Callback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8:: PropertyAttribute>(v8::None), 0 /* on instance */}, |
10163 {"testInterfaceAttribute", TestObjectV8Internal::testInterfaceAttributeAttri buteGetterCallback, TestObjectV8Internal::testInterfaceAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */}, | 10451 {"testInterfaceAttribute", TestObjectV8Internal::testInterfaceAttributeAttri buteGetterCallback, TestObjectV8Internal::testInterfaceAttributeAttributeSetterC allback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::P ropertyAttribute>(v8::None), 0 /* on instance */}, |
10164 {"testInterfaceGarbageCollectedAttribute", TestObjectV8Internal::testInterfa ceGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Internal::testIn terfaceGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8 ::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 / * on instance */}, | 10452 {"testInterfaceGarbageCollectedAttribute", TestObjectV8Internal::testInterfa ceGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Internal::testIn terfaceGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8 ::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 / * on instance */}, |
10165 {"testInterfaceGarbageCollectedOrNullAttribute", TestObjectV8Internal::testI nterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback, TestObjectV8Inte rnal::testInterfaceGarbageCollectedOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu te>(v8::None), 0 /* on instance */}, | 10453 {"testInterfaceGarbageCollectedOrNullAttribute", TestObjectV8Internal::testI nterfaceGarbageCollectedOrNullAttributeAttributeGetterCallback, TestObjectV8Inte rnal::testInterfaceGarbageCollectedOrNullAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu te>(v8::None), 0 /* on instance */}, |
10166 {"testInterfaceWillBeGarbageCollectedAttribute", TestObjectV8Internal::testI nterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Inte rnal::testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu te>(v8::None), 0 /* on instance */}, | 10454 {"testInterfaceWillBeGarbageCollectedAttribute", TestObjectV8Internal::testI nterfaceWillBeGarbageCollectedAttributeAttributeGetterCallback, TestObjectV8Inte rnal::testInterfaceWillBeGarbageCollectedAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribu te>(v8::None), 0 /* on instance */}, |
10167 {"testInterfaceWillBeGarbageCollectedOrNullAttribute", TestObjectV8Internal: :testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetterCallback, Test ObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSet terCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v 8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 10455 {"testInterfaceWillBeGarbageCollectedOrNullAttribute", TestObjectV8Internal: :testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeGetterCallback, Test ObjectV8Internal::testInterfaceWillBeGarbageCollectedOrNullAttributeAttributeSet terCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v 8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
10456 {"readonlyShortAttribute", TestObjectV8Internal::readonlyShortAttributeAttri buteGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), sta tic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | |
10457 {"shortAttribute", TestObjectV8Internal::shortAttributeAttributeGetterCallba ck, TestObjectV8Internal::shortAttributeAttributeSetterCallback, 0, 0, 0, static _cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::No ne), 0 /* on instance */}, | |
10458 {"stringAttribute", TestObjectV8Internal::stringAttributeAttributeGetterCall back, TestObjectV8Internal::stringAttributeAttributeSetterCallback, 0, 0, 0, sta tic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8: :None), 0 /* on instance */}, | |
10459 {"nodeAttribute", TestObjectV8Internal::nodeAttributeAttributeGetterCallback , TestObjectV8Internal::nodeAttributeAttributeSetterCallback, 0, 0, 0, static_ca st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None) , 0 /* on instance */}, | |
10168 }; | 10460 }; |
10169 | 10461 |
10170 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = { | 10462 static const V8DOMConfiguration::AccessorConfiguration V8TestObjectAccessors[] = { |
10171 {"exposeJSAccessorsLongAttribute", TestObjectV8Internal::exposeJSAccessorsLo ngAttributeAttributeGetterCallback, TestObjectV8Internal::exposeJSAccessorsLongA ttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEF AULT), static_cast<v8::PropertyAttribute>(v8::None)}, | 10463 {"exposeJSAccessorsLongAttribute", TestObjectV8Internal::exposeJSAccessorsLo ngAttributeAttributeGetterCallback, TestObjectV8Internal::exposeJSAccessorsLongA ttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEF AULT), static_cast<v8::PropertyAttribute>(v8::None)}, |
10172 }; | 10464 }; |
10173 | 10465 |
10174 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { | 10466 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { |
10175 {"voidMethod", TestObjectV8Internal::voidMethodMethodCallback, 0, 0}, | 10467 {"voidMethod", TestObjectV8Internal::voidMethodMethodCallback, 0, 0}, |
10176 {"dateMethod", TestObjectV8Internal::dateMethodMethodCallback, 0, 0}, | 10468 {"dateMethod", TestObjectV8Internal::dateMethodMethodCallback, 0, 0}, |
10177 {"stringMethod", TestObjectV8Internal::stringMethodMethodCallback, 0, 0}, | 10469 {"stringMethod", TestObjectV8Internal::stringMethodMethodCallback, 0, 0}, |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10566 fromInternalPointer(object)->deref(); | 10858 fromInternalPointer(object)->deref(); |
10567 } | 10859 } |
10568 | 10860 |
10569 template<> | 10861 template<> |
10570 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea tionContext, v8::Isolate* isolate) | 10862 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea tionContext, v8::Isolate* isolate) |
10571 { | 10863 { |
10572 return toV8(impl, creationContext, isolate); | 10864 return toV8(impl, creationContext, isolate); |
10573 } | 10865 } |
10574 | 10866 |
10575 } // namespace WebCore | 10867 } // namespace WebCore |
OLD | NEW |