| 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 "V8TestInterfaceDoNotCheckConstants.h" | 34 #include "V8TestInterfaceDoNotCheckConstants.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(TestInterfaceDoNotCheckConstan
ts* object) | 47 static void initializeScriptWrappableForInterface(TestInterfaceDoNotCheckConstan
ts* object) |
| 49 { | 48 { |
| 50 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 49 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
| 51 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceDoNotCheckC
onstants::wrapperTypeInfo); | 50 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceDoNotCheckC
onstants::wrapperTypeInfo); |
| 52 else | 51 else |
| 53 ASSERT_NOT_REACHED(); | 52 ASSERT_NOT_REACHED(); |
| 54 } | 53 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 70 namespace TestInterfaceDoNotCheckConstantsV8Internal { | 69 namespace TestInterfaceDoNotCheckConstantsV8Internal { |
| 71 | 70 |
| 72 template <typename T> void V8_USE(T) { } | 71 template <typename T> void V8_USE(T) { } |
| 73 | 72 |
| 74 } // namespace TestInterfaceDoNotCheckConstantsV8Internal | 73 } // namespace TestInterfaceDoNotCheckConstantsV8Internal |
| 75 | 74 |
| 76 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceDoNotCheckConsta
ntsTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isol
ate, WrapperWorldType currentWorldType) | 75 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceDoNotCheckConsta
ntsTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isol
ate, WrapperWorldType currentWorldType) |
| 77 { | 76 { |
| 78 functionTemplate->ReadOnlyPrototype(); | 77 functionTemplate->ReadOnlyPrototype(); |
| 79 | 78 |
| 80 v8::Local<v8::Signature> defaultSignature; | 79 v8::Local<v8::Signature> ALLOW_UNUSED defaultSignature; |
| 81 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceDoNotCheckConstants", v8::Local<v8::FunctionTemplate>(), V8Te
stInterfaceDoNotCheckConstants::internalFieldCount, | 80 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterfaceDoNotCheckConstants", v8::Local<v8::FunctionTemplate>(), V8Te
stInterfaceDoNotCheckConstants::internalFieldCount, |
| 82 0, 0, | 81 0, 0, |
| 83 0, 0, | 82 0, 0, |
| 84 0, 0, | 83 0, 0, |
| 85 isolate, currentWorldType); | 84 isolate, currentWorldType); |
| 86 UNUSED_PARAM(defaultSignature); | 85 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
| 87 v8::Local<v8::ObjectTemplate> instanceTemplate = functionTemplate->InstanceT
emplate(); | 86 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
| 88 v8::Local<v8::ObjectTemplate> prototypeTemplate = functionTemplate->Prototyp
eTemplate(); | |
| 89 UNUSED_PARAM(instanceTemplate); | |
| 90 UNUSED_PARAM(prototypeTemplate); | |
| 91 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceDoNotC
heckConstantsConstants[] = { | 87 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceDoNotC
heckConstantsConstants[] = { |
| 92 {"CONST_VALUE_0", 0}, | 88 {"CONST_VALUE_0", 0}, |
| 93 {"CONST_JAVASCRIPT", 1}, | 89 {"CONST_JAVASCRIPT", 1}, |
| 94 }; | 90 }; |
| 95 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestInterfaceDoNotCheckConstantsConstants, WTF_ARRAY_LENGTH(V8TestInterfaceDoNot
CheckConstantsConstants), isolate); | 91 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestInterfaceDoNotCheckConstantsConstants, WTF_ARRAY_LENGTH(V8TestInterfaceDoNot
CheckConstantsConstants), isolate); |
| 96 | 92 |
| 97 // Custom toString template | 93 // Custom toString template |
| 98 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); | 94 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin
g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); |
| 99 return functionTemplate; | 95 return functionTemplate; |
| 100 } | 96 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 fromInternalPointer(object)->deref(); | 147 fromInternalPointer(object)->deref(); |
| 152 } | 148 } |
| 153 | 149 |
| 154 template<> | 150 template<> |
| 155 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDoNotCheckConstants* impl, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate) | 151 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDoNotCheckConstants* impl, v8::H
andle<v8::Object> creationContext, v8::Isolate* isolate) |
| 156 { | 152 { |
| 157 return toV8(impl, creationContext, isolate); | 153 return toV8(impl, creationContext, isolate); |
| 158 } | 154 } |
| 159 | 155 |
| 160 } // namespace WebCore | 156 } // namespace WebCore |
| OLD | NEW |