| 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 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 InfoOut.Log("Generating %s for %s" % (out_filename, self.wrapper_prefix)) | 423 InfoOut.Log("Generating %s for %s" % (out_filename, self.wrapper_prefix)) |
| 424 | 424 |
| 425 out = IDLOutFile(out_filename) | 425 out = IDLOutFile(out_filename) |
| 426 | 426 |
| 427 # Get a list of all the interfaces along with metadata. | 427 # Get a list of all the interfaces along with metadata. |
| 428 iface_releases = self.DetermineInterfaces(ast, releases) | 428 iface_releases = self.DetermineInterfaces(ast, releases) |
| 429 | 429 |
| 430 # Generate the includes. | 430 # Generate the includes. |
| 431 self.GenerateIncludes(iface_releases, out) | 431 self.GenerateIncludes(iface_releases, out) |
| 432 | 432 |
| 433 out.Write(self.GetGuardStart()) |
| 434 |
| 433 # Write out static helper functions (mystrcmp). | 435 # Write out static helper functions (mystrcmp). |
| 434 self.GenerateHelperFunctions(out) | 436 self.GenerateHelperFunctions(out) |
| 435 | 437 |
| 436 # Declare list of WrapperInfo before actual wrapper methods, since | 438 # Declare list of WrapperInfo before actual wrapper methods, since |
| 437 # they reference each other. | 439 # they reference each other. |
| 438 self.DeclareWrapperInfos(iface_releases, out) | 440 self.DeclareWrapperInfos(iface_releases, out) |
| 439 | 441 |
| 440 # Generate wrapper functions for each wrapped method in the interfaces. | 442 # Generate wrapper functions for each wrapped method in the interfaces. |
| 441 result = self.GenerateWrapperForMethods(iface_releases) | 443 result = self.GenerateWrapperForMethods(iface_releases) |
| 442 out.Write(result) | 444 out.Write(result) |
| 443 | 445 |
| 444 # Collect all the wrapper functions into interface structs. | 446 # Collect all the wrapper functions into interface structs. |
| 445 self.GenerateWrapperInterfaces(iface_releases, out) | 447 self.GenerateWrapperInterfaces(iface_releases, out) |
| 446 | 448 |
| 447 # Generate a table of the wrapped interface structs that can be looked up. | 449 # Generate a table of the wrapped interface structs that can be looked up. |
| 448 self.GenerateWrapperInfoAndCollection(iface_releases, out) | 450 self.GenerateWrapperInfoAndCollection(iface_releases, out) |
| 449 | 451 |
| 450 # Write out the IDL-invariant functions. | 452 # Write out the IDL-invariant functions. |
| 451 self.GenerateFixedFunctions(out) | 453 self.GenerateFixedFunctions(out) |
| 454 |
| 455 out.Write(self.GetGuardEnd()) |
| 452 out.Close() | 456 out.Close() |
| 453 return 0 | 457 return 0 |
| OLD | NEW |