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

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: addressing comments, adding checks 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
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 b6272596c74d5cd6a7765d0ec35365f83c7ef9b0..144767dc059681c26dd338b8a2e3d7ca1122e8c0 100644
--- a/media/base/android/media_drm_bridge.cc
+++ b/media/base/android/media_drm_bridge.cc
@@ -433,8 +433,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,

Powered by Google App Engine
This is Rietveld 408576698