Index: content/browser/media/android/browser_media_session_manager.cc |
diff --git a/content/browser/media/android/browser_media_session_manager.cc b/content/browser/media/android/browser_media_session_manager.cc |
index 146a60fe970ae9da7f0fe9a4b56f044ecdfeec77..c3684e6c05cdb668e0be15ecb5abd0822583db54 100644 |
--- a/content/browser/media/android/browser_media_session_manager.cc |
+++ b/content/browser/media/android/browser_media_session_manager.cc |
@@ -6,6 +6,7 @@ |
#include "content/common/media/media_session_messages_android.h" |
#include "content/public/browser/render_frame_host.h" |
+#include "content/public/common/media_metadata.h" |
namespace content { |
@@ -23,6 +24,25 @@ void BrowserMediaSessionManager::OnDeactivate(int session_id, int request_id) { |
Send(new MediaSessionMsg_DidDeactivate(GetRoutingID(), request_id)); |
} |
+void BrowserMediaSessionManager::OnSetMetadata( |
+ int session_id, |
+ const MediaMetadata& insecure_metadata) { |
+ // When receiving a MediaMetadata, the browser process can't trust that it is |
+ // coming from a known and secure source. It must be processed accordingly. |
+ MediaMetadata metadata = insecure_metadata; |
philipj_slow
2015/12/14 14:09:24
Can you initialize it to an empty struct, so that
mlamouri (slow - plz ping)
2016/01/05 16:01:16
Done.
|
+ metadata.title = base::NullableString16( |
+ metadata.title.string().substr(0, MediaMetadata::kMaxIPCStringLength), |
+ metadata.title.is_null()); |
+ metadata.artist = base::NullableString16( |
+ metadata.artist.string().substr(0, MediaMetadata::kMaxIPCStringLength), |
+ metadata.artist.is_null()); |
+ metadata.album = base::NullableString16( |
+ metadata.album.string().substr(0, MediaMetadata::kMaxIPCStringLength), |
+ metadata.album.is_null()); |
+ |
jochen (gone - plz use gerrit)
2015/12/14 12:38:30
kill the renderer if insecure_metadata != metadata
mlamouri (slow - plz ping)
2016/01/05 16:01:16
Done.
|
+ NOTIMPLEMENTED(); |
+} |
+ |
int BrowserMediaSessionManager::GetRoutingID() const { |
return render_frame_host_->GetRoutingID(); |
} |