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

Side by Side Diff: mojo/public/tools/bindings/pylib/mojom/generate/module.py

Issue 605443002: The default value for NullableString should be null (was "") (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing types, renamed test functions and struct types Created 6 years, 2 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
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_js_generator.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # This module's classes provide an interface to mojo modules. Modules are 5 # This module's classes provide an interface to mojo modules. Modules are
6 # collections of interfaces and structs to be used by mojo ipc clients and 6 # collections of interfaces and structs to be used by mojo ipc clients and
7 # servers. 7 # servers.
8 # 8 #
9 # A simple interface would be created this way: 9 # A simple interface would be created this way:
10 # module = mojom.generate.module.Module('Foo') 10 # module = mojom.generate.module.Module('Foo')
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 def AddStruct(self, name): 327 def AddStruct(self, name):
328 struct=Struct(name, module=self) 328 struct=Struct(name, module=self)
329 self.structs.append(struct) 329 self.structs.append(struct)
330 return struct 330 return struct
331 331
332 332
333 def IsBoolKind(kind): 333 def IsBoolKind(kind):
334 return kind.spec == BOOL.spec 334 return kind.spec == BOOL.spec
335 335
336 336
337 def IsFloatKind(kind):
338 return kind.spec == FLOAT.spec
339
340
337 def IsStringKind(kind): 341 def IsStringKind(kind):
338 return kind.spec == STRING.spec or kind.spec == NULLABLE_STRING.spec 342 return kind.spec == STRING.spec or kind.spec == NULLABLE_STRING.spec
339 343
340 344
341 def IsHandleKind(kind): 345 def IsHandleKind(kind):
342 return kind.spec == HANDLE.spec or kind.spec == NULLABLE_HANDLE.spec 346 return kind.spec == HANDLE.spec or kind.spec == NULLABLE_HANDLE.spec
343 347
344 348
345 def IsDataPipeConsumerKind(kind): 349 def IsDataPipeConsumerKind(kind):
346 return kind.spec == DCPIPE.spec or kind.spec == NULLABLE_DCPIPE.spec 350 return kind.spec == DCPIPE.spec or kind.spec == NULLABLE_DCPIPE.spec
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 def IsMoveOnlyKind(kind): 420 def IsMoveOnlyKind(kind):
417 return IsObjectKind(kind) or IsAnyHandleKind(kind) 421 return IsObjectKind(kind) or IsAnyHandleKind(kind)
418 422
419 423
420 def HasCallbacks(interface): 424 def HasCallbacks(interface):
421 for method in interface.methods: 425 for method in interface.methods:
422 if method.response_parameters != None: 426 if method.response_parameters != None:
423 return True 427 return True
424 return False 428 return False
425 429
OLDNEW
« no previous file with comments | « mojo/public/tools/bindings/generators/mojom_js_generator.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698