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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfacePython2.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 "V8TestInterfacePython2.h" 8 #include "V8TestInterfacePython2.h"
35 9
36 #include "RuntimeEnabledFeatures.h" 10 #include "RuntimeEnabledFeatures.h"
37 #include "V8Interface1.h" 11 #include "V8Interface1.h"
38 #include "V8Interface2.h" 12 #include "V8Interface2.h"
39 #include "bindings/v8/ExceptionState.h" 13 #include "bindings/v8/ExceptionState.h"
40 #include "bindings/v8/V8DOMConfiguration.h" 14 #include "bindings/v8/V8DOMConfiguration.h"
41 #include "bindings/v8/V8GCController.h" 15 #include "bindings/v8/V8GCController.h"
(...skipping 12 matching lines...) Expand all
54 static void initializeScriptWrappableForInterface(TestInterfacePython2* object) 28 static void initializeScriptWrappableForInterface(TestInterfacePython2* object)
55 { 29 {
56 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 30 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
57 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython2::wr apperTypeInfo); 31 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython2::wr apperTypeInfo);
58 else 32 else
59 ASSERT_NOT_REACHED(); 33 ASSERT_NOT_REACHED();
60 } 34 }
61 35
62 } // namespace WebCore 36 } // namespace WebCore
63 37
64 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows:
65 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
66 // in the global namespace.
67 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c)
68 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfacePython2* object) 38 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfacePython2* object)
69 { 39 {
70 WebCore::initializeScriptWrappableForInterface(object); 40 WebCore::initializeScriptWrappableForInterface(object);
71 } 41 }
72 42
73 namespace WebCore { 43 namespace WebCore {
74 const WrapperTypeInfo V8TestInterfacePython2::wrapperTypeInfo = { gin::kEmbedder Blink, V8TestInterfacePython2::domTemplate, V8TestInterfacePython2::derefObject, 0, 0, V8TestInterfacePython2::visitDOMWrapper, V8TestInterfacePython2::installP erContextEnabledMethods, 0, WrapperTypeObjectPrototype, false }; 44 const WrapperTypeInfo V8TestInterfacePython2::wrapperTypeInfo = { gin::kEmbedder Blink, V8TestInterfacePython2::domTemplate, V8TestInterfacePython2::derefObject, 0, 0, V8TestInterfacePython2::visitDOMWrapper, V8TestInterfacePython2::installP erContextEnabledMethods, 0, WrapperTypeObjectPrototype, false };
75 45
76 namespace TestInterfacePython2V8Internal { 46 namespace TestInterfacePython2V8Internal {
77 47
78 template <typename T> void V8_USE(T) { } 48 template <typename T> void V8_USE(T) { }
79 49
80 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) 50 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info)
81 { 51 {
52 v8::Isolate* isolate = info.GetIsolate();
82 RefPtr<TestInterfacePython2> impl = TestInterfacePython2::create(); 53 RefPtr<TestInterfacePython2> impl = TestInterfacePython2::create();
83 54
84 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), info.GetIso late()); 55 v8::Handle<v8::Object> wrapper = wrap(impl.get(), info.Holder(), isolate);
85 v8SetReturnValue(info, wrapper); 56 v8SetReturnValue(info, wrapper);
86 } 57 }
87 58
88 } // namespace TestInterfacePython2V8Internal 59 } // namespace TestInterfacePython2V8Internal
89 60
90 void V8TestInterfacePython2::visitDOMWrapper(void* object, const v8::Persistent< v8::Object>& wrapper, v8::Isolate* isolate) 61 void V8TestInterfacePython2::visitDOMWrapper(void* object, const v8::Persistent< v8::Object>& wrapper, v8::Isolate* isolate)
91 { 62 {
92 TestInterfacePython2* impl = fromInternalPointer(object); 63 TestInterfacePython2* impl = fromInternalPointer(object);
93 // The ownerNode() method may return a reference or a pointer. 64 // The ownerNode() method may return a reference or a pointer.
94 if (Node* owner = WTF::getPtr(impl->ownerNode())) { 65 if (Node* owner = WTF::getPtr(impl->ownerNode())) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 fromInternalPointer(object)->deref(); 170 fromInternalPointer(object)->deref();
200 } 171 }
201 172
202 template<> 173 template<>
203 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate) 174 v8::Handle<v8::Value> toV8NoInline(TestInterfacePython2* impl, v8::Handle<v8::Ob ject> creationContext, v8::Isolate* isolate)
204 { 175 {
205 return toV8(impl, creationContext, isolate); 176 return toV8(impl, creationContext, isolate);
206 } 177 }
207 178
208 } // namespace WebCore 179 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterfacePython2.h ('k') | Source/bindings/tests/results/V8TestInterfacePython3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698