Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(747)

Issue 2148643002: [Presentation API] Adds DOMString[] constructor to PresentationRequest. (Closed)

Created:
4 years, 5 months ago by mark a. foltz
Modified:
3 years, 11 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, chromium-reviews, darin-cc_chromium.org, dglazkov+blink, haraken, jam, mlamouri+watch-content_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Adds DOMString[] constructor to PresentationRequest. This updates the Blink and platform layers of the Presentation API to support multiple URLs per PresentationRequest. Until support is plumbed through to the service layer, only the first URL in the array will be passed through the PresentationService API. This also: - Updates layout tests to exercise the new constructor - Adds a unit test to PresentationRequest - Updates PresentationAvailabilityTest - Adds a 'url' attribute to PresentationConnection TODO: Intent to Implement/Ship BUG=627655

Patch Set 1 #

Patch Set 2 : Unit tests pass #

Patch Set 3 : Update layout and browser tests #

Patch Set 4 : Fix PresentationAvailabilityCallbacks #

Total comments: 17

Patch Set 5 : Respond to mlamouri@ comments #

Patch Set 6 : Fix LayoutTests #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -79 lines) Patch
M chrome/test/media_router/resources/common.js View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/presentation/presentation_dispatcher.h View 1 3 chunks +6 lines, -4 lines 0 comments Download
M content/renderer/presentation/presentation_dispatcher.cc View 1 6 chunks +20 lines, -12 lines 2 comments Download
M third_party/WebKit/LayoutTests/presentation/presentation-api.html View 1 2 1 chunk +11 lines, -1 line 0 comments Download
A + third_party/WebKit/LayoutTests/presentation/presentation-navigation-multipleurls.html View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/presentation/presentationrequest.html View 1 2 1 chunk +25 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/modules.gypi View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/Presentation.cpp View 1 2 chunks +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationAvailability.h View 1 4 chunks +6 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp View 1 2 3 4 3 chunks +11 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.h View 1 2 3 3 chunks +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp View 1 2 chunks +3 lines, -3 lines 1 comment Download
M third_party/WebKit/Source/modules/presentation/PresentationAvailabilityTest.cpp View 1 2 chunks +6 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationConnection.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationConnection.idl View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationController.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationController.cpp View 1 2 3 4 2 chunks +8 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationRequest.h View 1 4 chunks +7 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationRequest.cpp View 1 6 chunks +25 lines, -13 lines 0 comments Download
M third_party/WebKit/Source/modules/presentation/PresentationRequest.idl View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
A third_party/WebKit/Source/modules/presentation/PresentationRequestTest.cpp View 1 2 3 4 1 chunk +56 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/modules/presentation/WebPresentationAvailabilityObserver.h View 1 1 chunk +5 lines, -2 lines 0 comments Download
M third_party/WebKit/public/platform/modules/presentation/WebPresentationClient.h View 1 2 3 4 4 chunks +7 lines, -6 lines 0 comments Download

Messages

Total messages: 16 (11 generated)
mark a. foltz
Derek/Mounir: PTAL
4 years, 5 months ago (2016-07-18 23:10:24 UTC) #4
mlamouri (slow - plz ping)
Looks great. I think we only need to figure out what we want to send ...
4 years, 5 months ago (2016-07-19 12:45:03 UTC) #9
mark a. foltz
Responded to comments. I can start the backend patch in parallel, and also I'll share ...
4 years, 5 months ago (2016-07-19 17:38:48 UTC) #10
mlamouri (slow - plz ping)
looks good to me but I think we should have something better than picking the ...
4 years, 5 months ago (2016-07-20 13:02:10 UTC) #15
imcheng
4 years, 5 months ago (2016-07-20 17:20:46 UTC) #16
lgtm overall, just some comments about corner cases and future work.

https://codereview.chromium.org/2148643002/diff/60001/third_party/WebKit/Sour...
File third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp
(right):

https://codereview.chromium.org/2148643002/diff/60001/third_party/WebKit/Sour...
third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp:55:
m_urls.swap(data);
On 2016/07/20 13:02:10, Mounir Lamouri wrote:
> On 2016/07/19 at 17:38:47, mark a. foltz wrote:
> > On 2016/07/19 at 12:45:03, Mounir Lamouri wrote:
> > > nit: I am probably missing something but could you use `m_urls` instead of
> `data` above?
> > 
> > WebVector does not provide any method to resize itself once allocated.  To
> populate the vector, the sample code suggests using swap().  See:
> > 
> >
>
https://cs-staging.chromium.org/chromium/src/third_party/WebKit/public/platfo...
> 
> I'm speechless :)

But you can initialize m_urls with a size param, right?

https://codereview.chromium.org/2148643002/diff/100001/content/renderer/prese...
File content/renderer/presentation/presentation_dispatcher.cc (right):

https://codereview.chromium.org/2148643002/diff/100001/content/renderer/prese...
content/renderer/presentation/presentation_dispatcher.cc:109: 
should this code check the given vector is not empty? and/or, the static factory
method for PresentationRequest? Same for other methods in this file.

https://codereview.chromium.org/2148643002/diff/100001/content/renderer/prese...
content/renderer/presentation/presentation_dispatcher.cc:337:
observer->availabilityChanged(available);
Add a TODO here to pass the availability_url into the observer/callback, which
will then decide the "overall" availability to send back to the page.

https://codereview.chromium.org/2148643002/diff/100001/third_party/WebKit/Sou...
File
third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp
(right):

https://codereview.chromium.org/2148643002/diff/100001/third_party/WebKit/Sou...
third_party/WebKit/Source/modules/presentation/PresentationAvailabilityCallbacks.cpp:26:
void PresentationAvailabilityCallbacks::onSuccess(bool value)
I think some changes are required here in the future to pass the correct
availability value to the resolver. IIUC, we can resolve it with true if any url
is available, or false if all of them are unavailable.

Powered by Google App Engine
This is Rietveld 408576698