Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceDoNotCheckConstants.cpp

Issue 104873018: Remove raw DOM templates from V8 bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 "V8TestInterfaceDoNotCheckConstants.h" 34 #include "V8TestInterfaceDoNotCheckConstants.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(TestInterfaceDoNotCheckConstan ts* object) 46 static void initializeScriptWrappableForInterface(TestInterfaceDoNotCheckConstan ts* object)
46 { 47 {
47 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 48 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
48 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceDoNotCheckC onstants::wrapperTypeInfo); 49 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceDoNotCheckC onstants::wrapperTypeInfo);
(...skipping 14 matching lines...) Expand all
63 64
64 namespace WebCore { 65 namespace WebCore {
65 const WrapperTypeInfo V8TestInterfaceDoNotCheckConstants::wrapperTypeInfo = { gi n::kEmbedderBlink, V8TestInterfaceDoNotCheckConstants::domTemplate, V8TestInterf aceDoNotCheckConstants::derefObject, 0, 0, 0, V8TestInterfaceDoNotCheckConstants ::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype }; 66 const WrapperTypeInfo V8TestInterfaceDoNotCheckConstants::wrapperTypeInfo = { gi n::kEmbedderBlink, V8TestInterfaceDoNotCheckConstants::domTemplate, V8TestInterf aceDoNotCheckConstants::derefObject, 0, 0, 0, V8TestInterfaceDoNotCheckConstants ::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
66 67
67 namespace TestInterfaceDoNotCheckConstantsV8Internal { 68 namespace TestInterfaceDoNotCheckConstantsV8Internal {
68 69
69 template <typename T> void V8_USE(T) { } 70 template <typename T> void V8_USE(T) { }
70 71
71 } // namespace TestInterfaceDoNotCheckConstantsV8Internal 72 } // namespace TestInterfaceDoNotCheckConstantsV8Internal
72 73
73 static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceDoNotCheckConsta ntsTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isol ate, WrapperWorldType currentWorldType) 74 static void configureV8TestInterfaceDoNotCheckConstantsTemplate(v8::Handle<v8::F unctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType curren tWorldType)
74 { 75 {
75 functionTemplate->ReadOnlyPrototype(); 76 functionTemplate->ReadOnlyPrototype();
76 77
77 v8::Local<v8::Signature> defaultSignature; 78 v8::Local<v8::Signature> defaultSignature;
78 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceDoNotCheckConstants", v8::Local<v8::FunctionTemplate>(), V8Te stInterfaceDoNotCheckConstants::internalFieldCount, 79 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceDoNotCheckConstants", v8::Local<v8::FunctionTemplate>(), V8Te stInterfaceDoNotCheckConstants::internalFieldCount,
79 0, 0, 80 0, 0,
80 0, 0, 81 0, 0,
81 0, 0, 82 0, 0,
82 isolate, currentWorldType); 83 isolate, currentWorldType);
83 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate(); 84 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate();
84 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate(); 85 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate();
85 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceDoNotC heckConstantsConstants[] = { 86 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceDoNotC heckConstantsConstants[] = {
86 {"CONST_VALUE_0", 0}, 87 {"CONST_VALUE_0", 0},
87 {"CONST_JAVASCRIPT", 1}, 88 {"CONST_JAVASCRIPT", 1},
88 }; 89 };
89 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestInterfaceDoNotCheckConstantsConstants, WTF_ARRAY_LENGTH(V8TestInterfaceDoNot CheckConstantsConstants), isolate); 90 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestInterfaceDoNotCheckConstantsConstants, WTF_ARRAY_LENGTH(V8TestInterfaceDoNot CheckConstantsConstants), isolate);
90 91
91 // Custom toString template 92 // Custom toString template
92 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate()); 93 functionTemplate->Set(v8::String::NewFromUtf8(isolate, "toString", v8::Strin g::kInternalizedString), V8PerIsolateData::current()->toStringTemplate());
93 return functionTemplate;
94 } 94 }
95 95
96 v8::Handle<v8::FunctionTemplate> V8TestInterfaceDoNotCheckConstants::domTemplate (v8::Isolate* isolate, WrapperWorldType currentWorldType) 96 v8::Handle<v8::FunctionTemplate> V8TestInterfaceDoNotCheckConstants::domTemplate (v8::Isolate* isolate, WrapperWorldType currentWorldType)
97 { 97 {
98 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 98 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
99 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo); 99 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo);
100 if (result != data->templateMap(currentWorldType).end()) 100 if (result != data->templateMap(currentWorldType).end())
101 return result->value.newLocal(isolate); 101 return result->value.newLocal(isolate);
102 102
103 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); 103 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
104 v8::EscapableHandleScope handleScope(isolate); 104 v8::EscapableHandleScope handleScope(isolate);
105 v8::Local<v8::FunctionTemplate> templ = 105 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V 8ObjectConstructor::isValidConstructorMode);
106 ConfigureV8TestInterfaceDoNotCheckConstantsTemplate(data->rawDOMTemplate (&wrapperTypeInfo, currentWorldType), isolate, currentWorldType); 106 configureV8TestInterfaceDoNotCheckConstantsTemplate(templ, isolate, currentW orldType);
107 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ)); 107 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ));
108 return handleScope.Escape(templ); 108 return handleScope.Escape(templ);
109 } 109 }
110 110
111 bool V8TestInterfaceDoNotCheckConstants::hasInstance(v8::Handle<v8::Value> jsVal ue, v8::Isolate* isolate, WrapperWorldType currentWorldType) 111 bool V8TestInterfaceDoNotCheckConstants::hasInstance(v8::Handle<v8::Value> jsVal ue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
112 { 112 {
113 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, currentWorldType); 113 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e, currentWorldType);
114 } 114 }
115 115
116 bool V8TestInterfaceDoNotCheckConstants::hasInstanceInAnyWorld(v8::Handle<v8::Va lue> jsValue, v8::Isolate* isolate) 116 bool V8TestInterfaceDoNotCheckConstants::hasInstanceInAnyWorld(v8::Handle<v8::Va lue> jsValue, v8::Isolate* isolate)
(...skipping 28 matching lines...) Expand all
145 fromInternalPointer(object)->deref(); 145 fromInternalPointer(object)->deref();
146 } 146 }
147 147
148 template<> 148 template<>
149 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)
150 { 150 {
151 return toV8(impl, creationContext, isolate); 151 return toV8(impl, creationContext, isolate);
152 } 152 }
153 153
154 } // namespace WebCore 154 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698