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

Issue 1478643002: Refactor media out of WebContentsImpl to MediaWebContentsObserver. (Closed)

Created:
5 years ago by DaleCurtis
Modified:
5 years ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, posciak+watch_chromium.org, nasko+codewatch_chromium.org, jam, mcasas+watch_chromium.org, feature-media-reviews_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, mlamouri (slow - plz ping), Min Qin, dominickn
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor media out of WebContentsImpl to MediaWebContentsObserver. Pulls out the power save blocker management into the existing media WebContentsObserver in preparation for sharing the desktop and Android code paths for media playback. MediaWebContentsObserver will become a MediaObserver in the future and pass back playback control messages for both the android and desktop implementations. This is mostly just a cleanup without any functionality change, except for: - A fix to SiteEngagementHelper which was assuming there was only one player sending notifications per WebContents. - A change to the WebContentsObserver API to make the above clearer to future implementors. - A change to when the WCO API is called to make sure pause only comes after play for implementor sanity. Previously a pause may come during player destruction as well, even if a play was never seen. It gets a little weird extracting this functionality from the WebContentsImpl implementation since it is still responsible for vending play/pause observer notifications. Suggestions welcome! BUG=529887 TEST=existing unit tests still pass. Committed: https://crrev.com/88c24007f6dc13d7e9e6b249e734ba5b668e8023 Cr-Commit-Position: refs/heads/master@{#363906}

Patch Set 1 #

Patch Set 2 : Finish. #

Patch Set 3 : Remove cruft. #

Total comments: 15

Patch Set 4 : Fix bugs. Add sanity test. #

Patch Set 5 : Fix android. #

Total comments: 2

Patch Set 6 : Rename. Rebase. Fix. #

Patch Set 7 : Fix namespace for cast. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+416 lines, -310 lines) Patch
M chrome/browser/engagement/site_engagement_helper.h View 1 2 3 4 5 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/engagement/site_engagement_helper.cc View 1 2 3 4 5 1 chunk +14 lines, -8 lines 0 comments Download
M chrome/browser/engagement/site_engagement_helper_unittest.cc View 1 2 3 4 5 3 chunks +7 lines, -5 lines 0 comments Download
M chromecast/browser/cast_content_window.h View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chromecast/browser/cast_content_window.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/BUILD.gn View 1 2 3 4 5 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/media/media_web_contents_observer.h View 1 2 3 2 chunks +79 lines, -16 lines 0 comments Download
M content/browser/media/media_web_contents_observer.cc View 1 2 3 4 5 4 chunks +211 lines, -22 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 8 chunks +6 lines, -52 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 14 chunks +16 lines, -164 lines 0 comments Download
M content/browser/web_contents/web_contents_impl_unittest.cc View 1 5 chunks +39 lines, -26 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 2 chunks +2 lines, -3 lines 0 comments Download
M content/public/browser/web_contents_observer.h View 1 2 3 4 5 1 chunk +8 lines, -5 lines 0 comments Download
M content/test/web_contents_observer_sanity_checker.h View 1 2 3 4 5 2 chunks +3 lines, -0 lines 0 comments Download
M content/test/web_contents_observer_sanity_checker.cc View 1 2 3 4 5 3 chunks +23 lines, -0 lines 0 comments Download

Messages

Total messages: 34 (14 generated)
DaleCurtis
raymes: chrome/browser/engagement halliwell: chromecast ncarter: content/ cc:mlamouri, qinmin as an FYI in case they want ...
5 years ago (2015-12-02 01:38:13 UTC) #3
halliwell
On 2015/12/02 01:38:13, DaleCurtis wrote: > raymes: chrome/browser/engagement > halliwell: chromecast > ncarter: content/ > ...
5 years ago (2015-12-02 01:41:40 UTC) #4
raymes
I defer to calamity for site engagement stuff (I should probably be removed from the ...
5 years ago (2015-12-02 02:01:18 UTC) #6
calamity
site_engagement lgtm. Thanks for fixing the issue for us! +cc dominickn FYI.
5 years ago (2015-12-02 03:09:45 UTC) #7
ncarter (slow)
https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.cc File content/browser/media/media_web_contents_observer.cc (right): https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.cc#newcode68 content/browser/media/media_web_contents_observer.cc:68: render_frame_host); If you use IPC_BEGIN_MESSAGE_MAP_WITH_PARAM, you can cause the ...
5 years ago (2015-12-02 17:49:31 UTC) #8
DaleCurtis
(Just comments) https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h File content/browser/media/media_web_contents_observer.h (right): https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h#newcode116 content/browser/media/media_web_contents_observer.h:116: WebContentsImpl* web_contents_; On 2015/12/02 17:49:31, ncarter wrote: ...
5 years ago (2015-12-02 19:55:46 UTC) #9
qinmin
https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h File content/browser/media/media_web_contents_observer.h (right): https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h#newcode116 content/browser/media/media_web_contents_observer.h:116: WebContentsImpl* web_contents_; On 2015/12/02 19:55:46, DaleCurtis wrote: > On ...
5 years ago (2015-12-02 21:54:58 UTC) #11
DaleCurtis
https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h File content/browser/media/media_web_contents_observer.h (right): https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h#newcode116 content/browser/media/media_web_contents_observer.h:116: WebContentsImpl* web_contents_; On 2015/12/02 21:54:58, qinmin wrote: > On ...
5 years ago (2015-12-03 01:35:08 UTC) #12
qinmin
https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h File content/browser/media/media_web_contents_observer.h (right): https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h#newcode116 content/browser/media/media_web_contents_observer.h:116: WebContentsImpl* web_contents_; On 2015/12/03 01:35:08, DaleCurtis wrote: > On ...
5 years ago (2015-12-03 15:46:31 UTC) #13
DaleCurtis
Nick, thanks for the sanity test check, it found a bug with duplicate notification delivery ...
5 years ago (2015-12-04 01:36:28 UTC) #15
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1478643002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1478643002/80001
5 years ago (2015-12-04 01:41:19 UTC) #17
qinmin
lgtm
5 years ago (2015-12-04 19:12:03 UTC) #18
ncarter (slow)
https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h File content/browser/media/media_web_contents_observer.h (right): https://codereview.chromium.org/1478643002/diff/40001/content/browser/media/media_web_contents_observer.h#newcode116 content/browser/media/media_web_contents_observer.h:116: WebContentsImpl* web_contents_; On 2015/12/04 01:36:27, DaleCurtis wrote: > On ...
5 years ago (2015-12-05 00:43:33 UTC) #19
DaleCurtis
https://codereview.chromium.org/1478643002/diff/40001/content/public/browser/web_contents_observer.h File content/public/browser/web_contents_observer.h (right): https://codereview.chromium.org/1478643002/diff/40001/content/public/browser/web_contents_observer.h#newcode432 content/public/browser/web_contents_observer.h:432: virtual void MediaStartedPlaying(const MediaPlayerId& id) {} On 2015/12/05 00:43:33, ...
5 years ago (2015-12-05 01:18:02 UTC) #20
ncarter (slow)
lgtm, thanks for all the fixes!
5 years ago (2015-12-07 18:33:42 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1478643002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1478643002/140001
5 years ago (2015-12-08 21:25:25 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: cast_shell_linux on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/cast_shell_linux/builds/90100)
5 years ago (2015-12-08 21:49:16 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1478643002/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1478643002/160001
5 years ago (2015-12-08 22:06:01 UTC) #30
commit-bot: I haz the power
Committed patchset #7 (id:160001)
5 years ago (2015-12-09 02:11:28 UTC) #32
commit-bot: I haz the power
5 years ago (2015-12-09 02:12:19 UTC) #34
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/88c24007f6dc13d7e9e6b249e734ba5b668e8023
Cr-Commit-Position: refs/heads/master@{#363906}

Powered by Google App Engine
This is Rietveld 408576698