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

Issue 2252783004: Implement MediaSession (metadata) per frame [NOT READY, HAS DEPENDENCY] (Closed)

Created:
4 years, 4 months ago by Zhiqiang Zhang (Slow)
Modified:
4 years, 2 months ago
CC:
avayvod+watch_chromium.org, blink-reviews, chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, feature-media-reviews_chromium.org, haraken, jam, mlamouri+watch-media_chromium.org, nasko+codewatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement MediaSession (metadata) per frame This CL makes MediaSession as an extension to window.navigator. There is now a MediaSession instance associated with each frame. This is part of a greater effort to keep blink::MediaSession in sync with spec. Existing MediaSession constructors and activate/deactivate is preserved. They will be further removed when we have made final decisions on the spec. The LayoutTests are out-dated but currently it is not possible to update them since the implementation is Android-only. See https://crbug.com/646490 Spec explainer: https://github.com/WICG/mediasession/blob/master/explainer.md Feature status: https://www.chromestatus.com/features/5639924124483584 BUG=643190

Patch Set 1 #

Patch Set 2 : using base::Optional<Metadata> #

Patch Set 3 : ignore setMetadata() for non-top-level frames #

Patch Set 4 : rebased and fixed null-metadata issue in Java #

Patch Set 5 : rebased #

Patch Set 6 : rebasing #

Patch Set 7 : minor fixes #

Total comments: 26

Patch Set 8 : addressed Anton's comments #

Total comments: 3

Patch Set 9 : addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -31 lines) Patch
M content/browser/media/android/browser_media_session_manager.h View 1 2 3 4 5 6 7 3 chunks +17 lines, -3 lines 0 comments Download
M content/browser/media/android/browser_media_session_manager.cc View 1 2 3 4 5 6 7 3 chunks +13 lines, -4 lines 0 comments Download
M content/browser/media/android/browser_media_session_manager_browsertest.cc View 1 2 3 4 5 6 7 8 5 chunks +10 lines, -12 lines 0 comments Download
M content/browser/media/android/media_web_contents_observer_android.cc View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 2 chunks +12 lines, -1 line 0 comments Download
M content/renderer/media/android/renderer_media_session_manager.cc View 1 2 3 4 5 6 7 3 chunks +9 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/modules/mediasession/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/mediasession/MediaSession.h View 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/modules/mediasession/MediaSession.cpp View 1 2 3 4 5 6 3 chunks +7 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/mediasession/NavigatorMediaSession.h View 1 2 3 4 5 6 7 8 1 chunk +34 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/modules/mediasession/NavigatorMediaSession.cpp View 1 2 3 4 5 6 7 8 1 chunk +45 lines, -0 lines 0 comments Download
A + third_party/WebKit/Source/modules/mediasession/NavigatorMediaSession.idl View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/modules/modules_idl_files.gni View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 27 (10 generated)
Zhiqiang Zhang (Slow)
This is an implementation for MediaSession per frame. * Adding it as a partial interface ...
4 years, 3 months ago (2016-09-13 15:39:22 UTC) #2
whywhat
On 2016/09/13 at 15:39:22, zqzhang wrote: > This is an implementation for MediaSession per frame. ...
4 years, 3 months ago (2016-09-13 16:02:24 UTC) #4
Zhiqiang Zhang (Slow)
On 2016/09/13 16:02:24, whywhat wrote: > On 2016/09/13 at 15:39:22, zqzhang wrote: > > This ...
4 years, 3 months ago (2016-09-13 16:05:33 UTC) #6
whywhat
lgtm with nits https://codereview.chromium.org/2252783004/diff/120001/content/browser/android/web_contents_observer_proxy.h File content/browser/android/web_contents_observer_proxy.h (right): https://codereview.chromium.org/2252783004/diff/120001/content/browser/android/web_contents_observer_proxy.h#newcode12 content/browser/android/web_contents_observer_proxy.h:12: #include "base/optional.h" nit: looks like an ...
4 years, 3 months ago (2016-09-13 16:23:26 UTC) #7
Zhiqiang Zhang (Slow)
Some quick replies. https://codereview.chromium.org/2252783004/diff/120001/content/browser/media/android/browser_media_session_manager.cc File content/browser/media/android/browser_media_session_manager.cc (right): https://codereview.chromium.org/2252783004/diff/120001/content/browser/media/android/browser_media_session_manager.cc#newcode44 content/browser/media/android/browser_media_session_manager.cc:44: render_frame_host_->GetProcess()->ShutdownForBadMessage(); On 2016/09/13 16:23:26, whywhat wrote: ...
4 years, 3 months ago (2016-09-13 17:15:56 UTC) #8
Zhiqiang Zhang (Slow)
https://codereview.chromium.org/2252783004/diff/120001/content/renderer/media/android/renderer_media_session_manager.cc File content/renderer/media/android/renderer_media_session_manager.cc (left): https://codereview.chromium.org/2252783004/diff/120001/content/renderer/media/android/renderer_media_session_manager.cc#oldcode23 content/renderer/media/android/renderer_media_session_manager.cc:23: DCHECK(sessions_.empty()) On 2016/09/13 16:23:26, whywhat wrote: > why removing ...
4 years, 3 months ago (2016-09-13 17:27:29 UTC) #9
Zhiqiang Zhang (Slow)
https://codereview.chromium.org/2252783004/diff/120001/content/browser/android/web_contents_observer_proxy.h File content/browser/android/web_contents_observer_proxy.h (right): https://codereview.chromium.org/2252783004/diff/120001/content/browser/android/web_contents_observer_proxy.h#newcode12 content/browser/android/web_contents_observer_proxy.h:12: #include "base/optional.h" On 2016/09/13 16:23:26, whywhat wrote: > nit: ...
4 years, 3 months ago (2016-09-13 18:51:52 UTC) #10
Zhiqiang Zhang (Slow)
+jochen to review contents/*
4 years, 3 months ago (2016-09-13 19:27:30 UTC) #15
haraken
https://codereview.chromium.org/2252783004/diff/180001/third_party/WebKit/Source/modules/mediasession/NavigatorMediaSession.h File third_party/WebKit/Source/modules/mediasession/NavigatorMediaSession.h (right): https://codereview.chromium.org/2252783004/diff/180001/third_party/WebKit/Source/modules/mediasession/NavigatorMediaSession.h#newcode17 third_party/WebKit/Source/modules/mediasession/NavigatorMediaSession.h:17: class NavigatorMediaSession final : public GarbageCollected<NavigatorMediaSession>, public Supplement<Navigator>, public ...
4 years, 3 months ago (2016-09-14 00:10:46 UTC) #17
jochen (gone - plz use gerrit)
can we have tests please? can you add a link to the intent to implement ...
4 years, 3 months ago (2016-09-14 08:45:04 UTC) #18
mlamouri (slow - plz ping)
On the content/ side, the current code is android/ specific but also strongly linked with ...
4 years, 3 months ago (2016-09-14 10:08:45 UTC) #19
mlamouri (slow - plz ping)
On 2016/09/14 at 08:45:04, jochen wrote: > can we have tests please? > > can ...
4 years, 3 months ago (2016-09-14 10:10:33 UTC) #20
Zhiqiang Zhang (Slow)
On 2016/09/14 10:10:33, mlamouri wrote: > On 2016/09/14 at 08:45:04, jochen wrote: > > can ...
4 years, 3 months ago (2016-09-14 14:07:49 UTC) #22
Zhiqiang Zhang (Slow)
PTAL. Addressed reviewer's comments. Bisides, I updated the browser tests. Changes to LayoutTests is not ...
4 years, 3 months ago (2016-09-14 14:11:31 UTC) #24
jochen (gone - plz use gerrit)
does the fact that it's android only mean that we still have the old api ...
4 years, 3 months ago (2016-09-15 10:21:05 UTC) #25
Zhiqiang Zhang (Slow)
On 2016/09/15 10:21:05, jochen wrote: > does the fact that it's android only mean that ...
4 years, 3 months ago (2016-09-15 10:31:28 UTC) #26
Zhiqiang Zhang (Slow)
4 years, 3 months ago (2016-09-15 10:45:38 UTC) #27
On 2016/09/15 10:31:28, Zhiqiang Zhang wrote:
> On 2016/09/15 10:21:05, jochen wrote:
> > does the fact that it's android only mean that we still have the old api on
> > desktop? I'm not sure I understand why it's not possible to update the
layout
> > tests... we could also just skip them on platforms where they don't work?
> 
> It's in `RenderFrameImpl::createMediaSession()`, it returns a null
MediaSession
> for desktop.
> We are going to make this available for Desktop in follow-up CL, we will
update
> the layout tests in that CL.
> Due to other dependencies, it cannot be landed before this one.
> 
> BTW, the current layout tests for MediaSession does not make much sense, so
> updating them in this CL does not have benefit. See:
>
https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/virtual/m...
>
https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/virtual/m...
> They all get "Failed to construct 'MediaSession': Missing platform
> implementation."

I discussed with Mounir, and we decided to write another CL first, which moves
all Android-only code available to desktop, and use mojo service to replace the
IPC.
So we'll come back for this CL after that.

Powered by Google App Engine
This is Rietveld 408576698