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

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

Issue 176963017: Remove WrapperWorldType from V8 binding (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 namespace WebCore { 71 namespace WebCore {
72 const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedde rBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::derefObje ct, 0, V8TestInterfaceDocument::toEventTarget, 0, V8TestInterfaceDocument::insta llPerContextEnabledMethods, &V8Document::wrapperTypeInfo, WrapperTypeObjectProto type, false }; 72 const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedde rBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::derefObje ct, 0, V8TestInterfaceDocument::toEventTarget, 0, V8TestInterfaceDocument::insta llPerContextEnabledMethods, &V8Document::wrapperTypeInfo, WrapperTypeObjectProto type, false };
73 73
74 namespace TestInterfaceDocumentV8Internal { 74 namespace TestInterfaceDocumentV8Internal {
75 75
76 template <typename T> void V8_USE(T) { } 76 template <typename T> void V8_USE(T) { }
77 77
78 } // namespace TestInterfaceDocumentV8Internal 78 } // namespace TestInterfaceDocumentV8Internal
79 79
80 static void configureV8TestInterfaceDocumentTemplate(v8::Handle<v8::FunctionTemp late> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) 80 static void configureV8TestInterfaceDocumentTemplate(v8::Handle<v8::FunctionTemp late> functionTemplate, v8::Isolate* isolate)
81 { 81 {
82 functionTemplate->ReadOnlyPrototype(); 82 functionTemplate->ReadOnlyPrototype();
83 83
84 v8::Local<v8::Signature> defaultSignature; 84 v8::Local<v8::Signature> defaultSignature;
85 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceDocument", V8Document::domTemplate(isolate, currentWorldType) , V8TestInterfaceDocument::internalFieldCount, 85 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl ate, "TestInterfaceDocument", V8Document::domTemplate(isolate), V8TestInterfaceD ocument::internalFieldCount,
86 0, 0, 86 0, 0,
87 0, 0, 87 0, 0,
88 0, 0, 88 0, 0,
89 isolate, currentWorldType); 89 isolate);
90 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate(); 90 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla te->InstanceTemplate();
91 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate(); 91 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl ate->PrototypeTemplate();
92 92
93 // Custom toString template 93 // Custom toString template
94 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :current()->toStringTemplate()); 94 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData: :current()->toStringTemplate());
95 } 95 }
96 96
97 v8::Handle<v8::FunctionTemplate> V8TestInterfaceDocument::domTemplate(v8::Isolat e* isolate, WrapperWorldType currentWorldType) 97 v8::Handle<v8::FunctionTemplate> V8TestInterfaceDocument::domTemplate(v8::Isolat e* isolate)
98 { 98 {
99 V8PerIsolateData* data = V8PerIsolateData::from(isolate); 99 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
100 V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWo rldType).find(&wrapperTypeInfo); 100 V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&w rapperTypeInfo);
101 if (result != data->templateMap(currentWorldType).end()) 101 if (result != data->templateMap().end())
102 return result->value.newLocal(isolate); 102 return result->value.newLocal(isolate);
103 103
104 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); 104 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
105 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V 8ObjectConstructor::isValidConstructorMode); 105 v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V 8ObjectConstructor::isValidConstructorMode);
106 configureV8TestInterfaceDocumentTemplate(templ, isolate, currentWorldType); 106 configureV8TestInterfaceDocumentTemplate(templ, isolate);
107 data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v 8::FunctionTemplate>(isolate, templ)); 107 data->templateMap().add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTempl ate>(isolate, templ));
108 return templ; 108 return templ;
109 } 109 }
110 110
111 bool V8TestInterfaceDocument::hasInstance(v8::Handle<v8::Value> jsValue, v8::Iso late* isolate) 111 bool V8TestInterfaceDocument::hasInstance(v8::Handle<v8::Value> jsValue, v8::Iso late* isolate)
112 { 112 {
113 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e); 113 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValu e);
114 } 114 }
115 115
116 v8::Handle<v8::Object> V8TestInterfaceDocument::findInstanceInPrototypeChain(v8: :Handle<v8::Value> jsValue, v8::Isolate* isolate) 116 v8::Handle<v8::Object> V8TestInterfaceDocument::findInstanceInPrototypeChain(v8: :Handle<v8::Value> jsValue, v8::Isolate* isolate)
117 { 117 {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 fromInternalPointer(object)->deref(); 175 fromInternalPointer(object)->deref();
176 } 176 }
177 177
178 template<> 178 template<>
179 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate) 179 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::O bject> creationContext, v8::Isolate* isolate)
180 { 180 {
181 return toV8(impl, creationContext, isolate); 181 return toV8(impl, creationContext, isolate);
182 } 182 }
183 183
184 } // namespace WebCore 184 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfaceDocument.h ('k') | Source/bindings/tests/results/V8TestInterfaceEmpty.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698