Closed Bug 1136565 Opened 10 years ago Closed 9 years ago

recovery when an unknown device connected to TCP presentation server

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: CuveeHsu, Assigned: schien)

References

Details

Attachments

(1 file, 5 obsolete files)

We should have a way to recovery when an unknown device connected to TCP presentation server. A possible way is talk to its listener to discovery again and report whether the connecter is in the discovery results.
Controlling device might not register itself as a mDNS device so we need to create a correspond Presentation Device on receiver side while connected.
Here is the summary of this patch: 1) move nsIPresentationDevice generation and storage from TCPPresentationServer to MDNSDeviceProvider 2) move session request event interface from nsIPresentationDeviceEventListener to nsIPresentationDeviceListener 3) TCP control channel now report incoming session request from TCPPresentationServer -> MDNSDeviceProvider -> PresentationDeviceManager 4) establishing control channel now goes from MDNSDevice -> MDNSDeviceProvider -> TCPPresentationServer
Assignee: nobody → schien
Status: NEW → ASSIGNED
Attachment #8674137 - Flags: feedback?(xeonchen)
Attachment #8674137 - Flags: feedback?(juhsu)
Comment on attachment 8674137 [details] [diff] [review] bug1136565-allow-request-from-unknown-controller.patch Review of attachment 8674137 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/presentation/provider/MulticastDNSDeviceProvider.cpp @@ +856,5 @@ > + nsAutoCString id; > + unused << aDeviceInfo->GetId(id); > + uint16_t port; > + unused << aDeviceInfo->GetPort(&port); > + remove trailing spaces @@ +859,5 @@ > + unused << aDeviceInfo->GetPort(&port); > + > + device = new Device(id, id, EmptyCString(), host, port, DeviceState::eActive, nullptr); > + } > + remove trailing space ::: dom/presentation/provider/MulticastDNSDeviceProvider.h @@ +76,4 @@ > { > } > > + const nsCString& Id() const remove trailing space @@ +145,5 @@ > + nsresult RequestSession(Device* aDevice, > + const nsAString& aUrl, > + const nsAString& aPresentationId, > + nsIPresentationControlChannel** aRetVal); > + remove trailing spaces
Attachment #8674137 - Flags: feedback?(xeonchen) → feedback+
Comment on attachment 8674137 [details] [diff] [review] bug1136565-allow-request-from-unknown-controller.patch Review of attachment 8674137 [details] [diff] [review]: ----------------------------------------------------------------- lgtm
Attachment #8674137 - Flags: feedback?(juhsu) → feedback+
Update with test cases fixed. Will have minor modification in test case later but we can start the first review.
Attachment #8674137 - Attachment is obsolete: true
Attachment #8674812 - Flags: review?(xeonchen)
Attachment #8674812 - Flags: review?(juhsu)
Attached patch bug1136565.patch (obsolete) (deleted) — Splinter Review
update with test case modification. @seanlin, mochitest for Presentation API is modified because receiver side session creation event is moved from nsIPresentationDeviceEventListener to nsIPresentationDeviceListener.
Attachment #8674812 - Attachment is obsolete: true
Attachment #8674812 - Flags: review?(xeonchen)
Attachment #8674812 - Flags: review?(juhsu)
Attachment #8675273 - Flags: review?(xeonchen)
Attachment #8675273 - Flags: review?(selin)
Attachment #8675273 - Flags: review?(juhsu)
Comment on attachment 8675273 [details] [diff] [review] bug1136565.patch Review of attachment 8675273 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/presentation/tests/mochitest/PresentationSessionChromeScript.js @@ +360,5 @@ > addMessageListener('trigger-incoming-session-request', function(url) { > + var deviceManager = Cc['@mozilla.org/presentation-device/manager;1'] > + .getService(Ci.nsIPresentationDeviceManager); > + deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener) > + .onSessionRequest(mockedDevice, url, sessionId, mockedControlChannel); nit: function |simulateSessionRequest| (and possibly the listener setter/getter) of |mockedDevice| may also be removed.
Attachment #8675273 - Flags: review?(selin) → review+
Blocks: 1200132
update according to @seanlin's comment and rebase according to RefPtr modification.
Attachment #8675273 - Attachment is obsolete: true
Attachment #8675273 - Flags: review?(xeonchen)
Attachment #8675273 - Flags: review?(juhsu)
Attachment #8675494 - Flags: review?(xeonchen)
Attachment #8675494 - Flags: review?(juhsu)
Comment on attachment 8675494 [details] [diff] [review] bug1136565-allow-request-from-unknown-controller.patch - v3 Review of attachment 8675494 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/presentation/provider/MulticastDNSDeviceProvider.cpp @@ +277,5 @@ > MulticastDNSDeviceProvider::UnregisterService(nsresult aReason) > { > MOZ_ASSERT(NS_IsMainThread()); > > + ClearDevices(); Per our discussion, devices should not be cleared in unregistration.
Attachment #8675494 - Flags: review?(xeonchen)
Thanks for catching this. Patch is updated according to @xeonchen's comment.
Attachment #8675494 - Attachment is obsolete: true
Attachment #8675494 - Flags: review?(juhsu)
Attachment #8675524 - Flags: review?(xeonchen)
Attachment #8675524 - Flags: review?(juhsu)
Attachment #8675524 - Flags: review?(xeonchen) → review+
Originally device list is maintained in TCPPresentationServer. We need to clean all device related information and rebuild it while restarting server. (That's the reason why ClearDevice() is invoked in |OnClose|, see comment #11.) We don't need to rescan while restarting server because the device list is maintained in MDNSDeviceProvider directly.
Attachment #8675524 - Attachment is obsolete: true
Attachment #8675524 - Flags: review?(juhsu)
Attachment #8675980 - Flags: review?(xeonchen)
Attachment #8675980 - Flags: review?(juhsu)
Attachment #8675980 - Flags: review?(juhsu) → review+
Attachment #8675980 - Flags: review?(xeonchen) → review+
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: