Closed
Bug 783451
Opened 13 years ago
Closed 12 years ago
Protocol passed through arguments should be a friend class
Categories
(Core :: IPC, defect)
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: kanru, Unassigned)
Details
Attachments
(2 files)
923 bytes,
patch
|
nrc
:
review+
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
3.92 KB,
patch
|
bent.mozilla
:
review+
|
Details | Diff | Splinter Review |
In case like
struct SurfaceDescriptorGralloc {
PGrallocBuffer buffer;
};
union SurfaceDescriptor {
SurfaceDescriptorGralloc;
};
union SharedImage {
SurfaceDescriptor;
};
sync protocol PImageContainer
{
manager PImageBridge;
child:
async ReturnImage(SharedImage image);
};
The generated code for |ReturnImage| needs to access PGrallocBuffer's mId field which is private, this forces us to mark PImageContainer as managing seemingly unrelated PGrallocBuffer.
Error:
../../ipc/ipdl/_ipdlheaders/mozilla/layers/PGrallocBufferParent.h: In member function 'void mozilla::layers::PImageContainerParent::Write(mozilla::layers::PGrallocBufferParent*, IPC::Message*, bool)':
../../ipc/ipdl/_ipdlheaders/mozilla/layers/PGrallocBufferParent.h:228: error: 'int32 mozilla::layers::PGrallocBufferParent::mId' is private
objdir-gecko/ipc/ipdl/PImageContainerParent.cpp:845: error: within this context
objdir-gecko/ipc/ipdl/PImageContainerParent.cpp: In member function 'bool mozilla::layers::PImageContainerParent::Read(mozilla::layers::PGrallocBufferParent**, const IPC::Message*, void**, bool)':
objdir-gecko/ipc/ipdl/PImageContainerParent.cpp:875: error: 'mozilla::ipc::RPCChannel::RPCListener' is an inaccessible base of 'mozilla::layers::PGrallocBufferParent'
![]() |
Reporter | |
Comment 1•12 years ago
|
||
To fix this we might need to eitehr
1. Run two pass parsing to know that PGrallocBuffer needs to be a friend of PImageContainer
or
2. Introduce a new syntax that indicates PGrallocBuffer is a friend of PImageContainer like
protocol PGrallocBuffer {
friend PImageContainer;
child:
Msg();
};
Comment 2•12 years ago
|
||
What is the manager of PGrallocBuffer in this case? Adding friend marking is definitely incorrect here. Perhaps asking the common manager ancestor for the ID is the correct behavior.
![]() |
Reporter | |
Comment 3•12 years ago
|
||
PGrallocBuffer has many managers because we used to create it from different protocols.
Comment 4•12 years ago
|
||
That doesn't matter. We know at compile time which manager applies in this particular case.
![]() |
Reporter | |
Comment 5•12 years ago
|
||
It turns out the bug has been fixed in bug 825928. See bug 852734 comment 82.
Attachment #754760 -
Flags: review?(ncameron)
Attachment #754760 -
Flags: review?(bent.mozilla)
![]() |
Reporter | |
Comment 6•12 years ago
|
||
TODO: Add a testcase for it.
![]() |
||
Updated•12 years ago
|
Attachment #754760 -
Flags: review?(ncameron) → review+
Updated•12 years ago
|
Attachment #754760 -
Flags: review?(bent.mozilla) → review+
![]() |
Reporter | |
Comment 7•12 years ago
|
||
I'll file the FIXME bug if this test case make sense.
Attachment #761939 -
Flags: review?(benjamin)
Updated•12 years ago
|
Attachment #761939 -
Flags: review?(benjamin) → review?(bent.mozilla)
Comment on attachment 761939 [details] [diff] [review]
Add test case
Review of attachment 761939 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good! Though splinter says these files have windows line endings which you should remove before checkin.
Here's one thing that needs fixing:
::: ipc/ipdl/test/cxx/PTestIndirectProtocolParamFirst.ipdl
@@ +1,3 @@
> +include protocol PTestIndirectProtocolParamManage;
> +// FIXME/bug xxxxxx protocol PTestIndirectProtocolParamSecond is
> +// already included in PTestIndirectProtocolParam.ipdlh
Please actually file a bug or remove this comment.
Attachment #761939 -
Flags: review?(bent.mozilla) → review+
![]() |
Reporter | |
Comment 9•12 years ago
|
||
(In reply to ben turner [:bent] from comment #8)
> ::: ipc/ipdl/test/cxx/PTestIndirectProtocolParamFirst.ipdl
> @@ +1,3 @@
> > +include protocol PTestIndirectProtocolParamManage;
> > +// FIXME/bug xxxxxx protocol PTestIndirectProtocolParamSecond is
> > +// already included in PTestIndirectProtocolParam.ipdlh
>
> Please actually file a bug or remove this comment.
Actually there is already one, bug 792908, I'll fill that.
![]() |
Reporter | |
Comment 10•12 years ago
|
||
Comment 11•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/5fae2a068802
https://hg.mozilla.org/mozilla-central/rev/5c902b055c44
Status: NEW → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in
before you can comment on or make changes to this bug.
Description
•