Last Comment Bug 763238 - "Opens" and "Bridge" declarations need to use fully-qualified names
: "Opens" and "Bridge" declarations need to use fully-qualified names
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: IPC (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla16
Assigned To: Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
:
Mentors:
Depends on:
Blocks: 745148
  Show dependency treegraph
 
Reported: 2012-06-09 18:16 PDT by Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
Modified: 2012-07-24 15:38 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
?
-


Attachments
Use fully-qualified names for Open/Bridge (4.32 KB, patch)
2012-06-09 18:21 PDT, Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
bent.mozilla: review+
Details | Diff | Review
Test for bug 763228 (5.09 KB, patch)
2012-06-09 18:21 PDT, Chris Jones [:cjones] inactive; ni?/f?/r? if you need me
no flags Details | Diff | Review

Description Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-06-09 18:16:38 PDT
We might be bridging/opening protocols in other C++ namespaces, so fq names need to be generated.
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-06-09 18:21:03 PDT
Created attachment 631701 [details] [diff] [review]
Use fully-qualified names for Open/Bridge
Comment 2 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-06-09 18:21:27 PDT
Created attachment 631702 [details] [diff] [review]
Test for bug 763228
Comment 3 Ben Turner (not reading bugmail, use the needinfo flag!) 2012-06-11 15:49:22 PDT
Comment on attachment 631701 [details] [diff] [review]
Use fully-qualified names for Open/Bridge

Review of attachment 631701 [details] [diff] [review]:
-----------------------------------------------------------------

::: ipc/ipdl/ipdl/lower.py
@@ +447,1 @@
>          return Type(t.name())

Hm, you repeat this pattern in lots of places. How about you just have another method that does this:

  def _internalName(self, thing):
    return thing.fullname() if self.fq else thing.name()

Then all the other places would be much simpler, don't you think? Up to you I guess.

@@ +481,5 @@
>      def visitMessageType(self, m): assert 0
>      def visitVoidType(self, v): assert 0
>      def visitStateType(self, st): assert 0
>  
> +def _cxxBareType(ipdltype, side, fq=0):

False? 0 and 1 are kinda 1980's style ;)
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-06-11 20:12:13 PDT
(In reply to ben turner [:bent] from comment #3)
> Comment on attachment 631701 [details] [diff] [review]
> Use fully-qualified names for Open/Bridge
> 
> Review of attachment 631701 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: ipc/ipdl/ipdl/lower.py
> @@ +447,1 @@
> >          return Type(t.name())
> 
> Hm, you repeat this pattern in lots of places. How about you just have
> another method that does this:
> 
>   def _internalName(self, thing):
>     return thing.fullname() if self.fq else thing.name()
> 
> Then all the other places would be much simpler, don't you think? Up to you
> I guess.
> 

Good idea.  Added, with typename() helper.

> @@ +481,5 @@
> >      def visitMessageType(self, m): assert 0
> >      def visitVoidType(self, v): assert 0
> >      def visitStateType(self, st): assert 0
> >  
> > +def _cxxBareType(ipdltype, side, fq=0):
> 
> False? 0 and 1 are kinda 1980's style ;)

Well, that's the prevailing style in this file.  I guess 1980s programmers got much more work done from not having to type as much ;).  I didn't change this because it's the prevailing style.  Feel free to file a followup for changing that, and assign to bent ;).
Comment 7 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-07-24 15:38:41 PDT
Not sure why we're retriaging closed bugs, but this would have blocked (blocks a blocker).

Note You need to log in before you can comment on or make changes to this bug.