Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Generator for Pnacl Shim functions that bridges the calling conventions | 6 """Generator for Pnacl Shim functions that bridges the calling conventions |
| 7 between GCC and PNaCl. """ | 7 between GCC and PNaCl. """ |
| 8 | 8 |
| 9 from datetime import datetime | 9 from datetime import datetime |
| 10 import difflib | 10 import difflib |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 | 52 |
| 53 | 53 |
| 54 def InterfaceVersionNeedsWrapping(self, iface, version): | 54 def InterfaceVersionNeedsWrapping(self, iface, version): |
| 55 """Return true if the interface+version has ANY methods that | 55 """Return true if the interface+version has ANY methods that |
| 56 need wrapping. | 56 need wrapping. |
| 57 """ | 57 """ |
| 58 if self._skip_opt: | 58 if self._skip_opt: |
| 59 return True | 59 return True |
| 60 if iface.GetName().endswith('Trusted'): | 60 if iface.GetName().endswith('Trusted'): |
| 61 return False | 61 return False |
| 62 # TODO(dmichael): | |
|
teravest
2014/05/30 20:24:58
nit: Usually the TODO paragraph on the same line a
| |
| 63 # We have no way to wrap PPP_ interfaces without an interface string. If | |
| 64 # any ever need wrapping, we'll need to figure out a way to get the plugin- | |
| 65 # side of the Pepper proxy (within the IRT) to access and use the wrapper. | |
| 66 if iface.GetProperty("no_interface_string"): | |
| 67 return False | |
| 62 for member in iface.GetListOf('Member'): | 68 for member in iface.GetListOf('Member'): |
| 63 release = member.GetRelease(version) | 69 release = member.GetRelease(version) |
| 64 if self.MemberNeedsWrapping(member, release): | 70 if self.MemberNeedsWrapping(member, release): |
| 65 return True | 71 return True |
| 66 return False | 72 return False |
| 67 | 73 |
| 68 | 74 |
| 69 def MemberNeedsWrapping(self, member, release): | 75 def MemberNeedsWrapping(self, member, release): |
| 70 """Return true if a particular member function at a particular | 76 """Return true if a particular member function at a particular |
| 71 release needs wrapping. | 77 release needs wrapping. |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 return TestFiles(filenames, test_releases) | 275 return TestFiles(filenames, test_releases) |
| 270 | 276 |
| 271 # Otherwise, generate the output file (for potential use as golden file). | 277 # Otherwise, generate the output file (for potential use as golden file). |
| 272 ast = ParseFiles(filenames) | 278 ast = ParseFiles(filenames) |
| 273 return pnaclgen.GenerateRange(ast, test_releases, filenames) | 279 return pnaclgen.GenerateRange(ast, test_releases, filenames) |
| 274 | 280 |
| 275 | 281 |
| 276 if __name__ == '__main__': | 282 if __name__ == '__main__': |
| 277 retval = Main(sys.argv[1:]) | 283 retval = Main(sys.argv[1:]) |
| 278 sys.exit(retval) | 284 sys.exit(retval) |
| OLD | NEW |