| 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 #include "RuntimeEnabledFeatures.h" | 36 #include "RuntimeEnabledFeatures.h" |
| 37 #include "V8Event.h" | 37 #include "V8Event.h" |
| 38 #include "bindings/v8/ExceptionMessages.h" | 38 #include "bindings/v8/ExceptionMessages.h" |
| 39 #include "bindings/v8/V8Binding.h" | 39 #include "bindings/v8/V8Binding.h" |
| 40 #include "bindings/v8/V8DOMConfiguration.h" | 40 #include "bindings/v8/V8DOMConfiguration.h" |
| 41 #include "bindings/v8/V8DOMWrapper.h" | 41 #include "bindings/v8/V8DOMWrapper.h" |
| 42 #include "core/dom/ContextFeatures.h" | 42 #include "core/dom/ContextFeatures.h" |
| 43 #include "core/dom/Document.h" | 43 #include "core/dom/Document.h" |
| 44 #include "platform/TraceEvent.h" | 44 #include "platform/TraceEvent.h" |
| 45 #include "wtf/UnusedParam.h" | |
| 46 | 45 |
| 47 namespace WebCore { | 46 namespace WebCore { |
| 48 | 47 |
| 49 static void initializeScriptWrappableForInterface(TestEvent* object) | 48 static void initializeScriptWrappableForInterface(TestEvent* object) |
| 50 { | 49 { |
| 51 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 52 ScriptWrappable::setTypeInfoInObject(object, &V8TestEvent::wrapperTypeIn
fo); | 51 ScriptWrappable::setTypeInfoInObject(object, &V8TestEvent::wrapperTypeIn
fo); |
| 53 else | 52 else |
| 54 ASSERT_NOT_REACHED(); | 53 ASSERT_NOT_REACHED(); |
| 55 } | 54 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 71 namespace TestEventV8Internal { | 70 namespace TestEventV8Internal { |
| 72 | 71 |
| 73 template <typename T> void V8_USE(T) { } | 72 template <typename T> void V8_USE(T) { } |
| 74 | 73 |
| 75 } // namespace TestEventV8Internal | 74 } // namespace TestEventV8Internal |
| 76 | 75 |
| 77 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestEventTemplate(v8::Handle<
v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType c
urrentWorldType) | 76 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestEventTemplate(v8::Handle<
v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType c
urrentWorldType) |
| 78 { | 77 { |
| 79 functionTemplate->ReadOnlyPrototype(); | 78 functionTemplate->ReadOnlyPrototype(); |
| 80 | 79 |
| 81 v8::Local<v8::Signature> defaultSignature; | 80 v8::Local<v8::Signature> ALLOW_UNUSED defaultSignature; |
| 82 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestEvent", V8Event::GetTemplate(isolate, currentWorldType), V8TestEvent::
internalFieldCount, | 81 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestEvent", V8Event::GetTemplate(isolate, currentWorldType), V8TestEvent::
internalFieldCount, |
| 83 0, 0, | 82 0, 0, |
| 84 0, 0, | 83 0, 0, |
| 85 0, 0, | 84 0, 0, |
| 86 isolate, currentWorldType); | 85 isolate, currentWorldType); |
| 87 UNUSED_PARAM(defaultSignature); | 86 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 88 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 87 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 89 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
| 90 UNUSED_PARAM(instanceTemplate); | |
| 91 UNUSED_PARAM(prototypeTemplate); | |
| 92 | 88 |
| 93 // Custom toString template | 89 // Custom toString template |
| 94 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 90 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 95 return functionTemplate; | 91 return functionTemplate; |
| 96 } | 92 } |
| 97 | 93 |
| 98 v8::Handle<v8::FunctionTemplate> V8TestEvent::GetTemplate(v8::Isolate* isolate,
WrapperWorldType currentWorldType) | 94 v8::Handle<v8::FunctionTemplate> V8TestEvent::GetTemplate(v8::Isolate* isolate,
WrapperWorldType currentWorldType) |
| 99 { | 95 { |
| 100 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 96 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
| 101 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); | 97 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo
rldType).find(&wrapperTypeInfo); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 fromInternalPointer(object)->deref(); | 143 fromInternalPointer(object)->deref(); |
| 148 } | 144 } |
| 149 | 145 |
| 150 template<> | 146 template<> |
| 151 v8::Handle<v8::Value> toV8NoInline(TestEvent* impl, v8::Handle<v8::Object> creat
ionContext, v8::Isolate* isolate) | 147 v8::Handle<v8::Value> toV8NoInline(TestEvent* impl, v8::Handle<v8::Object> creat
ionContext, v8::Isolate* isolate) |
| 152 { | 148 { |
| 153 return toV8(impl, creationContext, isolate); | 149 return toV8(impl, creationContext, isolate); |
| 154 } | 150 } |
| 155 | 151 |
| 156 } // namespace WebCore | 152 } // namespace WebCore |
| OLD | NEW |