| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 """Base class for generating wrapper functions for PPAPI methods. | 5 """Base class for generating wrapper functions for PPAPI methods. |
| 6 """ | 6 """ |
| 7 | 7 |
| 8 from datetime import datetime | 8 from datetime import datetime |
| 9 import os | 9 import os |
| 10 import sys | 10 import sys |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 out.Write(' ' + ',\n '.join(methods) + '\n') | 342 out.Write(' ' + ',\n '.join(methods) + '\n') |
| 343 out.Write('};\n\n') | 343 out.Write('};\n\n') |
| 344 | 344 |
| 345 | 345 |
| 346 def GetWrapperInfoName(self, iface): | 346 def GetWrapperInfoName(self, iface): |
| 347 return '%s_WrapperInfo_%s' % (self.wrapper_prefix, iface.struct_name) | 347 return '%s_WrapperInfo_%s' % (self.wrapper_prefix, iface.struct_name) |
| 348 | 348 |
| 349 | 349 |
| 350 def GenerateWrapperInfoAndCollection(self, iface_releases, out): | 350 def GenerateWrapperInfoAndCollection(self, iface_releases, out): |
| 351 for iface in iface_releases: | 351 for iface in iface_releases: |
| 352 iface_macro = self.cgen.GetInterfaceMacro(iface.node, iface.version) | 352 iface_macro = "NULL" |
| 353 if not iface.node.GetProperty("no_interface_string"): |
| 354 iface_macro = self.cgen.GetInterfaceMacro(iface.node, iface.version) |
| 353 if iface.needs_wrapping: | 355 if iface.needs_wrapping: |
| 354 wrap_iface = '(const void *) &%s_Wrappers_%s' % (self.wrapper_prefix, | 356 wrap_iface = '(const void *) &%s_Wrappers_%s' % (self.wrapper_prefix, |
| 355 iface.struct_name) | 357 iface.struct_name) |
| 356 out.Write("""static struct %s %s = { | 358 out.Write("""static struct %s %s = { |
| 357 .iface_macro = %s, | 359 .iface_macro = %s, |
| 358 .wrapped_iface = %s, | 360 .wrapped_iface = %s, |
| 359 .real_iface = NULL | 361 .real_iface = NULL |
| 360 };\n\n""" % (self.GetWrapperMetadataName(), | 362 };\n\n""" % (self.GetWrapperMetadataName(), |
| 361 self.GetWrapperInfoName(iface), | 363 self.GetWrapperInfoName(iface), |
| 362 iface_macro, | 364 iface_macro, |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 self.GenerateWrapperInterfaces(iface_releases, out) | 431 self.GenerateWrapperInterfaces(iface_releases, out) |
| 430 | 432 |
| 431 # Generate a table of the wrapped interface structs that can be looked up. | 433 # Generate a table of the wrapped interface structs that can be looked up. |
| 432 self.GenerateWrapperInfoAndCollection(iface_releases, out) | 434 self.GenerateWrapperInfoAndCollection(iface_releases, out) |
| 433 | 435 |
| 434 # Write out the IDL-invariant functions. | 436 # Write out the IDL-invariant functions. |
| 435 self.GenerateFixedFunctions(out) | 437 self.GenerateFixedFunctions(out) |
| 436 | 438 |
| 437 out.Close() | 439 out.Close() |
| 438 return 0 | 440 return 0 |
| OLD | NEW |