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

Issue 1224093004: [Media Router] 2nd take on fix route response callback lifetime in UI. (Closed)

Created:
5 years, 5 months ago by imcheng (use chromium acct)
Modified:
5 years, 5 months ago
CC:
chromium-reviews, media-router+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Media Router] 2nd take on fix route response callback lifetime in UI. This patch changes the MediaRouter CreateRoute/JoinRoute API to take multiple MediaRouteResponseCallbacks. We have a few scenarios in which we need to pass in different sets of callbacks: 1) non-presentation route request: update UI only 2) presentation route request as a result of pres API startSession: update UI + answer startSession request 3) presentation route request, browser initiated: update UI + trigger ondefaultsessionstart The callbacks are owned by the UI thread and are able to outlive the MRUI instance that made the CreateRoute call, in cases (2) and (3). Note that stale presentation API responses (i.e., made obsolete as a result of navigation) are dropped by PSImpl. Previous attempt at 1198993002. BUG=501441 Committed: https://crrev.com/cb9406372121b18de2763ef791b1572641ed5c49 Cr-Commit-Position: refs/heads/master@{#339337}

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : Changed ownership of MediaRouterDialogCallbacks to MRDC #

Patch Set 4 : Updated comment #

Patch Set 5 : make sure at least error_cb_ gets invoked on ~CSR #

Patch Set 6 : MediaRouterDialogCallbacks 1:1 Presentation route request. TODO: comments #

Patch Set 7 : Simplified further and added comments #

Patch Set 8 : Updated comments #

Total comments: 14

Patch Set 9 : Addressed Kevin's comments #

Total comments: 21

Patch Set 10 : change CreateRoute/JoinRoute to take a list of callbacks. update UI code to supply 1+ callbacks #

Patch Set 11 : Cleanup #

Patch Set 12 : Rename CreateSessionRequest -> CreatePresentationSessionRequest #

Patch Set 13 : Fix unit test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+266 lines, -441 lines) Patch
A + chrome/browser/media/router/create_presentation_session_request.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +12 lines, -11 lines 0 comments Download
A + chrome/browser/media/router/create_presentation_session_request.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +11 lines, -5 lines 0 comments Download
A + chrome/browser/media/router/create_presentation_session_request_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +25 lines, -20 lines 0 comments Download
D chrome/browser/media/router/create_session_request.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -71 lines 0 comments Download
M chrome/browser/media/router/create_session_request.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -51 lines 0 comments Download
D chrome/browser/media/router/create_session_request_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -110 lines 0 comments Download
M chrome/browser/media/router/media_router.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +17 lines, -13 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 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +14 lines, -12 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl.cc View 1 2 3 4 5 6 7 8 9 5 chunks +24 lines, -17 lines 0 comments Download
M chrome/browser/media/router/media_router_mojo_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 5 chunks +22 lines, -20 lines 0 comments Download
M chrome/browser/media/router/mock_media_router.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 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 2 chunks +4 lines, -4 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 6 chunks +28 lines, -21 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_dialog_controller.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +7 lines, -5 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 6 chunks +25 lines, -20 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 10 chunks +62 lines, -48 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/media_router/media_router_e2e_browsertest.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/media_router/media_router_e2e_browsertest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -4 lines 0 comments Download

Messages

Total messages: 25 (6 generated)
imcheng
kmarshall, mfoltz: PTAL at everything. I took the feedback from 1198993002 and started over. I ...
5 years, 5 months ago (2015-07-09 20:50:11 UTC) #2
imcheng
+Haibin, he had a comment about instantiating PSDImpl in MediaRouterDialogCallbacks which is not needed.
5 years, 5 months ago (2015-07-09 21:28:25 UTC) #4
haibinlu
https://codereview.chromium.org/1224093004/diff/20001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.h File chrome/browser/ui/webui/media_router/media_router_dialog_controller.h (right): https://codereview.chromium.org/1224093004/diff/20001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.h#newcode126 chrome/browser/ui/webui/media_router/media_router_dialog_controller.h:126: const base::WeakPtr<PresentationServiceDelegateImpl>& delegate); per offline discussion, it is clearer ...
5 years, 5 months ago (2015-07-09 21:45:59 UTC) #5
imcheng
https://codereview.chromium.org/1224093004/diff/20001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.h File chrome/browser/ui/webui/media_router/media_router_dialog_controller.h (right): https://codereview.chromium.org/1224093004/diff/20001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.h#newcode126 chrome/browser/ui/webui/media_router/media_router_dialog_controller.h:126: const base::WeakPtr<PresentationServiceDelegateImpl>& delegate); On 2015/07/09 21:45:59, haibinlu wrote: > ...
5 years, 5 months ago (2015-07-09 22:22:29 UTC) #6
imcheng
Chatted with Kevin, another approach that might simplify things is to have MediaRouterDialogCallbacks correspond with ...
5 years, 5 months ago (2015-07-09 22:44:33 UTC) #7
imcheng
I simplified the design a bit further. Now the callback object corresponds 1:1 with presentation ...
5 years, 5 months ago (2015-07-13 20:09:05 UTC) #8
Kevin M
This is much easier to grok. Thanks for your patience. https://codereview.chromium.org/1224093004/diff/140001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc File chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc (right): https://codereview.chromium.org/1224093004/diff/140001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc#newcode145 ...
5 years, 5 months ago (2015-07-13 21:55:26 UTC) #9
imcheng
Thanks! PTAL https://codereview.chromium.org/1224093004/diff/140001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc File chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc (right): https://codereview.chromium.org/1224093004/diff/140001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc#newcode145 chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc:145: virtual void OnPresentationRouteResponseReceived(scoped_ptr<MediaRoute> route, On 2015/07/13 21:55:26, ...
5 years, 5 months ago (2015-07-14 01:00:24 UTC) #10
haibinlu
https://codereview.chromium.org/1224093004/diff/160001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc File chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc (right): https://codereview.chromium.org/1224093004/diff/160001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc#newcode148 chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc:148: ProcessPresentationRouteResponse(route.get(), error); ProcessCreateRouteResponse https://codereview.chromium.org/1224093004/diff/160001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc#newcode201 chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc:201: delegate->OnRouteCreated(*route); how is browser ...
5 years, 5 months ago (2015-07-14 01:44:55 UTC) #11
imcheng
https://codereview.chromium.org/1224093004/diff/160001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc File chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc (right): https://codereview.chromium.org/1224093004/diff/160001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc#newcode148 chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc:148: ProcessPresentationRouteResponse(route.get(), error); On 2015/07/14 01:44:55, haibinlu wrote: > ProcessCreateRouteResponse ...
5 years, 5 months ago (2015-07-14 16:45:38 UTC) #12
mark a. foltz
It sounds like there have been a few approaches to this from the bug description ...
5 years, 5 months ago (2015-07-14 21:36:32 UTC) #13
imcheng
On 2015/07/14 21:36:32, mark a. foltz wrote: > It sounds like there have been a ...
5 years, 5 months ago (2015-07-16 01:06:41 UTC) #14
imcheng
https://codereview.chromium.org/1224093004/diff/160001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc File chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc (right): https://codereview.chromium.org/1224093004/diff/160001/chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc#newcode468 chrome/browser/ui/webui/media_router/media_router_dialog_controller.cc:468: // TODO(imcheng): Don't create PresentationServiceDelegateImpl if it doesn't On ...
5 years, 5 months ago (2015-07-16 01:06:53 UTC) #15
mark a. foltz
lgtm Thanks. This overall is a simpler design. I am not a big fan of ...
5 years, 5 months ago (2015-07-16 22:11:18 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224093004/220001
5 years, 5 months ago (2015-07-17 01:02:30 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/39660) (exceeded global retry quota)
5 years, 5 months ago (2015-07-17 01:38:07 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1224093004/240001
5 years, 5 months ago (2015-07-17 19:41:43 UTC) #23
commit-bot: I haz the power
Committed patchset #13 (id:240001)
5 years, 5 months ago (2015-07-17 21:44:14 UTC) #24
commit-bot: I haz the power
5 years, 5 months ago (2015-07-17 21:45:21 UTC) #25
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/cb9406372121b18de2763ef791b1572641ed5c49
Cr-Commit-Position: refs/heads/master@{#339337}

Powered by Google App Engine
This is Rietveld 408576698