OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/browser/media/android/browser_media_session_manager.h" | |
6 | |
7 #include "base/optional.h" | |
8 #include "content/browser/media/session/media_session.h" | |
9 #include "content/browser/web_contents/web_contents_impl.h" | |
10 #include "content/common/media/media_metadata_sanitizer.h" | |
11 #include "content/public/browser/render_frame_host.h" | |
12 #include "content/public/browser/render_process_host.h" | |
13 #include "content/public/common/media_metadata.h" | |
14 | |
15 namespace content { | |
16 | |
17 BrowserMediaSessionManager::BrowserMediaSessionManager( | |
18 RenderFrameHost* render_frame_host) | |
19 : render_frame_host_(render_frame_host) {} | |
20 | |
21 void BrowserMediaSessionManager::OnSetMetadata( | |
22 int session_id, | |
23 const base::Optional<MediaMetadata>& insecure_metadata) { | |
24 // When receiving a MediaMetadata, the browser process can't trust that it is | |
25 // coming from a known and secure source. It must be processed accordingly. | |
26 if (insecure_metadata.has_value() && | |
27 !MediaMetadataSanitizer::CheckSanity(insecure_metadata.value())) { | |
28 render_frame_host_->GetProcess()->ShutdownForBadMessage( | |
29 RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP); | |
30 return; | |
31 } | |
32 | |
33 NOTIMPLEMENTED(); | |
34 } | |
35 | |
36 } // namespace content | |
OLD | NEW |