Closed
Bug 1254484
Opened 9 years ago
Closed 8 years ago
[Presentation WebAPI] resolve the relative URL to absolute URL
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: schien, Assigned: schien)
References
()
Details
(Whiteboard: btpp-backlog)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
schien
:
review+
|
Details | Diff | Splinter Review |
Need to follow the latest spec:
Resolve url relative to the API base URL specified by the entry settings object, and let presentationUrl be the resulting absolute URL, if any.
Updated•9 years ago
|
Whiteboard: btpp-backlog
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → schien
Assignee | ||
Comment 1•8 years ago
|
||
PresentationConnection.url is implemented in bug 1197690.
Attachment #8777232 -
Flags: review?(bugs)
Comment 2•8 years ago
|
||
Comment on attachment 8777232 [details] [diff] [review]
resolve-relative-url.patch
>+GetAbsoluteURL(const nsAString& aUrl,
>+ nsIURI* aBaseUri,
>+ nsAString& aAbsoluteUrl)
>+{
>+ nsAutoCString charset;
>+ nsresult rv = aBaseUri->GetOriginCharset(charset);
I think I'd prefer if you used GetDocumentCharacterSet() from the GetExtantDoc() of the window.
You can add yet another param to GetAbsoluteURL (doc or charset) or inline this all to ctor.
Remember, GetExtantDoc() may return null.
>+
>+ if (NS_FAILED(rv)) {
>+ return rv;
>+ }
>+
>+ nsCOMPtr<nsIURI> uri;
>+ rv = NS_NewURI(getter_AddRefs(uri),
>+ aUrl,
>+ charset.IsEmpty() ? nullptr : charset.get(),
>+ aBaseUri,
>+ nsContentUtils::GetIOService());
You don't need to pass GetIOService().
Those fixed, r+
If you're at all uncertain about some change, I could re-review.
Attachment #8777232 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 3•8 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #2)
> Comment on attachment 8777232 [details] [diff] [review]
> resolve-relative-url.patch
>
> >+GetAbsoluteURL(const nsAString& aUrl,
> >+ nsIURI* aBaseUri,
> >+ nsAString& aAbsoluteUrl)
> >+{
> >+ nsAutoCString charset;
> >+ nsresult rv = aBaseUri->GetOriginCharset(charset);
> I think I'd prefer if you used GetDocumentCharacterSet() from the
> GetExtantDoc() of the window.
> You can add yet another param to GetAbsoluteURL (doc or charset) or inline
> this all to ctor.
> Remember, GetExtantDoc() may return null.
Got it, I'll use GetDocumentCharacterSet() if document is not null, or use nullptr otherwise.
>
>
> >+
> >+ if (NS_FAILED(rv)) {
> >+ return rv;
> >+ }
> >+
> >+ nsCOMPtr<nsIURI> uri;
> >+ rv = NS_NewURI(getter_AddRefs(uri),
> >+ aUrl,
> >+ charset.IsEmpty() ? nullptr : charset.get(),
> >+ aBaseUri,
> >+ nsContentUtils::GetIOService());
> You don't need to pass GetIOService().
Done.
I did this simply because a comment in NS_NewURI says "pass in nsIIOService to optimize callers". Not sure how much performance gain it can get but PresentationRequest is probably not on the critical path.
>
> Those fixed, r+
> If you're at all uncertain about some change, I could re-review.
Assignee | ||
Comment 4•8 years ago
|
||
Assignee | ||
Comment 5•8 years ago
|
||
update according to review comment, carry r+.
Attachment #8777232 -
Attachment is obsolete: true
Attachment #8777691 -
Flags: review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/505e6acd9c29
resolve relative presentation URL. r=smaug.
Keywords: checkin-needed
Comment 7•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•