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

Side by Side Diff: content/browser/media/android/browser_media_session_manager.cc

Issue 2387113004: Better bad message reporting from IO thread (Closed)
Patch Set: cleanup 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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/android/browser_media_session_manager.h" 5 #include "content/browser/media/android/browser_media_session_manager.h"
6 6
7 #include "base/optional.h" 7 #include "base/optional.h"
8 #include "content/browser/media/session/media_session.h" 8 #include "content/browser/media/session/media_session.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/common/media/media_metadata_sanitizer.h" 10 #include "content/common/media/media_metadata_sanitizer.h"
(...skipping 18 matching lines...) Expand all
29 Send(new MediaSessionMsg_DidDeactivate(GetRoutingID(), request_id)); 29 Send(new MediaSessionMsg_DidDeactivate(GetRoutingID(), request_id));
30 } 30 }
31 31
32 void BrowserMediaSessionManager::OnSetMetadata( 32 void BrowserMediaSessionManager::OnSetMetadata(
33 int session_id, 33 int session_id,
34 const base::Optional<MediaMetadata>& insecure_metadata) { 34 const base::Optional<MediaMetadata>& insecure_metadata) {
35 // When receiving a MediaMetadata, the browser process can't trust that it is 35 // When receiving a MediaMetadata, the browser process can't trust that it is
36 // coming from a known and secure source. It must be processed accordingly. 36 // coming from a known and secure source. It must be processed accordingly.
37 if (insecure_metadata.has_value() && 37 if (insecure_metadata.has_value() &&
38 !MediaMetadataSanitizer::CheckSanity(insecure_metadata.value())) { 38 !MediaMetadataSanitizer::CheckSanity(insecure_metadata.value())) {
39 render_frame_host_->GetProcess()->ShutdownForBadMessage(); 39 render_frame_host_->GetProcess()->ShutdownForBadMessage(
40 RenderProcessHost::CrashReportMode::GENERATE_CRASH_DUMP);
40 return; 41 return;
41 } 42 }
42 43
43 NOTIMPLEMENTED(); 44 NOTIMPLEMENTED();
44 } 45 }
45 46
46 int BrowserMediaSessionManager::GetRoutingID() const { 47 int BrowserMediaSessionManager::GetRoutingID() const {
47 return render_frame_host_->GetRoutingID(); 48 return render_frame_host_->GetRoutingID();
48 } 49 }
49 50
50 bool BrowserMediaSessionManager::Send(IPC::Message* msg) { 51 bool BrowserMediaSessionManager::Send(IPC::Message* msg) {
51 return render_frame_host_->Send(msg); 52 return render_frame_host_->Send(msg);
52 } 53 }
53 54
54 } // namespace content 55 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698