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

Issue 8568025: Pnacl ppapi shim generator (from IDL), based on Noel's first cut. (Closed)

Created:
9 years, 1 month ago by jvoung - send to chromium...
Modified:
9 years ago
CC:
chromium-reviews
Visibility:
Public.

Description

Pnacl ppapi shim generator (from IDL), based on Noel's first cut. BUG= http://code.google.com/p/nativeclient/issues/detail?id=2413 TEST= python idl_gen_pnacl.py --test --wnone Also ** ./generator.py doesn't change ** ./generator.py --wnone --pnacl --pnaclshim=pnacl_shim.c generates a shim that compiles and works in the NaCl repo. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=112244

Patch Set 1 #

Total comments: 4

Patch Set 2 : Add consts where needed to compile. Add headers. Etc. #

Patch Set 3 : more cleanup #

Patch Set 4 : Add dummy var for whether or not interface was wrapped. #

Patch Set 5 : Add code to skip wrapping #

Total comments: 6

Patch Set 6 : Clean up, fix NULL. #

Patch Set 7 : accept unknown interfaces for now, rather than segfault. #

Patch Set 8 : Cleanup, separate ppb from ppp. Stop inlining the loop in ShimLookerUpper. #

Patch Set 9 : Add a unittest. #

Patch Set 10 : change print routines #

Patch Set 11 : len diff #

Patch Set 12 : Split out generic-ish parts of wrapper generation #

Patch Set 13 : Add presubmit hook. #

Patch Set 14 : Fix presubmit.wq #

Total comments: 6

Patch Set 15 : Fix comments #

Total comments: 4

Patch Set 16 : clean out some imports #

Patch Set 17 : add comment #

Patch Set 18 : stop generating the header -- non-generated code must be able to include it.. #

Patch Set 19 : remove old todo #

Total comments: 6

Patch Set 20 : cleanups #

Patch Set 21 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+950 lines, -31 lines) Patch
M ppapi/PRESUBMIT.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +38 lines, -10 lines 0 comments Download
M ppapi/generators/generator.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +3 lines, -5 lines 0 comments Download
M ppapi/generators/idl_c_proto.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 5 chunks +38 lines, -15 lines 0 comments Download
A ppapi/generators/idl_gen_pnacl.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 1 chunk +236 lines, -0 lines 0 comments Download
A ppapi/generators/idl_gen_wrapper.py View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +456 lines, -0 lines 0 comments Download
M ppapi/generators/idl_generator.py View 1 chunk +0 lines, -1 line 0 comments Download
A ppapi/generators/pnacl_shim.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +29 lines, -0 lines 0 comments Download
A ppapi/generators/test_gen_pnacl/test_interfaces.idl View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +150 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
jvoung - send to chromium...
draft of refactoring the shim generator if you want to take a look (with sample ...
9 years, 1 month ago (2011-11-15 22:33:10 UTC) #1
sehr (please use chromium)
lgtm http://codereview.chromium.org/8568025/diff/1/ppapi/generators/idl_gen_pnacl.py File ppapi/generators/idl_gen_pnacl.py (right): http://codereview.chromium.org/8568025/diff/1/ppapi/generators/idl_gen_pnacl.py#newcode21 ppapi/generators/idl_gen_pnacl.py:21: Option('pnaclglue', 'Name of the pnacl glue file.', We ...
9 years, 1 month ago (2011-11-16 00:44:01 UTC) #2
jvoung - send to chromium...
http://codereview.chromium.org/8568025/diff/1/ppapi/generators/idl_c_proto.py File ppapi/generators/idl_c_proto.py (right): http://codereview.chromium.org/8568025/diff/1/ppapi/generators/idl_c_proto.py#newcode375 ppapi/generators/idl_c_proto.py:375: func_attributes, is_cast): changed func_attributes to ptr_prefix changed is_cast to ...
9 years, 1 month ago (2011-11-16 01:45:22 UTC) #3
jvoung - send to chromium...
Added some bits to skip wrapping of an entire interface if none of the methods ...
9 years, 1 month ago (2011-11-16 21:43:37 UTC) #4
robertm
initial comments http://codereview.chromium.org/8568025/diff/8001/ppapi/generators/out4.c File ppapi/generators/out4.c (right): http://codereview.chromium.org/8568025/diff/8001/ppapi/generators/out4.c#newcode964 ppapi/generators/out4.c:964: static __attribute__((pnaclcall)) int32_t PNACL_M14_PPB_Transport_Dev_Connect(PP_Resource transport, struct PP_CompletionCallback ...
9 years, 1 month ago (2011-11-16 22:17:12 UTC) #5
jvoung - send to chromium...
http://codereview.chromium.org/8568025/diff/8001/ppapi/generators/out4.c File ppapi/generators/out4.c (right): http://codereview.chromium.org/8568025/diff/8001/ppapi/generators/out4.c#newcode964 ppapi/generators/out4.c:964: static __attribute__((pnaclcall)) int32_t PNACL_M14_PPB_Transport_Dev_Connect(PP_Resource transport, struct PP_CompletionCallback cb) { ...
9 years, 1 month ago (2011-11-16 22:51:42 UTC) #6
jvoung - send to chromium...
Noel: Question, is there a flag to enable generation of private interfaces from IDL? I ...
9 years, 1 month ago (2011-11-17 01:01:54 UTC) #7
noelallen1
The default behavior of the generator is to search '.', './dev','./trusted' for *.idl files. You ...
9 years, 1 month ago (2011-11-20 00:32:56 UTC) #8
jvoung - send to chromium...
On 2011/11/20 00:32:56, noelallen1 wrote: > The default behavior of the generator is to search ...
9 years, 1 month ago (2011-11-22 01:14:27 UTC) #9
jvoung - send to chromium...
Noel: I added a unittest. Are they usually invoked the way I listed in the ...
9 years, 1 month ago (2011-11-22 01:17:02 UTC) #10
jvoung - send to chromium...
On 2011/11/22 01:17:02, jvoung wrote: > Noel: I added a unittest. Are they usually invoked ...
9 years, 1 month ago (2011-11-22 19:29:20 UTC) #11
noelallen1
A few style nits, and a question about how your test against the new IDL ...
9 years, 1 month ago (2011-11-23 18:06:11 UTC) #12
jvoung - send to chromium...
Not sure which question you had about how the test works, but here is some ...
9 years, 1 month ago (2011-11-23 22:39:28 UTC) #13
jvoung - send to chromium...
ptal
9 years ago (2011-11-28 18:57:33 UTC) #14
robertm
added a few more comments but I do not really understand well enough to do ...
9 years ago (2011-11-28 19:44:04 UTC) #15
jvoung - send to chromium...
http://codereview.chromium.org/8568025/diff/37002/ppapi/generators/generator.py File ppapi/generators/generator.py (right): http://codereview.chromium.org/8568025/diff/37002/ppapi/generators/generator.py#newcode10 ppapi/generators/generator.py:10: from idl_generator import Generator On 2011/11/28 19:44:04, robertm wrote: ...
9 years ago (2011-11-28 20:14:25 UTC) #16
robertm
can you add comment as this is really unexpected behavior
9 years ago (2011-11-28 20:23:06 UTC) #17
jvoung - send to chromium...
On 2011/11/28 20:23:06, robertm wrote: > can you add comment as this is really unexpected ...
9 years ago (2011-11-28 20:36:40 UTC) #18
robertm
LGTM assuming there will be a few more rounds to cleanup some of the style ...
9 years ago (2011-11-29 00:10:50 UTC) #19
jvoung - send to chromium...
Noel, any other issues? Robert, sorry one more change on the pnacl side if you ...
9 years ago (2011-11-29 21:13:48 UTC) #20
dmichael (off chromium)
Came up with some little nits before I realized you only needed me to look ...
9 years ago (2011-11-30 04:53:15 UTC) #21
noelallen1
LGTM One last note is generation location. I'll be cleaning up the regular generator to ...
9 years ago (2011-11-30 06:58:25 UTC) #22
jvoung - send to chromium...
9 years ago (2011-11-30 17:48:03 UTC) #23
Thanks everyone! Committing...

http://codereview.chromium.org/8568025/diff/36004/ppapi/generators/idl_c_prot...
File ppapi/generators/idl_c_proto.py (right):

http://codereview.chromium.org/8568025/diff/36004/ppapi/generators/idl_c_prot...
ppapi/generators/idl_c_proto.py:385: name = '%s%s%s' % (prefix, name, arrayspec)
On 2011/11/30 04:53:15, dmichael wrote:
> nit: One of our many Python style guides says not to use % for just basic
> concatenation.
> http://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Strings
> 
> (I've picked on Noel for this, so it's only fair I pick on you, too...  sorry)

Done.

http://codereview.chromium.org/8568025/diff/36004/ppapi/generators/idl_c_prot...
ppapi/generators/idl_c_proto.py:467: def GetStructName(self, node, release,
include_version=False):
On 2011/11/30 04:53:15, dmichael wrote:
> Maybe should be GetTypeName, since it applies to more than structs? (This may
> eventually come up for enums too)

Yes, this includes unions too, but I'm thinking of leaving this alone for now,
since it is called from DefineStructInternals() which is called from
DefineStruct(). Perhaps we can rename the all three when it comes time.

http://codereview.chromium.org/8568025/diff/36004/ppapi/generators/pnacl_shim.h
File ppapi/generators/pnacl_shim.h (right):

http://codereview.chromium.org/8568025/diff/36004/ppapi/generators/pnacl_shim...
ppapi/generators/pnacl_shim.h:13: /* There is not a typedef for
PPP_GetInterface_type, but it is currently
On 2011/11/30 04:53:15, dmichael wrote:
> type->Type?

Done.

Powered by Google App Engine
This is Rietveld 408576698