Closed
Bug 1179089
Opened 9 years ago
Closed 9 years ago
[Telephony] Update the IPC architecture to prevent QI failure
Categories
(Firefox OS Graveyard :: RIL, defect)
Tracking
(tracking-b2g:backlog, firefox42 fixed)
Tracking | Status | |
---|---|---|
firefox42 | --- | fixed |
People
(Reporter: bhsu, Assigned: aknow)
References
Details
Attachments
(1 file)
15.00 KB,
patch
|
hsinyi
:
review+
hsinyi
:
feedback+
|
Details | Diff | Splinter Review |
As mentioned in the comment 35 and comment 37 in Bug 1174243, when passing from the IPC child side to the IPC parent side, callback objects supporting either nsITelephonyCallback or nsITelephonyDialCallback will be QIed into objects supporting nsITelephonyDialCallback which further make the usage of this interface become unreliable and error-prone. To fix this problem, we should create different callback objects on the IPC parent side according to the type of the callback object on the IPC child side.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → szchen
Assignee | ||
Comment 1•9 years ago
|
||
Instead of implementing callback interface by TelephonyRequestParent itself, we now let it hold two callback objects and pass the correct one to telephony service.
Attachment #8629865 -
Flags: feedback?(htsai)
Comment 3•9 years ago
|
||
Comment on attachment 8629865 [details] [diff] [review] Let TelephonyRequestParent hold the callback objects Review of attachment 8629865 [details] [diff] [review]: ----------------------------------------------------------------- The main concept looks good to me! ::: dom/telephony/ipc/TelephonyParent.h @@ +120,5 @@ > SendResponse(const IPCTelephonyResponse& aResponse); > > + Callback* > + GetCallback() { > + return mCallback; We should use mCallback.get(), no? @@ +125,5 @@ > + } > + > + DialCallback* > + GetDialCallback() { > + return mDialCallback; ditto.
Attachment #8629865 -
Flags: feedback?(htsai) → feedback+
Assignee | ||
Comment 4•9 years ago
|
||
(In reply to Hsin-Yi Tsai [:hsinyi] from comment #3) > Comment on attachment 8629865 [details] [diff] [review] > Let TelephonyRequestParent hold the callback objects > > Review of attachment 8629865 [details] [diff] [review]: > ----------------------------------------------------------------- > > The main concept looks good to me! > > ::: dom/telephony/ipc/TelephonyParent.h > @@ +120,5 @@ > > SendResponse(const IPCTelephonyResponse& aResponse); > > > > + Callback* > > + GetCallback() { > > + return mCallback; > > We should use mCallback.get(), no? > > @@ +125,5 @@ > > + } > > + > > + DialCallback* > > + GetDialCallback() { > > + return mDialCallback; > > ditto. https://dxr.mozilla.org/mozilla-central/source/xpcom/base/nsRefPtr.h?from=nsRefPtr#227 operator T*() const All nsRefPtr implicitly acts like a raw pointer. In addition, according to the comment, we prefer to use the implicit conversion rather than call the get().
Comment 5•9 years ago
|
||
(In reply to Szu-Yu Chen [:aknow] from comment #4) > (In reply to Hsin-Yi Tsai [:hsinyi] from comment #3) > > Comment on attachment 8629865 [details] [diff] [review] > > Let TelephonyRequestParent hold the callback objects > > > > Review of attachment 8629865 [details] [diff] [review]: > > ----------------------------------------------------------------- > > > > The main concept looks good to me! > > > > ::: dom/telephony/ipc/TelephonyParent.h > > @@ +120,5 @@ > > > SendResponse(const IPCTelephonyResponse& aResponse); > > > > > > + Callback* > > > + GetCallback() { > > > + return mCallback; > > > > We should use mCallback.get(), no? > > > > @@ +125,5 @@ > > > + } > > > + > > > + DialCallback* > > > + GetDialCallback() { > > > + return mDialCallback; > > > > ditto. > > https://dxr.mozilla.org/mozilla-central/source/xpcom/base/nsRefPtr. > h?from=nsRefPtr#227 > > operator T*() const > > All nsRefPtr implicitly acts like a raw pointer. In addition, according to > the comment, we prefer to use the implicit conversion rather than call the > get(). Oh, you are right. Thanks for pointing this to me.
Assignee | ||
Comment 6•9 years ago
|
||
Comment on attachment 8629865 [details] [diff] [review] Let TelephonyRequestParent hold the callback objects I don't know how to test it... The test needs to go through the ipc part and has some customization in telphonyService. However, it seems to me that it's not feasible in current test framework. So I'd like to land the patch directly (already verified on real device).
Attachment #8629865 -
Flags: review?(htsai)
Comment 7•9 years ago
|
||
Comment on attachment 8629865 [details] [diff] [review] Let TelephonyRequestParent hold the callback objects Review of attachment 8629865 [details] [diff] [review]: ----------------------------------------------------------------- Thank you.
Attachment #8629865 -
Flags: review?(htsai) → review+
Assignee | ||
Comment 8•9 years ago
|
||
try looks good https://treeherder.mozilla.org/#/jobs?repo=try&revision=f2e985eef33f
Comment 10•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/55abf3c44b10
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox42:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → FxOS-S4 (07Aug)
You need to log in
before you can comment on or make changes to this bug.
Description
•