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

Side by Side Diff: content/browser/media/session/media_session_service_impl.cc

Issue 2411353002: Propagate MediaMetadata to Java side (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/media/session/media_session_service_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/session/media_session_service_impl.h" 5 #include "content/browser/media/session/media_session_service_impl.h"
6 6
7 #include "content/browser/media/session/media_metadata_sanitizer.h" 7 #include "content/browser/media/session/media_metadata_sanitizer.h"
8 #include "content/browser/media/session/media_session.h"
8 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
10 #include "content/public/browser/web_contents.h" 11 #include "content/public/browser/web_contents.h"
11 12
12 namespace content { 13 namespace content {
13 14
14 MediaSessionServiceImpl::MediaSessionServiceImpl( 15 MediaSessionServiceImpl::MediaSessionServiceImpl(
15 RenderFrameHost* render_frame_host) 16 RenderFrameHost* render_frame_host)
16 : render_frame_host_(render_frame_host) {} 17 : render_frame_host_(render_frame_host) {}
17 18
(...skipping 12 matching lines...) Expand all
30 const base::Optional<content::MediaMetadata>& metadata) { 31 const base::Optional<content::MediaMetadata>& metadata) {
31 // When receiving a MediaMetadata, the browser process can't trust that it is 32 // When receiving a MediaMetadata, the browser process can't trust that it is
32 // coming from a known and secure source. It must be processed accordingly. 33 // coming from a known and secure source. It must be processed accordingly.
33 if (metadata.has_value() && 34 if (metadata.has_value() &&
34 !MediaMetadataSanitizer::CheckSanity(metadata.value())) { 35 !MediaMetadataSanitizer::CheckSanity(metadata.value())) {
35 render_frame_host_->GetProcess()->ShutdownForBadMessage( 36 render_frame_host_->GetProcess()->ShutdownForBadMessage(
36 RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP); 37 RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP);
37 return; 38 return;
38 } 39 }
39 40
40 metadata_ = metadata; 41 WebContentsImpl* contents = static_cast<WebContentsImpl*>(
41 42 WebContentsImpl::FromRenderFrameHost(render_frame_host_));
42 NOTIMPLEMENTED(); 43 if (contents)
44 MediaSession::Get(contents)->SetMetadata(metadata);
43 } 45 }
44 46
45 void MediaSessionServiceImpl::Bind( 47 void MediaSessionServiceImpl::Bind(
46 blink::mojom::MediaSessionServiceRequest request) { 48 blink::mojom::MediaSessionServiceRequest request) {
47 binding_.reset(new mojo::Binding<blink::mojom::MediaSessionService>( 49 binding_.reset(new mojo::Binding<blink::mojom::MediaSessionService>(
48 this, std::move(request))); 50 this, std::move(request)));
49 } 51 }
50 52
51 } // namespace content 53 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/session/media_session_service_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698