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

Unified Diff: media/base/android/media_drm_bridge.cc

Issue 297703002: Using GURL in place of std::string for destination_url (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/pepper/content_decryptor_delegate.cc ('k') | media/base/android/media_player_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_drm_bridge.cc
diff --git a/media/base/android/media_drm_bridge.cc b/media/base/android/media_drm_bridge.cc
index 6b022dfbd31b36aa2d96f4b66f8c108f00e7e41a..e1f14dc06e625df7ab66ab002e3506577c884158 100644
--- a/media/base/android/media_drm_bridge.cc
+++ b/media/base/android/media_drm_bridge.cc
@@ -473,8 +473,13 @@ void MediaDrmBridge::OnSessionMessage(JNIEnv* env,
uint32 session_id = j_session_id;
std::vector<uint8> message;
JavaByteArrayToByteVector(env, j_message, &message);
- std::string destination_url = ConvertJavaStringToUTF8(env, j_destination_url);
- session_message_cb_.Run(session_id, message, destination_url);
+ GURL destination_gurl = GURL(ConvertJavaStringToUTF8(env, j_destination_url));
+ if (!destination_gurl.is_valid() && !destination_gurl.is_empty()) {
+ DLOG(WARNING) << "SessionMessage destination_url is invalid : "
+ << destination_gurl.possibly_invalid_spec();
+ destination_gurl = GURL::EmptyGURL(); // Replace invalid destination_url.
+ }
+ session_message_cb_.Run(session_id, message, destination_gurl);
}
void MediaDrmBridge::OnSessionReady(JNIEnv* env,
« no previous file with comments | « content/renderer/pepper/content_decryptor_delegate.cc ('k') | media/base/android/media_player_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698