| OLD | NEW |
| 1 /* | 1 /* |
| 2 This file is part of the Blink open source project. | 2 This file is part of the Blink open source project. |
| 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! | 3 This file has been auto-generated by CodeGeneratorV8.pm. DO NOT MODIFY! |
| 4 | 4 |
| 5 This library is free software; you can redistribute it and/or | 5 This library is free software; you can redistribute it and/or |
| 6 modify it under the terms of the GNU Library General Public | 6 modify it under the terms of the GNU Library General Public |
| 7 License as published by the Free Software Foundation; either | 7 License as published by the Free Software Foundation; either |
| 8 version 2 of the License, or (at your option) any later version. | 8 version 2 of the License, or (at your option) any later version. |
| 9 | 9 |
| 10 This library is distributed in the hope that it will be useful, | 10 This library is distributed in the hope that it will be useful, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "core/dom/ContextFeatures.h" | 29 #include "core/dom/ContextFeatures.h" |
| 30 #include "core/dom/Document.h" | 30 #include "core/dom/Document.h" |
| 31 #include "platform/TraceEvent.h" | 31 #include "platform/TraceEvent.h" |
| 32 #include "wtf/UnusedParam.h" | 32 #include "wtf/UnusedParam.h" |
| 33 | 33 |
| 34 namespace WebCore { | 34 namespace WebCore { |
| 35 | 35 |
| 36 static void initializeScriptWrappableForInterface(TestException* object) | 36 static void initializeScriptWrappableForInterface(TestException* object) |
| 37 { | 37 { |
| 38 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 38 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 39 ScriptWrappable::setTypeInfoInObject(object, &V8TestException::info); | 39 ScriptWrappable::setTypeInfoInObject(object, &V8TestException::wrapperTy
peInfo); |
| 40 else | 40 else |
| 41 ASSERT_NOT_REACHED(); | 41 ASSERT_NOT_REACHED(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 } // namespace WebCore | 44 } // namespace WebCore |
| 45 | 45 |
| 46 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: | 46 // In ScriptWrappable::init, the use of a local function declaration has an issu
e on Windows: |
| 47 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function | 47 // the local declaration does not pick up the surrounding namespace. Therefore,
we provide this function |
| 48 // in the global namespace. | 48 // in the global namespace. |
| 49 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) | 49 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe
edback/details/664619/the-namespace-of-local-function-declarations-in-c) |
| 50 void webCoreInitializeScriptWrappableForInterface(WebCore::TestException* object
) | 50 void webCoreInitializeScriptWrappableForInterface(WebCore::TestException* object
) |
| 51 { | 51 { |
| 52 WebCore::initializeScriptWrappableForInterface(object); | 52 WebCore::initializeScriptWrappableForInterface(object); |
| 53 } | 53 } |
| 54 | 54 |
| 55 namespace WebCore { | 55 namespace WebCore { |
| 56 WrapperTypeInfo V8TestException::info = { V8TestException::GetTemplate, V8TestEx
ception::derefObject, 0, 0, 0, V8TestException::installPerContextEnabledPrototyp
eProperties, 0, WrapperTypeErrorPrototype }; | 56 WrapperTypeInfo V8TestException::wrapperTypeInfo = { V8TestException::GetTemplat
e, V8TestException::derefObject, 0, 0, 0, V8TestException::installPerContextEnab
ledPrototypeProperties, 0, WrapperTypeErrorPrototype }; |
| 57 | 57 |
| 58 namespace TestExceptionV8Internal { | 58 namespace TestExceptionV8Internal { |
| 59 | 59 |
| 60 template <typename T> void V8_USE(T) { } | 60 template <typename T> void V8_USE(T) { } |
| 61 | 61 |
| 62 static void nameAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 62 static void nameAttributeGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
| 63 { | 63 { |
| 64 TestException* imp = V8TestException::toNative(info.Holder()); | 64 TestException* imp = V8TestException::toNative(info.Holder()); |
| 65 v8SetReturnValueString(info, imp->name(), info.GetIsolate()); | 65 v8SetReturnValueString(info, imp->name(), info.GetIsolate()); |
| 66 } | 66 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 89 UNUSED_PARAM(defaultSignature); | 89 UNUSED_PARAM(defaultSignature); |
| 90 | 90 |
| 91 // Custom toString template | 91 // Custom toString template |
| 92 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); | 92 desc->Set(v8::String::NewSymbol("toString"), V8PerIsolateData::current()->to
StringTemplate()); |
| 93 return desc; | 93 return desc; |
| 94 } | 94 } |
| 95 | 95 |
| 96 v8::Handle<v8::FunctionTemplate> V8TestException::GetTemplate(v8::Isolate* isola
te, WrapperWorldType currentWorldType) | 96 v8::Handle<v8::FunctionTemplate> V8TestException::GetTemplate(v8::Isolate* isola
te, WrapperWorldType currentWorldType) |
| 97 { | 97 { |
| 98 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 98 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 99 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&info); | 99 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| 100 if (result != data->templateMap(currentWorldType).end()) | 100 if (result != data->templateMap(currentWorldType).end()) |
| 101 return result->value.newLocal(isolate); | 101 return result->value.newLocal(isolate); |
| 102 | 102 |
| 103 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 103 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 104 v8::HandleScope handleScope(isolate); | 104 v8::HandleScope handleScope(isolate); |
| 105 v8::Handle<v8::FunctionTemplate> templ = | 105 v8::Handle<v8::FunctionTemplate> templ = |
| 106 ConfigureV8TestExceptionTemplate(data->rawTemplate(&info, currentWorldTy
pe), isolate, currentWorldType); | 106 ConfigureV8TestExceptionTemplate(data->rawTemplate(&wrapperTypeInfo, cur
rentWorldType), isolate, currentWorldType); |
| 107 data->templateMap(currentWorldType).add(&info, UnsafePersistent<v8::Function
Template>(isolate, templ)); | 107 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 108 return handleScope.Close(templ); | 108 return handleScope.Close(templ); |
| 109 } | 109 } |
| 110 | 110 |
| 111 bool V8TestException::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* is
olate, WrapperWorldType currentWorldType) | 111 bool V8TestException::HasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* is
olate, WrapperWorldType currentWorldType) |
| 112 { | 112 { |
| 113 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, currentW
orldType); | 113 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
| 114 } | 114 } |
| 115 | 115 |
| 116 bool V8TestException::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::I
solate* isolate) | 116 bool V8TestException::HasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::I
solate* isolate) |
| 117 { | 117 { |
| 118 return V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, MainWorl
d) | 118 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, MainWorld) |
| 119 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, Isolated
World) | 119 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, IsolatedWorld) |
| 120 || V8PerIsolateData::from(isolate)->hasInstance(&info, jsValue, WorkerWo
rld); | 120 || V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, WorkerWorld); |
| 121 } | 121 } |
| 122 | 122 |
| 123 v8::Handle<v8::Object> V8TestException::createWrapper(PassRefPtr<TestException>
impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) | 123 v8::Handle<v8::Object> V8TestException::createWrapper(PassRefPtr<TestException>
impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 124 { | 124 { |
| 125 ASSERT(impl); | 125 ASSERT(impl); |
| 126 ASSERT(!DOMDataStore::containsWrapper<V8TestException>(impl.get(), isolate))
; | 126 ASSERT(!DOMDataStore::containsWrapper<V8TestException>(impl.get(), isolate))
; |
| 127 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { | 127 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 128 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); | 128 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 129 // Might be a XXXConstructor::info instead of an XXX::info. These will b
oth have | 129 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 130 // the same object de-ref functions, though, so use that as the basis of
the check. | 130 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 131 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== info.derefObjectFunction); | 131 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
| 132 } | 132 } |
| 133 | 133 |
| 134 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &info, toInternalPointer(impl.get()), isolate); | 134 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
| 135 if (UNLIKELY(wrapper.IsEmpty())) | 135 if (UNLIKELY(wrapper.IsEmpty())) |
| 136 return wrapper; | 136 return wrapper; |
| 137 | 137 |
| 138 installPerContextEnabledProperties(wrapper, impl.get(), isolate); | 138 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
| 139 V8DOMWrapper::associateObjectWithWrapper<V8TestException>(impl, &info, wrapp
er, isolate, WrapperConfiguration::Independent); | 139 V8DOMWrapper::associateObjectWithWrapper<V8TestException>(impl, &wrapperType
Info, wrapper, isolate, WrapperConfiguration::Independent); |
| 140 return wrapper; | 140 return wrapper; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void V8TestException::derefObject(void* object) | 143 void V8TestException::derefObject(void* object) |
| 144 { | 144 { |
| 145 fromInternalPointer(object)->deref(); | 145 fromInternalPointer(object)->deref(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 } // namespace WebCore | 148 } // namespace WebCore |
| OLD | NEW |