Closed Bug 1131047 Opened 11 years ago Closed 11 years ago

Consider to obsolete TelephonyCallGroup.onholding and TelephonyCallGroup.onresuming

Categories

(Firefox OS Graveyard :: RIL, defect)

defect
Not set
normal

Tracking

(firefox40 fixed)

RESOLVED FIXED
2.2 S11 (1may)
Tracking Status
firefox40 --- fixed

People

(Reporter: bhsu, Assigned: a2882525224)

Details

Attachments

(5 files, 6 obsolete files)

Similar to Bug 1095366, since the return types of holding and resuming a TelephonyCallGroup are changed to promises which can show whether the requests are accepted, both the two events (onholding and onresuming) are no longer needed. It's time to obsolete them.
Assignee: nobody → a2882525224
Attachment #8578715 - Attachment is patch: true
Attachment #8578718 - Attachment is patch: true
Attachment #8578715 - Attachment is obsolete: true
Attachment #8578717 - Attachment is obsolete: true
Attachment #8593446 - Attachment is obsolete: true
Attachment #8593447 - Attachment is obsolete: true
Attachment #8578718 - Attachment is obsolete: true
Attachment #8593449 - Attachment description: Part 1:Obsolete some events (WebIDL). r=hsinyi → Part 1:Obsolete some events (WebIDL)
Attachment #8593450 - Attachment description: Part 2:Obsolete some events (DOM) (V2). r=aknow → Part 2:Obsolete some events (DOM) (V2)
Attachment #8593451 - Attachment description: Part 3:Update the related testcases. r=aknow → Part 3:Update the related testcases
Attachment #8593449 - Flags: review?(htsai)
Attachment #8593450 - Flags: review?(szchen)
Attachment #8593451 - Flags: review?(szchen)
Hi Hsinyi and Aknow, I finally finish solving this issue. I have tested the patches locally with marionette-webapi tests, and them passed perfectly. Do you mind reviewing these patches?
Attachment #8593451 - Flags: review?(szchen) → review+
Comment on attachment 8593450 [details] [diff] [review] Part 2:Obsolete some events (DOM) (V2) Review of attachment 8593450 [details] [diff] [review]: ----------------------------------------------------------------- Looks good. There are some parts we could make it better. So, I'd like to have a second round review to see the final version. Thanks. ::: dom/telephony/TelephonyCall.cpp @@ +84,5 @@ > > void > TelephonyCall::ChangeStateInternal(uint16_t aCallState, bool aFireEvents) > { > nsRefPtr<TelephonyCall> kungFuDeathGrip(this); Maybe we could add if (mCallState == aCallState) { return; } to skip the unnecessary action, just like what we did in TelephonyCallGroup. @@ +88,5 @@ > nsRefPtr<TelephonyCall> kungFuDeathGrip(this); > + // Since the return types are changed to promises, both of holding and > + // resuming are only used internally without dispatching the event. If > + // aCallState isn't those states used internally, this variable will remain > + // true and event will be dispatched. Contains too much unrelated information in the comment, for example, the promise part. Actually, the return type of this function is not promises. The wording here may cause misunderstanding. I'll suggest only write down the meaning of this variable. Others could be easily read from code. // Indicate whether the external state should be changed. @@ +94,2 @@ > > nsString stateString; Remove this line. It's not used. @@ +94,3 @@ > > nsString stateString; > switch (aCallState) { Add comment before switch // Update the external state. so that we have a comment that is parallel to what you added for "Update the internal state". @@ +131,1 @@ > mCallState = aCallState; nits: I'd prefer to move this part to the place that immediately after if (mCallState == aCallState) { return; } because they are highly related. ::: dom/telephony/TelephonyCallGroup.cpp @@ +86,5 @@ > { > + // Since the return types are changed to promises, both of holding and > + // resuming are only used internally without dispatching the event. > + // If aCallState isn't those states used internally, this variable will remain > + // true and event will be dispatched. The same, as what I wrote in TelephonyCall::ChangeStateInternal. @@ +93,1 @@ > if (mCallState == aCallState) { Move this |if| block to the beginning. We can perform the check before declare |externalStateChanged|. @@ +93,5 @@ > if (mCallState == aCallState) { > return; > } > > nsString stateString; Remove the line. @@ +94,5 @@ > return; > } > > nsString stateString; > switch (aCallState) { Comment before |switch|. // Update the external state. @@ +122,3 @@ > mCallState = aCallState; > > + if(externalStateChanged){ Add a space after 'if' and before '{'.
Attachment #8593450 - Flags: review?(szchen) → review-
Hi Aknow, Thanks for your reviewing. I will modify the TelephonyCall.cpp and TelephonyCallGroup.cpp according to your advice.
Comment on attachment 8593449 [details] [diff] [review] Part 1:Obsolete some events (WebIDL). r=hsinyi Review of attachment 8593449 [details] [diff] [review]: ----------------------------------------------------------------- Thanks for the patch!
Attachment #8593449 - Flags: review?(htsai) → review+
Attachment #8593450 - Attachment is obsolete: true
Attachment #8594772 - Flags: review?(szchen)
Hi Aknow, The new patch doesn’t add the state check to the beginning of |TelephonyCall::ChangeStateInternal(…)|, because the state check would fail many of marionette-webapi tests, where the most of them are failed by |timeout|. To identify the root cause, I did a little experiment. The other two attachments are the logs of running |test_conference_two_hangup_one.js| with and without the state check. By comparing the difference between the two logs, I think some event firings are spared by the state check. In “Log_without_state_check.log”, the calls received both “statechange” and “conneted” events after the conference’s receiving “callschanged” (around line 899). However, in “log_with_the_state_check”, those events are gone (near line 811). Besides, I also found a comment in function |Telephony::HandleCallInfo(…)| might be high related to this fact. The comment says the following, // We don't fire the statechange event on a call in conference here. // Instead, the event will be fired later in // TelephonyCallGroup::ChangeState(). Thus the sequence of firing the // statechange events is guaranteed: first on TelephonyCallGroup then on // individual TelephonyCall objects. Therefore, I came to a conclusion that |TelephonyCall::ChangeStateInternal(…)| might be invoke twice when the call within a conference group changes, where the first time we update the call’s state and the second time we fire events to it, so I don’t think we should add the state check in the |TelephonyCall::ChangeStateInternal(…)|.
(In reply to a2882525224 from comment #16) > Hi Aknow, > > The new patch doesn’t add the state check to the beginning of > |TelephonyCall::ChangeStateInternal(…)|, because the state check would fail > many of marionette-webapi tests, where the most of them are failed by > |timeout|. To identify the root cause, I did a little experiment. The other > two attachments are the logs of running |test_conference_two_hangup_one.js| > with and without the state check. By comparing the difference between the > two logs, I think some event firings are spared by the state check. In > “Log_without_state_check.log”, the calls received both “statechange” and > “conneted” events after the conference’s receiving “callschanged” (around > line 899). However, in “log_with_the_state_check”, those events are gone > (near line 811). Besides, I also found a comment in function > |Telephony::HandleCallInfo(…)| might be high related to this fact. The > comment says the following, > > // We don't fire the statechange event on a call in conference here. > // Instead, the event will be fired later in > // TelephonyCallGroup::ChangeState(). Thus the sequence of firing the > // statechange events is guaranteed: first on TelephonyCallGroup then on > // individual TelephonyCall objects. > > Therefore, I came to a conclusion that > |TelephonyCall::ChangeStateInternal(…)| might be invoke twice when the call > within a conference group changes, where the first time we update the call’s > state and the second time we fire events to it, so I don’t think we should > add the state check in the |TelephonyCall::ChangeStateInternal(…)|. Oh yes, you are right. Sorry that I just forgot this part and thanks for your thorough experiment.
Comment on attachment 8594772 [details] [diff] [review] Part 2:Obsolete some events (DOM) (V3). r=aknow Review of attachment 8594772 [details] [diff] [review]: ----------------------------------------------------------------- Perfect! Thanks.
Attachment #8594772 - Flags: review?(szchen) → review+
Attachment #8593449 - Attachment filename: Part 1:Obsolete some events (WebIDL). r=hsinyi → Bug1131047_Part1
Attachment #8593451 - Attachment filename: Part 3:Update the related testcases. r=aknow → Bug1131047_Part 3
Attachment #8594772 - Attachment filename: Part 2:Obsolete some events (DOM) (V3) → Bug1131047_Part2
Attachment #8593451 - Attachment filename: Bug1131047_Part 3 → Bug1131047_Part3
Attachment #8593449 - Attachment description: Part 1:Obsolete some events (WebIDL) → Part 1:Obsolete some events (WebIDL). r=hsinyi
Attachment #8593451 - Attachment description: Part 3:Update the related testcases → Part 3:Update the related testcases. r=aknow
Attachment #8594772 - Attachment description: Part 2:Obsolete some events (DOM) (V3) → Part 2:Obsolete some events (DOM) (V3). r=aknow
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: