 Chromium Code Reviews
 Chromium Code Reviews Issue 807263007:
  IDL: Add forEach() method to iterable<>/maplike<>/setlike<> interfaces  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 807263007:
  IDL: Add forEach() method to iterable<>/maplike<>/setlike<> interfaces  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 1 # Copyright (C) 2013 Google Inc. All rights reserved. | 
| 2 # | 2 # | 
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without | 
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are | 
| 5 # met: | 5 # met: | 
| 6 # | 6 # | 
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright | 
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. | 
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above | 
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer | 
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 | 194 | 
| 195 | 195 | 
| 196 # [CallWith] | 196 # [CallWith] | 
| 197 CALL_WITH_ARGUMENTS = { | 197 CALL_WITH_ARGUMENTS = { | 
| 198 'ScriptState': 'scriptState', | 198 'ScriptState': 'scriptState', | 
| 199 'ExecutionContext': 'executionContext', | 199 'ExecutionContext': 'executionContext', | 
| 200 'ScriptArguments': 'scriptArguments.release()', | 200 'ScriptArguments': 'scriptArguments.release()', | 
| 201 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', | 201 'ActiveWindow': 'callingDOMWindow(info.GetIsolate())', | 
| 202 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', | 202 'FirstWindow': 'enteredDOMWindow(info.GetIsolate())', | 
| 203 'Document': 'document', | 203 'Document': 'document', | 
| 204 'ThisValue': 'ScriptValue(scriptState, info.This())', | |
| 
haraken
2015/01/27 01:56:30
Just to confirm: Are you sure that we should use i
 
Jens Widell
2015/01/27 07:19:23
No, I'm not sure. What's the difference between th
 
haraken
2015/01/27 08:47:11
info.Holder() points to a reciever, and info.This(
 | |
| 204 } | 205 } | 
| 205 # List because key order matters, as we want arguments in deterministic order | 206 # List because key order matters, as we want arguments in deterministic order | 
| 206 CALL_WITH_VALUES = [ | 207 CALL_WITH_VALUES = [ | 
| 207 'ScriptState', | 208 'ScriptState', | 
| 208 'ExecutionContext', | 209 'ExecutionContext', | 
| 209 'ScriptArguments', | 210 'ScriptArguments', | 
| 210 'ActiveWindow', | 211 'ActiveWindow', | 
| 211 'FirstWindow', | 212 'FirstWindow', | 
| 212 'Document', | 213 'Document', | 
| 214 'ThisValue', | |
| 213 ] | 215 ] | 
| 214 | 216 | 
| 215 | 217 | 
| 216 def call_with_arguments(call_with_values): | 218 def call_with_arguments(call_with_values): | 
| 217 if not call_with_values: | 219 if not call_with_values: | 
| 218 return [] | 220 return [] | 
| 219 return [CALL_WITH_ARGUMENTS[value] | 221 return [CALL_WITH_ARGUMENTS[value] | 
| 220 for value in CALL_WITH_VALUES | 222 for value in CALL_WITH_VALUES | 
| 221 if extended_attribute_value_contains(call_with_values, value)] | 223 if extended_attribute_value_contains(call_with_values, value)] | 
| 222 | 224 | 
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 | 392 | 
| 391 The returned function checks if a method/attribute is enabled. | 393 The returned function checks if a method/attribute is enabled. | 
| 392 Given extended attribute RuntimeEnabled=FeatureName, return: | 394 Given extended attribute RuntimeEnabled=FeatureName, return: | 
| 393 RuntimeEnabledFeatures::{featureName}Enabled | 395 RuntimeEnabledFeatures::{featureName}Enabled | 
| 394 """ | 396 """ | 
| 395 extended_attributes = definition_or_member.extended_attributes | 397 extended_attributes = definition_or_member.extended_attributes | 
| 396 if 'RuntimeEnabled' not in extended_attributes: | 398 if 'RuntimeEnabled' not in extended_attributes: | 
| 397 return None | 399 return None | 
| 398 feature_name = extended_attributes['RuntimeEnabled'] | 400 feature_name = extended_attributes['RuntimeEnabled'] | 
| 399 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 401 return 'RuntimeEnabledFeatures::%sEnabled' % uncapitalize(feature_name) | 
| OLD | NEW |