Closed Bug 990458 Opened 12 years ago Closed 12 years ago

B2G RIL: replace the use of 'network-interface-state-changed' events with updateNetworkInterface() API.

Categories

(Firefox OS Graveyard :: RIL, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog)

RESOLVED FIXED
2.1 S2 (15aug)
tracking-b2g backlog

People

(Reporter: jessica, Assigned: jessica)

Details

(Whiteboard: [p=2])

Attachments

(5 files, 14 obsolete files)

2.67 KB, patch
jessica
: review+
Details | Diff | Splinter Review
1.85 KB, patch
jessica
: review+
Details | Diff | Splinter Review
3.63 KB, patch
jessica
: review+
Details | Diff | Splinter Review
1.85 KB, patch
jessica
: review+
Details | Diff | Splinter Review
12.78 KB, patch
jessica
: review+
Details | Diff | Splinter Review
This a follow-up to Bug 931348 comment 25 and 26. We'd like to move the "network-interface-state-changed" notifications firing into NetworkManager. NetworkManager should fire the notifications when all the routes (default and extra) and DNSes are all set. Or better, we should change to use the new topic "network-connection-state-changed" instead and introduce the new API 'updateNetworkInterface(...)' in nsINetworkManager. This proposal was not able to land cause it changes the current interface and we were at the end v1.3. I wonder if we can do it now?
Summary: B2G RIL: move 'network-interface-state-changed' notifications firing to NetworkManager → B2G RIL: replace the use of 'network-interface-state-changed' events with updateNetworkInterface() API.
Attachment #8402500 - Flags: review?(vyang)
Attachment #8402501 - Flags: review?(vyang)
Attachment #8402503 - Flags: review?(vyang)
Attachment #8402504 - Flags: review?(vyang)
Attachment #8402505 - Flags: review?(vyang)
Attachment #8402507 - Flags: review?(vyang)
Attachment #8402500 - Flags: review?(vyang)
Attachment #8402501 - Flags: review?(vyang)
Attachment #8402503 - Flags: review?(vyang)
Attachment #8402504 - Flags: review?(vyang)
Attachment #8402505 - Flags: review?(vyang)
Attachment #8402507 - Flags: review?(vyang)
Cancelling review as we decided to fix bug 939046 first.
Put this bug into backlog.
blocking-b2g: --- → backlog
This bug was originally filed to adopt a new API updateNetworkInterface() to notify state changes in network interfaces and let NetworkManager fire the 'network-interface-state-changed' after all the routes are set correclty (see comment 0). Although, Bug 976897 introduced a new topic to prevent the race condition of setting routes and using network interfaces, I think we can still adopt the new API to avoid confusions. So, 'network-connection-state-changed' notifications are used to notify outer modules that the network interface is ready and this new API will be used only between network interfaces and NetworkManager.
Assignee: nobody → jjong
rebased.
Attachment #8402500 - Attachment is obsolete: true
Refine comments.
Attachment #8460102 - Attachment is obsolete: true
rebased.
Attachment #8402501 - Attachment is obsolete: true
rebased.
Attachment #8402503 - Attachment is obsolete: true
Rebased. Part 6 is done already in Bug 939046 Part 2.a.
Attachment #8402505 - Attachment is obsolete: true
Attachment #8402507 - Attachment is obsolete: true
Attachment #8460104 - Flags: review?(echen)
Attachment #8460105 - Flags: review?(echen)
Attachment #8460106 - Flags: review?(vchang)
Attachment #8460107 - Flags: review?(vchang)
Attachment #8460109 - Flags: review?(echen)
Comment on attachment 8460104 [details] [diff] [review] Part 1: add updateNetworkInterface() API in idl, v3. Review of attachment 8460104 [details] [diff] [review]: ----------------------------------------------------------------- Thank you.
Attachment #8460104 - Flags: review?(echen) → review+
Comment on attachment 8460105 [details] [diff] [review] Part 2: ril changes to support updateNetworkInterface(), v2. Review of attachment 8460105 [details] [diff] [review]: ----------------------------------------------------------------- r=me, thank you.
Attachment #8460105 - Flags: review?(echen) → review+
Comment on attachment 8460109 [details] [diff] [review] Part 5: implement updateNetworkInterface() and remove network-interface-state-changed event, v2. Review of attachment 8460109 [details] [diff] [review]: ----------------------------------------------------------------- Please help to remove the addObserver()/removeObserver()/const for TOPIC_INTERFACE_STATE_CHANGED. Thank you. ::: dom/system/gonk/NetworkManager.js @@ +310,5 @@ > Services.obs.notifyObservers(network, TOPIC_INTERFACE_REGISTERED, null); > debug("Network '" + networkId + "' registered."); > }, > > + updateNetworkInterface: function (network) { nit: no need to have a space between "function" and "("
Attachment #8460109 - Flags: review?(echen)
(In reply to Edgar Chen [:edgar][:echen] from comment #18) > Comment on attachment 8460109 [details] [diff] [review] > Part 5: implement updateNetworkInterface() and remove > network-interface-state-changed event, v2. > > Review of attachment 8460109 [details] [diff] [review]: > ----------------------------------------------------------------- > > Please help to remove the addObserver()/removeObserver()/const for > TOPIC_INTERFACE_STATE_CHANGED. Thank you. Oh yes, thanks for reminding me this. :) > > ::: dom/system/gonk/NetworkManager.js > @@ +310,5 @@ > > Services.obs.notifyObservers(network, TOPIC_INTERFACE_REGISTERED, null); > > debug("Network '" + networkId + "' registered."); > > }, > > > > + updateNetworkInterface: function (network) { > > nit: no need to have a space between "function" and "(" will do.
May I have your review again? Thanks. Changes since v2: - Address review comment 18: remove the addObserver()/removeObserver()/const for TOPIC_INTERFACE_STATE_CHANGED and the space between "function" and "(" in NetworkManager.js - remove const for TOPIC_INTERFACE_STATE_CHANGED in marionette head.js
Attachment #8460109 - Attachment is obsolete: true
Attachment #8462363 - Flags: review?(echen)
Comment on attachment 8462363 [details] [diff] [review] Part 5: implement updateNetworkInterface() and remove network-interface-state-changed event, v3. Review of attachment 8462363 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/system/gonk/NetworkManager.js @@ +307,5 @@ > Services.obs.notifyObservers(network, TOPIC_INTERFACE_REGISTERED, null); > debug("Network '" + networkId + "' registered."); > }, > > + updateNetworkInterface: function(network) { Ah, one more thing. The documentation says: "Throws an exception if the specified network interface object isn't registered", but I don't see this behavior. Is any reason? ((Sorry for doesn't point this out in the previous review))
(In reply to Edgar Chen [:edgar][:echen] from comment #21) > Comment on attachment 8462363 [details] [diff] [review] > Part 5: implement updateNetworkInterface() and remove > network-interface-state-changed event, v3. > > Review of attachment 8462363 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: dom/system/gonk/NetworkManager.js > @@ +307,5 @@ > > Services.obs.notifyObservers(network, TOPIC_INTERFACE_REGISTERED, null); > > debug("Network '" + networkId + "' registered."); > > }, > > > > + updateNetworkInterface: function(network) { > > Ah, one more thing. The documentation says: "Throws an exception if the > specified network interface object isn't registered", but I don't see this > behavior. Is any reason? > ((Sorry for doesn't point this out in the previous review)) Oh, I missed that part. :( Thanks for pointing it out. Will upload another patch to address this.
Changes since v3: - throw exception if the network passed in updateNetworkInterface() is not an instance of Ci.nsINetworkInterface or it's not registered.
Attachment #8462363 - Attachment is obsolete: true
Attachment #8462363 - Flags: review?(echen)
Attachment #8462477 - Flags: review?(echen)
Attachment #8460106 - Flags: review?(vchang) → review+
Attachment #8460107 - Flags: review?(vchang) → review+
Attachment #8462477 - Flags: review?(echen) → review+
Looks good, thank you.
Add r=edgar.
Attachment #8460104 - Attachment is obsolete: true
Attachment #8463863 - Flags: review+
Add r=edgar.
Attachment #8460105 - Attachment is obsolete: true
Attachment #8463864 - Flags: review+
Thanks Vincent and Edgar. try green: https://tbpl.mozilla.org/?tree=Try&rev=1c382bf6538e
Whiteboard: [p=2]
Target Milestone: --- → 2.1 S2 (15aug)
blocking-b2g: backlog → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: