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

Issue 1406013003: [Presentation API / Media Router] Clean up default pres URL logic. (Closed)

Created:
5 years, 2 months ago by imcheng
Modified:
5 years, 1 month ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mcasas+watch_chromium.org, media-router+watch_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Presentation API / Media Router] Clean up default pres URL logic. 1. In presentation_service.mojom, there were 2 methods for default presentation: ListenForDefaultSessionStart and SetDefaultPresentationURL. There is no reason they should be called separately. Furthermore, ListenForDefaultSessionStart is called after connecting to PresentationService, which is not optimal. This CL removes the former method. 2. Remove OnDefaultSessionStarted from PSD::Observer and replace it with callbacks. The purpose of PSD::Observer is to notify PresentationServiceImpl that PresentationServiceDelegate is being destroyed and shouldn't include specific Pres API logic. 3. Fix default request matching logic in PSDImpl to account for all of (frame, frame url, presentation url). Previously it was only checking presentation url and always assumes it came from the current main frame. This is a problem because the main frame of a WebContents can change over time, i.e. main frame at time of setting DPU and time of route response could be different). Now we create a PresentationRequest object to hold all info needed to match default request and pass it to MRUI, who then binds the request to the route response callback in PSDImpl/PresentationFrameManager to perform the matching. BUG=544259 Committed: https://crrev.com/6104fb062821e3e8584ed2e40cdb3f77502d88f0 Cr-Commit-Position: refs/heads/master@{#358935}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : fix android compile, renamed a field in MRDC #

Patch Set 5 : Fix compile again #

Total comments: 36

Patch Set 6 : Addressed mfoltz's comments #

Total comments: 12

Patch Set 7 : Addressed Mounir's comments #

Patch Set 8 : Rebase #

Patch Set 9 : Fix compile #

Total comments: 16

Patch Set 10 : Addressed mfoltz's comments #16 #

Patch Set 11 : remove s #

Total comments: 8

Patch Set 12 : Addressed comments #20, #22 #

Total comments: 22

Patch Set 13 : Addressed comment #26 + add back main frame logic #

Patch Set 14 : Rebase #

Patch Set 15 : fix compile #

Patch Set 16 : Compile fix x2 #

Patch Set 17 : Original patch #

Unified diffs Side-by-side diffs Delta from patch set Stats (+755 lines, -844 lines) Patch
M chrome/browser/media/android/router/media_router_dialog_controller_android.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 5 chunks +15 lines, -14 lines 0 comments Download
A + chrome/browser/media/router/create_presentation_connection_request.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +17 lines, -14 lines 0 comments Download
A + chrome/browser/media/router/create_presentation_connection_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +10 lines, -11 lines 0 comments Download
A + chrome/browser/media/router/create_presentation_connection_request_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +26 lines, -27 lines 0 comments Download
M chrome/browser/media/router/create_presentation_session_request.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -77 lines 0 comments Download
M chrome/browser/media/router/create_presentation_session_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -73 lines 0 comments Download
M chrome/browser/media/router/create_presentation_session_request_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +0 lines, -103 lines 0 comments Download
M chrome/browser/media/router/media_router.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +5 lines, -2 lines 0 comments Download
M chrome/browser/media/router/media_router_dialog_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +9 lines, -8 lines 0 comments Download
M chrome/browser/media/router/media_router_dialog_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +6 lines, -6 lines 0 comments Download
A chrome/browser/media/router/presentation_request.h View 1 2 3 4 5 1 chunk +49 lines, -0 lines 0 comments Download
A chrome/browser/media/router/presentation_request.cc View 1 2 3 4 5 6 7 8 9 1 chunk +31 lines, -0 lines 0 comments Download
A chrome/browser/media/router/presentation_request_unittest.cc View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
M chrome/browser/media/router/presentation_service_delegate_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 7 chunks +72 lines, -74 lines 0 comments Download
M chrome/browser/media/router/presentation_service_delegate_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 20 chunks +175 lines, -86 lines 0 comments Download
M chrome/browser/media/router/presentation_service_delegate_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 7 chunks +126 lines, -53 lines 0 comments Download
A chrome/browser/media/router/render_frame_host_id.h View 1 chunk +16 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_dialog_controller_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_ui.h View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +20 lines, -19 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_ui.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +56 lines, -45 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -1 line 0 comments Download
M content/browser/presentation/presentation_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +6 lines, -28 lines 0 comments Download
M content/browser/presentation/presentation_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +9 lines, -57 lines 0 comments Download
M content/browser/presentation/presentation_service_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 7 chunks +35 lines, -103 lines 0 comments Download
M content/common/presentation/presentation_service.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +13 lines, -13 lines 0 comments Download
M content/public/browser/presentation_service_delegate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +12 lines, -16 lines 0 comments Download
M content/renderer/presentation/presentation_dispatcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M content/renderer/presentation/presentation_dispatcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +0 lines, -8 lines 0 comments Download

Messages

Total messages: 35 (12 generated)
imcheng
mark: PTAL
5 years, 2 months ago (2015-10-19 22:01:23 UTC) #4
mark a. foltz
Thanks for the mojom and general cleanup around this! I didn't quite follow the refactoring ...
5 years, 2 months ago (2015-10-20 20:15:25 UTC) #5
imcheng
On 2015/10/20 20:15:25, mfoltz_ooo_until_11_2 wrote: > Thanks for the mojom and general cleanup around this! ...
5 years, 2 months ago (2015-10-24 00:39:52 UTC) #6
imcheng
+Mounir to review the patch while mfoltz is OOO. PTAL at everything, thanks. https://codereview.chromium.org/1406013003/diff/80001/chrome/browser/media/android/router/media_router_dialog_controller_android.cc File ...
5 years, 2 months ago (2015-10-24 00:41:19 UTC) #8
imcheng
Ping for Mounir.
5 years, 1 month ago (2015-10-26 20:41:03 UTC) #9
mlamouri (slow - plz ping)
It's a big CL so I need to digest it. I left a few comments ...
5 years, 1 month ago (2015-10-27 18:42:52 UTC) #10
imcheng
On 2015/10/27 18:42:52, Mounir Lamouri wrote: > It's a big CL so I need to ...
5 years, 1 month ago (2015-10-27 20:50:00 UTC) #11
imcheng
https://codereview.chromium.org/1406013003/diff/100001/chrome/browser/media/android/router/media_router_dialog_controller_android.cc File chrome/browser/media/android/router/media_router_dialog_controller_android.cc (right): https://codereview.chromium.org/1406013003/diff/100001/chrome/browser/media/android/router/media_router_dialog_controller_android.cc#newcode42 chrome/browser/media/android/router/media_router_dialog_controller_android.cc:42: TakePresentationRequest()); On 2015/10/27 18:42:51, Mounir Lamouri wrote: > I ...
5 years, 1 month ago (2015-10-27 20:50:15 UTC) #12
imcheng
5 years, 1 month ago (2015-10-29 21:20:46 UTC) #14
mark a. foltz
Overall looks good, some feedback on the API in PresentationServiceDelegateImpl. Per conversation, make sure that ...
5 years, 1 month ago (2015-11-04 02:07:25 UTC) #16
imcheng
+Mounir for chrome/browser/media/android/router/media_router_dialog_controller_android.cc, but feel free to re-review the whole patch. Let's have a separate ...
5 years, 1 month ago (2015-11-04 20:35:20 UTC) #18
whywhat
android/ lgtm with a nit https://codereview.chromium.org/1406013003/diff/200001/chrome/browser/media/android/router/media_router_dialog_controller_android.cc File chrome/browser/media/android/router/media_router_dialog_controller_android.cc (right): https://codereview.chromium.org/1406013003/diff/200001/chrome/browser/media/android/router/media_router_dialog_controller_android.cc#newcode43 chrome/browser/media/android/router/media_router_dialog_controller_android.cc:43: const MediaSource::Id source_id(presentation_request.GetMediaSource().id()); nit: ...
5 years, 1 month ago (2015-11-06 11:45:56 UTC) #20
mlamouri (slow - plz ping)
It sgtm but I wonder if your change wrt ListenForDefaultSessionStart is correct. I think we ...
5 years, 1 month ago (2015-11-06 14:46:43 UTC) #22
imcheng
On 2015/11/06 14:46:43, Mounir Lamouri wrote: > It sgtm but I wonder if your change ...
5 years, 1 month ago (2015-11-07 02:00:35 UTC) #23
imcheng
PTAL https://codereview.chromium.org/1406013003/diff/200001/chrome/browser/media/android/router/media_router_dialog_controller_android.cc File chrome/browser/media/android/router/media_router_dialog_controller_android.cc (right): https://codereview.chromium.org/1406013003/diff/200001/chrome/browser/media/android/router/media_router_dialog_controller_android.cc#newcode43 chrome/browser/media/android/router/media_router_dialog_controller_android.cc:43: const MediaSource::Id source_id(presentation_request.GetMediaSource().id()); On 2015/11/06 11:45:56, whywhat wrote: ...
5 years, 1 month ago (2015-11-07 02:00:46 UTC) #24
mlamouri (slow - plz ping)
lgtm
5 years, 1 month ago (2015-11-09 17:54:58 UTC) #25
mark a. foltz
LGTM. Mostly minor comments around documentation. https://codereview.chromium.org/1406013003/diff/220001/chrome/browser/media/router/create_presentation_session_request.h File chrome/browser/media/router/create_presentation_session_request.h (right): https://codereview.chromium.org/1406013003/diff/220001/chrome/browser/media/router/create_presentation_session_request.h#newcode30 chrome/browser/media/router/create_presentation_session_request.h:30: class CreatePresentationSessionRequest { ...
5 years, 1 month ago (2015-11-09 18:33:36 UTC) #26
imcheng
Addressed comments. I also added back the main frame logic to PSDImpl (i.e., only the ...
5 years, 1 month ago (2015-11-10 18:49:13 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1406013003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1406013003/300001
5 years, 1 month ago (2015-11-10 22:36:13 UTC) #30
commit-bot: I haz the power
Committed patchset #16 (id:300001)
5 years, 1 month ago (2015-11-10 22:50:49 UTC) #31
commit-bot: I haz the power
Patchset 16 (id:??) landed as https://crrev.com/6104fb062821e3e8584ed2e40cdb3f77502d88f0 Cr-Commit-Position: refs/heads/master@{#358935}
5 years, 1 month ago (2015-11-10 22:51:27 UTC) #32
robliao
A revert of this CL (patchset #16 id:300001) has been created in https://codereview.chromium.org/1436703002/ by robliao@chromium.org. ...
5 years, 1 month ago (2015-11-11 01:29:14 UTC) #34
robliao
5 years, 1 month ago (2015-11-11 01:47:15 UTC) #35
Message was sent while issue was closed.
On 2015/11/11 01:29:14, robliao wrote:
> A revert of this CL (patchset #16 id:300001) has been created in
> https://codereview.chromium.org/1436703002/ by mailto:robliao@chromium.org.
> 
> The reason for reverting is: Prime suspect in causing
> 
> mojo_runner_unittests mojo_runner_unittests 
> failures:
> BackgroundApplicationLoaderTest.Load
> NativeApplicationLoaderTest.DoesNotExist
> 
>
https://build.chromium.org/p/chromium.linux/builders/Android%20GN/builds/32013.

One more failing test on
https://build.chromium.org/p/chromium.linux/builders/Android%20Tests%20%28dbg...

content_unittests content_unittests 
failures:
PresentationServiceImplTest.SetDefaultPresentationUrl

Powered by Google App Engine
This is Rietveld 408576698