Closed
Bug 958782
Opened 11 years ago
Closed 10 years ago
Convert nsIDOMMozMobileMessageManager to webidl
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: mrbkap, Assigned: vicamo)
References
Details
(Whiteboard: [ft:ril][p=3])
Attachments
(6 files, 11 obsolete files)
(deleted),
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
(deleted),
patch
|
Details | Diff | Splinter Review |
nsIDOMMobileMessageManager is current written in XPIDL and because of that it has to do a bunch of manual JSAPI stuff that we'd rather not have.
We should convert it to WebIDL, which will should get rid of the manual JSAPI stuff and hopefully make the API better defined and cleaner.
Reporter | ||
Updated•11 years ago
|
Assignee: nobody → tclancy
Summary: Convert nsIDOMMobileMessageManager to webidl → Convert nsIDOMMozMobileMessageManager to webidl
Assignee | ||
Comment 1•11 years ago
|
||
Duplicate bug 859764?
Reporter | ||
Comment 2•11 years ago
|
||
Oops, yes.
Vicamo, are you actively working on that bug?
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 3•10 years ago
|
||
Reopen here to make some progress.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Assignee | ||
Updated•10 years ago
|
Assignee | ||
Comment 4•10 years ago
|
||
1) Rename dom/webidl/MobileMessageManager.webidl to dom/webidl/MozMobileMessageManager.idl
2) Add MozMobileMessageManager WebIDL definition.
Assignee: tclancy → vyang
Attachment #8433034 -
Flags: review?(khuey)
Attachment #8433034 -
Flags: review?(Ms2ger)
Assignee | ||
Comment 5•10 years ago
|
||
This patch cleans up some bits so that we can have a much more trivial part 2.b patch that really implements WebIDL stuff. This patch has no functional change.
Attachment #8433036 -
Flags: review?(Ms2ger)
Assignee | ||
Comment 6•10 years ago
|
||
Attachment #8433037 -
Flags: review?(Ms2ger)
Assignee | ||
Comment 7•10 years ago
|
||
WebIDL converts null to string "null" for MozMobileMessageManager::GetSegmentInfoForText(), so one test case in test_getsegmentinfofortext.js no longer throws and fails the run.
Attachment #8433043 -
Flags: review?(gene.lian)
Assignee | ||
Comment 8•10 years ago
|
||
Full try in progress: https://tbpl.mozilla.org/?tree=Try&rev=e969d7ab1e4c
Assignee | ||
Comment 9•10 years ago
|
||
Fix b2g-desktop mochitest failure.
Attachment #8433043 -
Attachment is obsolete: true
Attachment #8433043 -
Flags: review?(gene.lian)
Attachment #8433064 -
Flags: review?(gene.lian)
Updated•10 years ago
|
Attachment #8433034 -
Flags: review?(Ms2ger) → feedback+
Updated•10 years ago
|
Attachment #8433036 -
Flags: review?(khuey)
Attachment #8433036 -
Flags: review?(Ms2ger)
Attachment #8433036 -
Flags: feedback+
Comment 10•10 years ago
|
||
Comment on attachment 8433037 [details] [diff] [review]
part 2.b/3: WebIDL implementation
Review of attachment 8433037 [details] [diff] [review]:
-----------------------------------------------------------------
A lot of this code could be simplified by using WebIDL sequences etc.; I'll leave it to khuey to decide whether to do that in this bug.
::: dom/mobilemessage/src/MobileMessageManager.cpp
@@ +125,2 @@
>
> + return request.forget().downcast<DOMRequest>();
Should not need the downcast
@@ +333,2 @@
>
> + return request.forget().downcast<DOMRequest>();
Ditto
::: dom/mobilemessage/src/MobileMessageManager.h
@@ +30,4 @@
>
> NS_REALLY_FORWARD_NSIDOMEVENTTARGET(DOMEventTargetHelper)
>
> + MobileMessageManager(nsPIDOMWindow *aWindow);
* to the left
Attachment #8433037 -
Flags: review?(khuey)
Attachment #8433037 -
Flags: review?(Ms2ger)
Attachment #8433037 -
Flags: feedback+
Assignee | ||
Comment 11•10 years ago
|
||
(In reply to :Ms2ger from comment #10)
> Comment on attachment 8433037 [details] [diff] [review]
> -----------------------------------------------------------------
> A lot of this code could be simplified by using WebIDL sequences etc.; I'll
> leave it to khuey to decide whether to do that in this bug.
Two problems: we don't have array support and union can't have sequence<T> members. Both Send() and Delete() take an union parameter. Any other solutions?
Flags: needinfo?(Ms2ger)
Assignee | ||
Comment 12•10 years ago
|
||
(In reply to :Ms2ger from comment #10)
> Review of attachment 8433037 [details] [diff] [review]:
BTW, thanks for your quick feedback. :)
Assignee | ||
Updated•10 years ago
|
Whiteboard: [p=3]
Comment 13•10 years ago
|
||
(Channeling Ms2ger who has internet problems right now)
Perhaps
> + [Throws]
> + DOMRequest send(DOMString number, DOMString message,
> + optional SmsSendParameters sendParameters);
> + [Throws]
> + sequence<DOMRequest> send(sequence<DOMString> numbers, DOMString message,
> + optional SmsSendParameters sendParameters);
and
> + DOMRequest delete(long id);
> + DOMRequest delete(MozSmsMessage message);
> + DOMRequest delete(MozMmsMessage message);
> + DOMRequest delete(sequence<(long or MozSmsMessage or MozMmsMessage)> params);
would work.
Flags: needinfo?(Ms2ger)
Updated•10 years ago
|
Attachment #8433064 -
Flags: review?(gene.lian) → review+
Assignee | ||
Comment 14•10 years ago
|
||
1) Use WebIDL suggested in comment 13,
2) add extended attribute [Pref="dom.sms.enabled"] to MozMobileMessageManager,
3) accept MozMmsMessage in |retrieveMMS| as well.
Attachment #8433034 -
Attachment is obsolete: true
Attachment #8433034 -
Flags: review?(khuey)
Attachment #8435093 -
Flags: review?(khuey)
Attachment #8435093 -
Flags: feedback?(Ms2ger)
Assignee | ||
Comment 15•10 years ago
|
||
1) address comment 10,
2) accommodate to suggested WebIDL rules in comment 13,
3) s/uint32_t/int32_t/ for message id field of several methods to strictly conform to what XPIDL and WebIDL have defined.
Attachment #8433037 -
Attachment is obsolete: true
Attachment #8433037 -
Flags: review?(khuey)
Attachment #8435096 -
Flags: review?(khuey)
Attachment #8435096 -
Flags: feedback?(Ms2ger)
Comment 16•10 years ago
|
||
Comment on attachment 8435093 [details] [diff] [review]
part 1/3: webidl/xpidl changes : v2
Review of attachment 8435093 [details] [diff] [review]:
-----------------------------------------------------------------
This seems fine, but it should be merged with the other patches.
Attachment #8435093 -
Flags: feedback?(Ms2ger) → feedback+
Assignee | ||
Comment 17•10 years ago
|
||
Suggestions in comment 13 also eliminates most JS API usage, so several headers can be removed now.
Attachment #8435109 -
Flags: review?(khuey)
Assignee | ||
Updated•10 years ago
|
Whiteboard: [p=3] → [ft:ril][p=3]
Target Milestone: --- → 2.0 S4 (20june)
Attachment #8435093 -
Flags: review?(khuey) → review+
Comment on attachment 8433036 [details] [diff] [review]
part 2.a/3: refactorings, alignments, renames
Review of attachment 8433036 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/MobileMessageManager.cpp
@@ +198,5 @@
> if (!sendParams.Init(aCx, param)) {
> return NS_ERROR_TYPE_ERR;
> }
> + }
> + if (sendParams.mServiceId.WasPassed()) {
nit: \n above if
@@ +270,5 @@
> if (!sendParams.Init(aCx, param)) {
> return NS_ERROR_TYPE_ERR;
> }
> + }
> + if (sendParams.mServiceId.WasPassed()) {
here too
Attachment #8433036 -
Flags: review?(khuey) → review+
Attachment #8435109 -
Flags: review?(khuey) → review+
Comment on attachment 8435096 [details] [diff] [review]
part 2.b/3: WebIDL implementation : v2
Review of attachment 8435096 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/MobileMessageManager.cpp
@@ +339,5 @@
> +MobileMessageManager::Delete(const Sequence<OwningLongOrMozSmsMessageOrMozMmsMessage>& aParams,
> + ErrorResult& aRv)
> +{
> + const uint32_t size = aParams.Length();
> + nsAutoArrayPtr<int32_t> idAutoArray(new int32_t[size]);
Very nit-picky, but please use the fallible new and null check
Attachment #8435096 -
Flags: review?(khuey) → review+
Updated•10 years ago
|
blocking-b2g: --- → backlog
Comment 22•10 years ago
|
||
Comment on attachment 8435096 [details] [diff] [review]
part 2.b/3: WebIDL implementation : v2
Review of attachment 8435096 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/mobilemessage/src/MobileMessageManager.cpp
@@ +241,4 @@
>
> + AutoSafeJSContext cx;
> + JS::Rooted<JS::Value> val(cx);
> + if (!aParams.ToObject(cx, &val)) {
bz, what's the status of ToObject?
Attachment #8435096 -
Flags: feedback?(Ms2ger) → feedback?(bzbarsky)
Updated•10 years ago
|
Flags: needinfo?(Ms2ger)
Comment 23•10 years ago
|
||
Comment on attachment 8435096 [details] [diff] [review]
part 2.b/3: WebIDL implementation : v2
The status is that it's gone. You should be using ToJSValue.
Also, you should probably be entering some compartment in SendMMS, not just doing AutoSafeJSContext, right Bobby?
Attachment #8435096 -
Flags: feedback?(bzbarsky) → feedback+
Flags: needinfo?(bobbyholley)
Comment 24•10 years ago
|
||
(In reply to Boris Zbarsky [:bz] from comment #23)
> Comment on attachment 8435096 [details] [diff] [review]
> part 2.b/3: WebIDL implementation : v2
>
> The status is that it's gone. You should be using ToJSValue.
>
> Also, you should probably be entering some compartment in SendMMS, not just
> doing AutoSafeJSContext, right Bobby?
Yes.
Before bug 1025476 lands, you should do:
if (!NS_WARN_IF(GetOwner()->GetGlobalJSObject())) {
return nullptr;
}
AutoJSAPI jsapi;
JSContext *cx = jsapi.cx();
JSAutoCompartment ac(cx, GetOwner()->GetGlobalJSObject());
After bug 1025476 lands, you should do:
AutoJSAPI jsapi;
if (!NS_WARN_IF(jsapi.init(GetOwner())) {
return nullptr;
}
Flags: needinfo?(bobbyholley)
Assignee | ||
Comment 25•10 years ago
|
||
(In reply to Bobby Holley (:bholley) from comment #24)
> (In reply to Boris Zbarsky [:bz] from comment #23)
> > Comment on attachment 8435096 [details] [diff] [review]
> > part 2.b/3: WebIDL implementation : v2
> >
> > The status is that it's gone. You should be using ToJSValue.
Thank you. I've already include this in my local working branch.
> > Also, you should probably be entering some compartment in SendMMS, not just
> > doing AutoSafeJSContext, right Bobby?
>
> Yes.
>
> Before bug 1025476 lands, you should do:
>
> if (!NS_WARN_IF(GetOwner()->GetGlobalJSObject())) {
> return nullptr;
> }
> AutoJSAPI jsapi;
> JSContext *cx = jsapi.cx();
> JSAutoCompartment ac(cx, GetOwner()->GetGlobalJSObject());
>
> After bug 1025476 lands, you should do:
>
> AutoJSAPI jsapi;
> if (!NS_WARN_IF(jsapi.init(GetOwner())) {
> return nullptr;
> }
Thank you.
Assignee | ||
Comment 26•10 years ago
|
||
Rebase only.
Attachment #8435093 -
Attachment is obsolete: true
Attachment #8442673 -
Flags: review+
Assignee | ||
Comment 27•10 years ago
|
||
1) Address review comment 19.
2) Pass nsISmsService instance to Send(...) so that we don't bother calling do_GetService() again and again.
Attachment #8433036 -
Attachment is obsolete: true
Attachment #8442674 -
Flags: review+
Assignee | ||
Comment 28•10 years ago
|
||
1) Address review comment 20 -- using FallibleArray instead
2) Address review comment 24 -- use AutoJSAPI::InitUsingWin. Also fixes MobileConnection.
Attachment #8435096 -
Attachment is obsolete: true
Attachment #8442689 -
Flags: feedback?(bobbyholley)
Assignee | ||
Comment 29•10 years ago
|
||
Rebase only.
Attachment #8435109 -
Attachment is obsolete: true
Attachment #8442690 -
Flags: review+
Assignee | ||
Comment 30•10 years ago
|
||
Fix -Werror,-Wunused-variable only. Full try in https://tbpl.mozilla.org/?tree=Try&rev=92a98cbac4b2 .
Attachment #8442689 -
Attachment is obsolete: true
Attachment #8442689 -
Flags: feedback?(bobbyholley)
Attachment #8442787 -
Flags: feedback?(bobbyholley)
Comment 31•10 years ago
|
||
Comment on attachment 8442787 [details] [diff] [review]
part 2.b/3: WebIDL implementation : v4
Review of attachment 8442787 [details] [diff] [review]:
-----------------------------------------------------------------
AutoJSAPI stuff looks good - thanks for doing it.
Attachment #8442787 -
Flags: feedback?(bobbyholley) → feedback+
Assignee | ||
Comment 32•10 years ago
|
||
(In reply to Vicamo Yang [:vicamo][:vyang] from comment #30)
> Full try in https://tbpl.mozilla.org/?tree=Try&rev=92a98cbac4b2 .
Fails dom/tests/mochitest/general/test_interfaces.html because MozMobileMessageManager is now guarded by preference "dom.sms.enabled" in part 1/3 as other RIL interfaces do. Had another revision for part 3/3 and is trying mochitest again in https://tbpl.mozilla.org/?tree=Try&rev=2dec47a33c60 .
Assignee | ||
Comment 33•10 years ago
|
||
Fix failure in "dom/tests/mochitest/general/test_interfaces.html", therefore need additional reviews from DOM peers. Now MozMobileMessageManager has same conditions with other RIL components.
Attachment #8433064 -
Attachment is obsolete: true
Attachment #8444312 -
Flags: review?(bobbyholley)
Attachment #8444312 -
Flags: review?(bobbyholley) → review+
Assignee | ||
Comment 34•10 years ago
|
||
Thank you, Kyle!
Assignee | ||
Comment 35•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/033708b53979
https://hg.mozilla.org/integration/b2g-inbound/rev/15a281081b97
https://hg.mozilla.org/integration/b2g-inbound/rev/731f37afb649
https://hg.mozilla.org/integration/b2g-inbound/rev/f06d2ba57fb3
https://hg.mozilla.org/integration/b2g-inbound/rev/29a1c6a34550
Comment 36•10 years ago
|
||
sorry had to back out this changes for test failures like https://tbpl.mozilla.org/php/getParsedLog.php?id=42263193&tree=B2g-Inbound
Assignee | ||
Comment 37•10 years ago
|
||
(In reply to Carsten Book [:Tomcat] from comment #36)
> sorry had to back out this changes for test failures like
> https://tbpl.mozilla.org/php/getParsedLog.php?id=42263193&tree=B2g-Inbound
I'm the one to say sorry. :(
Besides the unexpected -Werror,-Wmismatched-tags error, I'm supposed to land this bug *after* bug 1025476.
Assignee | ||
Comment 38•10 years ago
|
||
Fix -Werror,-Wmismatched-tags error on Mac OS X, Windows. MmsParameters/MmsSendParameters/SmsSendParameters was previously declared as struct, not class.
Attachment #8442787 -
Attachment is obsolete: true
Attachment #8444988 -
Flags: review+
Assignee | ||
Comment 39•10 years ago
|
||
Update commit summary to include r=khuey only.
Attachment #8444312 -
Attachment is obsolete: true
Attachment #8444990 -
Flags: review+
Assignee | ||
Comment 40•10 years ago
|
||
Full try again in https://tbpl.mozilla.org/?tree=Try&rev=288c95845afb
Assignee | ||
Comment 41•10 years ago
|
||
https://hg.mozilla.org/integration/b2g-inbound/rev/61d0e4bb1ebb
https://hg.mozilla.org/integration/b2g-inbound/rev/829c05c420e0
https://hg.mozilla.org/integration/b2g-inbound/rev/61d118d19b05
https://hg.mozilla.org/integration/b2g-inbound/rev/c2fb5b4eeabe
https://hg.mozilla.org/integration/b2g-inbound/rev/168ea7238c94
Comment 42•10 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/61d0e4bb1ebb
https://hg.mozilla.org/mozilla-central/rev/829c05c420e0
https://hg.mozilla.org/mozilla-central/rev/61d118d19b05
https://hg.mozilla.org/mozilla-central/rev/c2fb5b4eeabe
https://hg.mozilla.org/mozilla-central/rev/168ea7238c94
Status: REOPENED → RESOLVED
Closed: 11 years ago → 10 years ago
Resolution: --- → FIXED
Comment 43•10 years ago
|
||
We're seeing this on inbound, after this merged from mozilla-central on both clobber and non-clobber builds:
https://tbpl.mozilla.org/php/getParsedLog.php?id=42445354&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=42444802&tree=Mozilla-Inbound
I'm guessing yet-to-be-merged-from-inbound landings added more uses that need converting - would you mind taking a look?
Status: RESOLVED → REOPENED
Flags: needinfo?(vyang)
Resolution: FIXED → ---
Assignee | ||
Comment 44•10 years ago
|
||
(In reply to Ed Morley [:edmorley UTC+0] from comment #43)
> We're seeing this on inbound, after this merged from mozilla-central on both
> clobber and non-clobber builds:
>
> I'm guessing yet-to-be-merged-from-inbound landings added more uses that
> need converting - would you mind taking a look?
I'm not sure I know what happens to m-i, but, yes, I'm looking at it.
Flags: needinfo?(vyang)
Assignee | ||
Comment 45•10 years ago
|
||
Bug 1029866 renames InitUsingWin() to Init() again.
Assignee | ||
Comment 46•10 years ago
|
||
Assignee | ||
Comment 47•10 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
Target Milestone: 2.0 S4 (20june) → 2.0 S5 (4july)
Updated•10 years ago
|
blocking-b2g: backlog → ---
tracking-b2g:
--- → backlog
You need to log in
before you can comment on or make changes to this bug.
Description
•