Closed
Bug 1216398
Opened 11 years ago
Closed 11 years ago
[Presentation WebAPI] provide device ID to TCPPresentationServer while device discoverable is turned off
Categories
(Core :: DOM: Core & HTML, defect, P1)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla44
| Tracking | Status | |
|---|---|---|
| firefox44 | --- | fixed |
People
(Reporter: schien, Assigned: schien)
References
Details
(Whiteboard: [ft:conndevices])
Attachments
(1 file, 2 obsolete files)
|
20.01 KB,
patch
|
schien
:
review+
|
Details | Diff | Splinter Review |
TCPPresentationServer needs a ID for initiating session request, however in current code base we only set ID after service is registered. In this case, we cannot make a pure controller (enable discovery but disable discoverable).
We'll need to init TCPPresentationServer before service registeration.
| Assignee | ||
Comment 1•11 years ago
|
||
TCPPresentationServer.id is only used for controller scenario and TCPPresentationServer.startService is only used for receiver scenario.
MDNSDeviceProvider might correct the Id after service registration but it doesn't affect any receiver side functionality.
Attachment #8676099 -
Flags: feedback?(xeonchen)
Attachment #8676099 -
Flags: feedback?(juhsu)
Comment 2•11 years ago
|
||
Comment on attachment 8676099 [details] [diff] [review]
bug1216398-support-non-discoverable-device.patch
Review of attachment 8676099 [details] [diff] [review]:
-----------------------------------------------------------------
lgtm, thank you!
::: dom/presentation/provider/MulticastDNSDeviceProvider.cpp
@@ +185,5 @@
> mDiscveryTimeoutMs = Preferences::GetUint(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS);
> mDiscoverable = Preferences::GetBool(PREF_PRESENTATION_DISCOVERABLE);
> mServiceName = Preferences::GetCString(PREF_PRESENTATION_DEVICE_NAME);
>
> + mPresentationServer->SetId(mServiceName);
the return value should be checked?
Attachment #8676099 -
Flags: feedback?(xeonchen) → feedback+
| Assignee | ||
Updated•11 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 8676099 [details] [diff] [review]
bug1216398-support-non-discoverable-device.patch
Review of attachment 8676099 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/presentation/provider/MulticastDNSDeviceProvider.cpp
@@ +185,5 @@
> mDiscveryTimeoutMs = Preferences::GetUint(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS);
> mDiscoverable = Preferences::GetBool(PREF_PRESENTATION_DISCOVERABLE);
> mServiceName = Preferences::GetCString(PREF_PRESENTATION_DEVICE_NAME);
>
> + mPresentationServer->SetId(mServiceName);
|SetId| will no fail after this modification, I'll use |unused| to capture the return value.
| Assignee | ||
Comment 4•11 years ago
|
||
Address previous review comment and use device name as default service name on Fennec.
Attachment #8676099 -
Attachment is obsolete: true
Attachment #8676099 -
Flags: feedback?(juhsu)
Attachment #8676687 -
Flags: review?(xeonchen)
Attachment #8676687 -
Flags: review?(juhsu)
Updated•11 years ago
|
Attachment #8676687 -
Flags: review?(xeonchen) → review+
| Assignee | ||
Comment 5•11 years ago
|
||
Comment 6•11 years ago
|
||
Comment on attachment 8676687 [details] [diff] [review]
bug1216398-support-non-discoverable-device.patch
Review of attachment 8676687 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/presentation/interfaces/nsITCPPresentationServer.idl
@@ +87,5 @@
> readonly attribute uint16_t port;
>
> /**
> + * The id of the TCP presentation server. The TCP presentation server won't
> + * work until the |id| is set.
This comment seems not able to elaborate the intention of this patch. Should |id| always be set before use?
|responseSession| doesn't check the existence of |id| anymore. Does it mean TCPPresentationServer is able to without id as a presenter?
Whatever it is, make it clear on the comment.
::: dom/presentation/provider/TCPPresentationServer.js
@@ +65,5 @@
> } catch (e) {
> // NS_ERROR_SOCKET_ADDRESS_IN_USE
> DEBUG && log("TCPPresentationServer - init server socket fail: " + e);
> throw Cr.NS_ERROR_FAILURE;
> }
idl should mention this throw
@@ +128,5 @@
> aUrl);
> },
>
> responseSession: function(aDeviceInfo, aSocketTransport) {
> + if (!this._isServiceInit()) {
I guess we never reach here. Modify the log message to specify it.
Attachment #8676687 -
Flags: review?(juhsu) → review+
| Assignee | ||
Comment 7•11 years ago
|
||
Comment on attachment 8676687 [details] [diff] [review]
bug1216398-support-non-discoverable-device.patch
Review of attachment 8676687 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/presentation/interfaces/nsITCPPresentationServer.idl
@@ +87,5 @@
> readonly attribute uint16_t port;
>
> /**
> + * The id of the TCP presentation server. The TCP presentation server won't
> + * work until the |id| is set.
Yeah, |id| is only required for controller action, i.e. requestSession. I'll rephrase the comment.
::: dom/presentation/provider/TCPPresentationServer.js
@@ +65,5 @@
> } catch (e) {
> // NS_ERROR_SOCKET_ADDRESS_IN_USE
> DEBUG && log("TCPPresentationServer - init server socket fail: " + e);
> throw Cr.NS_ERROR_FAILURE;
> }
Oh my bad, I shouldn't remove the |throw| section in IDL.
| Assignee | ||
Comment 8•11 years ago
|
||
update according to review comments, carry r+.
Attachment #8676687 -
Attachment is obsolete: true
Attachment #8676750 -
Flags: review+
| Assignee | ||
Comment 9•11 years ago
|
||
| Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 10•11 years ago
|
||
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•