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

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

Issue 210663003: Use |isolate| local variable in bindings, clean up comments (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update extension 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 // Copyright 2014 The Chromium Authors. All rights reserved.
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be
3 * 3 // found in the LICENSE file.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30 4
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
32 6
33 #include "config.h" 7 #include "config.h"
34 #include "V8TestObject.h" 8 #include "V8TestObject.h"
35 9
36 #include "HTMLNames.h" 10 #include "HTMLNames.h"
37 #include "RuntimeEnabledFeatures.h" 11 #include "RuntimeEnabledFeatures.h"
38 #include "V8DOMStringList.h" 12 #include "V8DOMStringList.h"
39 #include "V8Document.h" 13 #include "V8Document.h"
40 #include "V8MessagePort.h" 14 #include "V8MessagePort.h"
41 #include "V8Node.h" 15 #include "V8Node.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 static void initializeScriptWrappableForInterface(TestObject* object) 47 static void initializeScriptWrappableForInterface(TestObject* object)
74 { 48 {
75 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 49 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
76 ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeI nfo); 50 ScriptWrappable::setTypeInfoInObject(object, &V8TestObject::wrapperTypeI nfo);
77 else 51 else
78 ASSERT_NOT_REACHED(); 52 ASSERT_NOT_REACHED();
79 } 53 }
80 54
81 } // namespace WebCore 55 } // namespace WebCore
82 56
83 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows:
84 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
85 // in the global namespace.
86 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c)
87 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObject* object) 57 void webCoreInitializeScriptWrappableForInterface(WebCore::TestObject* object)
88 { 58 {
89 WebCore::initializeScriptWrappableForInterface(object); 59 WebCore::initializeScriptWrappableForInterface(object);
90 } 60 }
91 61
92 namespace WebCore { 62 namespace WebCore {
93 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8T estObject::domTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarge t, 0, V8TestObject::installPerContextEnabledMethods, &V8EventTarget::wrapperType Info, WrapperTypeObjectPrototype, false }; 63 const WrapperTypeInfo V8TestObject::wrapperTypeInfo = { gin::kEmbedderBlink, V8T estObject::domTemplate, V8TestObject::derefObject, 0, V8TestObject::toEventTarge t, 0, V8TestObject::installPerContextEnabledMethods, &V8EventTarget::wrapperType Info, WrapperTypeObjectPrototype, false };
94 64
95 namespace TestObjectV8Internal { 65 namespace TestObjectV8Internal {
96 66
(...skipping 5127 matching lines...) Expand 10 before | Expand all | Expand 10 after
5224 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info) 5194 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info)
5225 { 5195 {
5226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 5196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5227 TestObjectV8Internal::namedPropertyQuery(name, info); 5197 TestObjectV8Internal::namedPropertyQuery(name, info);
5228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5198 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5229 } 5199 }
5230 5200
5231 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 5201 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
5232 { 5202 {
5233 TestObject* impl = V8TestObject::toNative(info.Holder()); 5203 TestObject* impl = V8TestObject::toNative(info.Holder());
5204 v8::Isolate* isolate = info.GetIsolate();
5234 Vector<String> names; 5205 Vector<String> names;
5235 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestObjec t", info.Holder(), info.GetIsolate()); 5206 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestObjec t", info.Holder(), isolate);
5236 impl->namedPropertyEnumerator(names, exceptionState); 5207 impl->namedPropertyEnumerator(names, exceptionState);
5237 if (exceptionState.throwIfNeeded()) 5208 if (exceptionState.throwIfNeeded())
5238 return; 5209 return;
5239 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ()); 5210 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size());
5240 for (size_t i = 0; i < names.size(); ++i) 5211 for (size_t i = 0; i < names.size(); ++i)
5241 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i])); 5212 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i]));
5242 v8SetReturnValue(info, v8names); 5213 v8SetReturnValue(info, v8names);
5243 } 5214 }
5244 5215
5245 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 5216 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
5246 { 5217 {
5247 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 5218 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5248 TestObjectV8Internal::namedPropertyEnumerator(info); 5219 TestObjectV8Internal::namedPropertyEnumerator(info);
5249 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 5220 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
5250 } 5221 }
5251 5222
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
5571 fromInternalPointer(object)->deref(); 5542 fromInternalPointer(object)->deref();
5572 } 5543 }
5573 5544
5574 template<> 5545 template<>
5575 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea tionContext, v8::Isolate* isolate) 5546 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea tionContext, v8::Isolate* isolate)
5576 { 5547 {
5577 return toV8(impl, creationContext, isolate); 5548 return toV8(impl, creationContext, isolate);
5578 } 5549 }
5579 5550
5580 } // namespace WebCore 5551 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestObject.h ('k') | Source/bindings/tests/results/V8TestObjectPython.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698