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

Side by Side Diff: Source/bindings/templates/interface_base.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
« no previous file with comments | « Source/bindings/templates/interface.cpp ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 {# http://www.chromium.org/blink/coding-style#TOC-License #} 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 /* 2 // Use of this source code is governed by a BSD-style license that can be
3 * Copyright (C) 2013 Google Inc. All rights reserved. 3 // found in the LICENSE file.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following disclaimer
13 * in the documentation and/or other materials provided with the
14 * distribution.
15 * * Neither the name of Google Inc. nor the names of its
16 * contributors may be used to endorse or promote products derived from
17 * this software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31 4
32 {# FIXME: Rename to Python when switch #} 5 // This file has been auto-generated by {{code_generator}}. DO NOT MODIFY!
33 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
34 6
35 #include "config.h" 7 #include "config.h"
36 {% filter conditional(conditional_string) %} 8 {% filter conditional(conditional_string) %}
37 #include "{{v8_class}}.h" 9 #include "{{v8_class}}.h"
38 10
39 {% for filename in cpp_includes if filename != '%s.h' % v8_class %} 11 {% for filename in cpp_includes if filename != '%s.h' % v8_class %}
40 #include "{{filename}}" 12 #include "{{filename}}"
41 {% endfor %} 13 {% endfor %}
42 14
43 namespace WebCore { 15 namespace WebCore {
44 16
45 static void initializeScriptWrappableForInterface({{cpp_class}}* object) 17 static void initializeScriptWrappableForInterface({{cpp_class}}* object)
46 { 18 {
47 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) 19 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
48 ScriptWrappable::setTypeInfoInObject(object, &{{v8_class}}::wrapperTypeI nfo); 20 ScriptWrappable::setTypeInfoInObject(object, &{{v8_class}}::wrapperTypeI nfo);
49 else 21 else
50 ASSERT_NOT_REACHED(); 22 ASSERT_NOT_REACHED();
51 } 23 }
52 24
53 } // namespace WebCore 25 } // namespace WebCore
54 26
55 // In ScriptWrappable::init, the use of a local function declaration has an issu e on Windows: 27 {#
56 // the local declaration does not pick up the surrounding namespace. Therefore, we provide this function 28 In ScriptWrappable::init, the use of a local function declaration has an
57 // in the global namespace. 29 issue on Windows: the local declaration does not pick up the surrounding
58 // (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/fe edback/details/664619/the-namespace-of-local-function-declarations-in-c) 30 namespace. Therefore, we provide this function in the global namespace.
31 More info on the MSVC bug here (Bug 664619):
32 The namespace of local function declarations in C++ by Uray M. János
33 http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace- of-local-function-declarations-in-c
34 #}
59 void webCoreInitializeScriptWrappableForInterface(WebCore::{{cpp_class}}* object ) 35 void webCoreInitializeScriptWrappableForInterface(WebCore::{{cpp_class}}* object )
60 { 36 {
61 WebCore::initializeScriptWrappableForInterface(object); 37 WebCore::initializeScriptWrappableForInterface(object);
62 } 38 }
63 39
64 namespace WebCore { 40 namespace WebCore {
65 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class 41 {% set to_active_dom_object = '%s::toActiveDOMObject' % v8_class
66 if is_active_dom_object else '0' %} 42 if is_active_dom_object else '0' %}
67 {% set to_event_target = '%s::toEventTarget' % v8_class 43 {% set to_event_target = '%s::toEventTarget' % v8_class
68 if is_event_target else '0' %} 44 if is_event_target else '0' %}
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 {% block install_per_context_attributes %}{% endblock %} 146 {% block install_per_context_attributes %}{% endblock %}
171 {% block install_per_context_methods %}{% endblock %} 147 {% block install_per_context_methods %}{% endblock %}
172 {% block to_active_dom_object %}{% endblock %} 148 {% block to_active_dom_object %}{% endblock %}
173 {% block to_event_target %}{% endblock %} 149 {% block to_event_target %}{% endblock %}
174 {% block get_shadow_object_template %}{% endblock %} 150 {% block get_shadow_object_template %}{% endblock %}
175 {% block wrap %}{% endblock %} 151 {% block wrap %}{% endblock %}
176 {% block create_wrapper %}{% endblock %} 152 {% block create_wrapper %}{% endblock %}
177 {% block deref_object_and_to_v8_no_inline %}{% endblock %} 153 {% block deref_object_and_to_v8_no_inline %}{% endblock %}
178 } // namespace WebCore 154 } // namespace WebCore
179 {% endfilter %} 155 {% endfilter %}
OLDNEW
« no previous file with comments | « Source/bindings/templates/interface.cpp ('k') | Source/bindings/templates/methods.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698