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

Side by Side Diff: client/dom/scripts/systemfrog.py

Issue 9453004: Cross frame access tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Final pass of comments, update of status Created 8 years, 10 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 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 # for details. All rights reserved. Use of this source code is governed by a 3 # for details. All rights reserved. Use of this source code is governed by a
4 # BSD-style license that can be found in the LICENSE file. 4 # BSD-style license that can be found in the LICENSE file.
5 5
6 """This module provides shared functionality for the systems to generate 6 """This module provides shared functionality for the systems to generate
7 frog binding from the IDL database.""" 7 frog binding from the IDL database."""
8 8
9 import os 9 import os
10 from generator import * 10 from generator import *
11 from systembase import * 11 from systembase import *
12 12
13 # Members (getters, setters, and methods) to suppress. These are
14 # either removed or custom implemented.
15 _dom_frog_omitted_members = set([
16 # Replace with custom.
17 'HTMLIFrameElement.get:contentWindow',
18
19 # Remove.
20 'HTMLIFrameElement.get:contentDocument',
21 'DOMWindow.get:frameElement',
22 ])
23
13 class FrogSystem(System): 24 class FrogSystem(System):
14 25
15 def __init__(self, templates, database, emitters, output_dir): 26 def __init__(self, templates, database, emitters, output_dir):
16 super(FrogSystem, self).__init__( 27 super(FrogSystem, self).__init__(
17 templates, database, emitters, output_dir) 28 templates, database, emitters, output_dir)
18 self._impl_file_paths = [] 29 self._impl_file_paths = []
19 30
20 def InterfaceGenerator(self, 31 def InterfaceGenerator(self,
21 interface, 32 interface,
22 common_prefix, 33 common_prefix,
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 # Since we are currently generating native classes without interfaces, 184 # Since we are currently generating native classes without interfaces,
174 # generate the constants as part of the class. This will need to go away 185 # generate the constants as part of the class. This will need to go away
175 # if we revert back to generating interfaces. 186 # if we revert back to generating interfaces.
176 self._members_emitter.Emit('\n static final $TYPE $NAME = $VALUE;\n', 187 self._members_emitter.Emit('\n static final $TYPE $NAME = $VALUE;\n',
177 NAME=constant.id, 188 NAME=constant.id,
178 TYPE=constant.type.id, 189 TYPE=constant.type.id,
179 VALUE=constant.value) 190 VALUE=constant.value)
180 191
181 pass 192 pass
182 193
194 def OverrideMember(self, member):
195 return self._interface.id + '.' + member in _dom_frog_omitted_members
196
183 def AddAttribute(self, getter, setter): 197 def AddAttribute(self, getter, setter):
198 if getter and self.OverrideMember('get:' + getter.id):
199 getter = None
200 if setter and self.OverrideMember('set:' + setter.id):
201 setter = None
202 if not getter and not setter:
203 return
204
184 output_type = getter and self._NarrowOutputType(getter.type.id) 205 output_type = getter and self._NarrowOutputType(getter.type.id)
185 input_type = setter and self._NarrowInputType(setter.type.id) 206 input_type = setter and self._NarrowInputType(setter.type.id)
186 207
187 # If the (getter, setter) pair is shadowing, we can't generate a shadowing 208 # If the (getter, setter) pair is shadowing, we can't generate a shadowing
188 # field (Issue 1633). 209 # field (Issue 1633).
189 (super_getter, super_getter_interface) = self._FindShadowedAttribute(getter) 210 (super_getter, super_getter_interface) = self._FindShadowedAttribute(getter)
190 (super_setter, super_setter_interface) = self._FindShadowedAttribute(setter) 211 (super_setter, super_setter_interface) = self._FindShadowedAttribute(setter)
191 if super_getter or super_setter: 212 if super_getter or super_setter:
192 if getter and not setter and super_getter and not super_setter: 213 if getter and not setter and super_getter and not super_setter:
193 if getter.type.id == super_getter.type.id: 214 if getter.type.id == super_getter.type.id:
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 if native_body: 363 if native_body:
343 native_body = " '''" + native_body + "'''" 364 native_body = " '''" + native_body + "'''"
344 365
345 self._members_emitter.Emit( 366 self._members_emitter.Emit(
346 '\n' 367 '\n'
347 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n', 368 ' $TYPE $NAME($PARAMS) native$NATIVESTRING;\n',
348 TYPE=self._NarrowOutputType(info.type_name), 369 TYPE=self._NarrowOutputType(info.type_name),
349 NAME=info.name, 370 NAME=info.name,
350 PARAMS=params, 371 PARAMS=params,
351 NATIVESTRING=native_body) 372 NATIVESTRING=native_body)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698