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 23 matching lines...) Expand all Loading... |
34 #include "V8TestException.h" | 34 #include "V8TestException.h" |
35 | 35 |
36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
37 #include "bindings/v8/ExceptionMessages.h" | 37 #include "bindings/v8/ExceptionMessages.h" |
38 #include "bindings/v8/V8Binding.h" | 38 #include "bindings/v8/V8Binding.h" |
39 #include "bindings/v8/V8DOMConfiguration.h" | 39 #include "bindings/v8/V8DOMConfiguration.h" |
40 #include "bindings/v8/V8DOMWrapper.h" | 40 #include "bindings/v8/V8DOMWrapper.h" |
41 #include "core/dom/ContextFeatures.h" | 41 #include "core/dom/ContextFeatures.h" |
42 #include "core/dom/Document.h" | 42 #include "core/dom/Document.h" |
43 #include "platform/TraceEvent.h" | 43 #include "platform/TraceEvent.h" |
44 #include "wtf/UnusedParam.h" | |
45 | 44 |
46 namespace WebCore { | 45 namespace WebCore { |
47 | 46 |
48 static void initializeScriptWrappableForInterface(TestException* object) | 47 static void initializeScriptWrappableForInterface(TestException* object) |
49 { | 48 { |
50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 49 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
51 ScriptWrappable::setTypeInfoInObject(object, &V8TestException::wrapperTy
peInfo); | 50 ScriptWrappable::setTypeInfoInObject(object, &V8TestException::wrapperTy
peInfo); |
52 else | 51 else |
53 ASSERT_NOT_REACHED(); | 52 ASSERT_NOT_REACHED(); |
54 } | 53 } |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestExceptionTemplate(v8::Han
dle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldTy
pe currentWorldType) | 92 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestExceptionTemplate(v8::Han
dle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldTy
pe currentWorldType) |
94 { | 93 { |
95 functionTemplate->ReadOnlyPrototype(); | 94 functionTemplate->ReadOnlyPrototype(); |
96 | 95 |
97 v8::Local<v8::Signature> defaultSignature; | 96 v8::Local<v8::Signature> defaultSignature; |
98 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestException", v8::Local<v8::FunctionTemplate>(), V8TestException::intern
alFieldCount, | 97 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestException", v8::Local<v8::FunctionTemplate>(), V8TestException::intern
alFieldCount, |
99 V8TestExceptionAttributes, WTF_ARRAY_LENGTH(V8TestExceptionAttributes), | 98 V8TestExceptionAttributes, WTF_ARRAY_LENGTH(V8TestExceptionAttributes), |
100 0, 0, | 99 0, 0, |
101 0, 0, | 100 0, 0, |
102 isolate, currentWorldType); | 101 isolate, currentWorldType); |
103 UNUSED_PARAM(defaultSignature); | 102 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
104 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 103 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
105 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
106 UNUSED_PARAM(instanceTemplate); | |
107 UNUSED_PARAM(prototypeTemplate); | |
108 | 104 |
109 // Custom toString template | 105 // Custom toString template |
110 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 106 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
111 return functionTemplate; | 107 return functionTemplate; |
112 } | 108 } |
113 | 109 |
114 v8::Handle<v8::FunctionTemplate> V8TestException::GetTemplate(v8::Isolate* isola
te, WrapperWorldType currentWorldType) | 110 v8::Handle<v8::FunctionTemplate> V8TestException::GetTemplate(v8::Isolate* isola
te, WrapperWorldType currentWorldType) |
115 { | 111 { |
116 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 112 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
117 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 113 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 fromInternalPointer(object)->deref(); | 159 fromInternalPointer(object)->deref(); |
164 } | 160 } |
165 | 161 |
166 template<> | 162 template<> |
167 v8::Handle<v8::Value> toV8NoInline(TestException* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 163 v8::Handle<v8::Value> toV8NoInline(TestException* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
168 { | 164 { |
169 return toV8(impl, creationContext, isolate); | 165 return toV8(impl, creationContext, isolate); |
170 } | 166 } |
171 | 167 |
172 } // namespace WebCore | 168 } // namespace WebCore |
OLD | NEW |