| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! |
| 32 | 32 |
| 33 #include "config.h" | 33 #include "config.h" |
| 34 #include "V8TestException.h" | 34 #include "V8TestException.h" |
| 35 | 35 |
| 36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
| 37 #include "bindings/v8/ExceptionState.h" | 37 #include "bindings/v8/ExceptionState.h" |
| 38 #include "bindings/v8/V8DOMConfiguration.h" | 38 #include "bindings/v8/V8DOMConfiguration.h" |
| 39 #include "bindings/v8/V8ObjectConstructor.h" |
| 39 #include "core/dom/ContextFeatures.h" | 40 #include "core/dom/ContextFeatures.h" |
| 40 #include "core/dom/Document.h" | 41 #include "core/dom/Document.h" |
| 41 #include "platform/TraceEvent.h" | 42 #include "platform/TraceEvent.h" |
| 42 | 43 |
| 43 namespace WebCore { | 44 namespace WebCore { |
| 44 | 45 |
| 45 static void initializeScriptWrappableForInterface(TestException* object) | 46 static void initializeScriptWrappableForInterface(TestException* object) |
| 46 { | 47 { |
| 47 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 48 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 48 ScriptWrappable::setTypeInfoInObject(object, &V8TestException::wrapperTy
peInfo); | 49 ScriptWrappable::setTypeInfoInObject(object, &V8TestException::wrapperTy
peInfo); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 108 } | 109 } |
| 109 | 110 |
| 110 } // namespace TestExceptionV8Internal | 111 } // namespace TestExceptionV8Internal |
| 111 | 112 |
| 112 static const V8DOMConfiguration::AttributeConfiguration V8TestExceptionAttribute
s[] = { | 113 static const V8DOMConfiguration::AttributeConfiguration V8TestExceptionAttribute
s[] = { |
| 113 {"readonlyUnsignedShortAttribute", TestExceptionV8Internal::readonlyUnsigned
ShortAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, | 114 {"readonlyUnsignedShortAttribute", TestExceptionV8Internal::readonlyUnsigned
ShortAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, |
| 114 {"readonlyStringAttribute", TestExceptionV8Internal::readonlyStringAttribute
AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 115 {"readonlyStringAttribute", TestExceptionV8Internal::readonlyStringAttribute
AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 115 }; | 116 }; |
| 116 | 117 |
| 117 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestExceptionTemplate(v8::Han
dle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldTy
pe currentWorldType) | 118 static void configureV8TestExceptionTemplate(v8::Handle<v8::FunctionTemplate> fu
nctionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| 118 { | 119 { |
| 119 functionTemplate->ReadOnlyPrototype(); | 120 functionTemplate->ReadOnlyPrototype(); |
| 120 | 121 |
| 121 v8::Local<v8::Signature> defaultSignature; | 122 v8::Local<v8::Signature> defaultSignature; |
| 122 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestException", v8::Local<v8::FunctionTemplate>(), V8TestException::intern
alFieldCount, | 123 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestException", v8::Local<v8::FunctionTemplate>(), V8TestException::intern
alFieldCount, |
| 123 V8TestExceptionAttributes, WTF_ARRAY_LENGTH(V8TestExceptionAttributes), | 124 V8TestExceptionAttributes, WTF_ARRAY_LENGTH(V8TestExceptionAttributes), |
| 124 0, 0, | 125 0, 0, |
| 125 0, 0, | 126 0, 0, |
| 126 isolate, currentWorldType); | 127 isolate, currentWorldType); |
| 127 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 128 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 128 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 129 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 129 static const V8DOMConfiguration::ConstantConfiguration V8TestExceptionConsta
nts[] = { | 130 static const V8DOMConfiguration::ConstantConfiguration V8TestExceptionConsta
nts[] = { |
| 130 {"UNSIGNED_SHORT_CONSTANT", 1}, | 131 {"UNSIGNED_SHORT_CONSTANT", 1}, |
| 131 }; | 132 }; |
| 132 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestExceptionConstants, WTF_ARRAY_LENGTH(V8TestExceptionConstants), isolate); | 133 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestExceptionConstants, WTF_ARRAY_LENGTH(V8TestExceptionConstants), isolate); |
| 133 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Stri
ng::kInternalizedString), v8::FunctionTemplate::New(isolate, TestExceptionV8Inte
rnal::toStringMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v
8::PropertyAttribute>(v8::DontDelete | v8::DontEnum)); | 134 prototypeTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Stri
ng::kInternalizedString), v8::FunctionTemplate::New(isolate, TestExceptionV8Inte
rnal::toStringMethodCallback, v8Undefined(), defaultSignature, 0), static_cast<v
8::PropertyAttribute>(v8::DontDelete | v8::DontEnum)); |
| 134 | 135 |
| 135 // Custom toString template | 136 // Custom toString template |
| 136 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 137 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 137 return functionTemplate; | |
| 138 } | 138 } |
| 139 | 139 |
| 140 v8::Handle<v8::FunctionTemplate> V8TestException::domTemplate(v8::Isolate* isola
te, WrapperWorldType currentWorldType) | 140 v8::Handle<v8::FunctionTemplate> V8TestException::domTemplate(v8::Isolate* isola
te, WrapperWorldType currentWorldType) |
| 141 { | 141 { |
| 142 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 142 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 143 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 143 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| 144 if (result != data->templateMap(currentWorldType).end()) | 144 if (result != data->templateMap(currentWorldType).end()) |
| 145 return result->value.newLocal(isolate); | 145 return result->value.newLocal(isolate); |
| 146 | 146 |
| 147 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 147 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
| 148 v8::EscapableHandleScope handleScope(isolate); | 148 v8::EscapableHandleScope handleScope(isolate); |
| 149 v8::Local<v8::FunctionTemplate> templ = | 149 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V
8ObjectConstructor::isValidConstructorMode); |
| 150 ConfigureV8TestExceptionTemplate(data->rawDOMTemplate(&wrapperTypeInfo,
currentWorldType), isolate, currentWorldType); | 150 configureV8TestExceptionTemplate(templ, isolate, currentWorldType); |
| 151 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); | 151 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v
8::FunctionTemplate>(isolate, templ)); |
| 152 return handleScope.Escape(templ); | 152 return handleScope.Escape(templ); |
| 153 } | 153 } |
| 154 | 154 |
| 155 bool V8TestException::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* is
olate, WrapperWorldType currentWorldType) | 155 bool V8TestException::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* is
olate, WrapperWorldType currentWorldType) |
| 156 { | 156 { |
| 157 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); | 157 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu
e, currentWorldType); |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool V8TestException::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::I
solate* isolate) | 160 bool V8TestException::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::I
solate* isolate) |
| (...skipping 28 matching lines...) Expand all Loading... |
| 189 fromInternalPointer(object)->deref(); | 189 fromInternalPointer(object)->deref(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 template<> | 192 template<> |
| 193 v8::Handle<v8::Value> toV8NoInline(TestException* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 193 v8::Handle<v8::Value> toV8NoInline(TestException* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
| 194 { | 194 { |
| 195 return toV8(impl, creationContext, isolate); | 195 return toV8(impl, creationContext, isolate); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace WebCore | 198 } // namespace WebCore |
| OLD | NEW |