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