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

Side by Side Diff: content/browser/media/android/browser_media_player_manager.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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_player_manager.h" 5 #include "content/browser/media/android/browser_media_player_manager.h"
6 6
7 #include "base/android/scoped_java_ref.h" 7 #include "base/android/scoped_java_ref.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "content/browser/android/content_view_core_impl.h" 10 #include "content/browser/android/content_view_core_impl.h"
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 uint32 session_id, 384 uint32 session_id,
385 const std::string& web_session_id) { 385 const std::string& web_session_id) {
386 Send(new CdmMsg_SessionCreated( 386 Send(new CdmMsg_SessionCreated(
387 routing_id(), cdm_id, session_id, web_session_id)); 387 routing_id(), cdm_id, session_id, web_session_id));
388 } 388 }
389 389
390 void BrowserMediaPlayerManager::OnSessionMessage( 390 void BrowserMediaPlayerManager::OnSessionMessage(
391 int cdm_id, 391 int cdm_id,
392 uint32 session_id, 392 uint32 session_id,
393 const std::vector<uint8>& message, 393 const std::vector<uint8>& message,
394 const std::string& destination_url) { 394 const GURL& destination_url) {
395 GURL destination_gurl(destination_url); 395 GURL verified_gurl = destination_url;
396 if (!destination_gurl.is_valid() && !destination_gurl.is_empty()) { 396 if (!verified_gurl.is_valid() && !verified_gurl.is_empty()) {
xhwang 2014/05/22 18:44:52 This seems redundant on Android. But I think keepi
397 DLOG(WARNING) << "SessionMessage destination_url is invalid : " 397 DLOG(WARNING) << "SessionMessage destination_url is invalid : "
398 << destination_gurl.possibly_invalid_spec(); 398 << destination_url.possibly_invalid_spec();
399 destination_gurl = GURL::EmptyGURL(); // Replace invalid destination_url. 399 verified_gurl = GURL::EmptyGURL(); // Replace invalid destination_url.
400 } 400 }
401 401
402 Send(new CdmMsg_SessionMessage( 402 Send(new CdmMsg_SessionMessage(
403 routing_id(), cdm_id, session_id, message, destination_gurl)); 403 routing_id(), cdm_id, session_id, message, verified_gurl));
404 } 404 }
405 405
406 void BrowserMediaPlayerManager::OnSessionReady(int cdm_id, uint32 session_id) { 406 void BrowserMediaPlayerManager::OnSessionReady(int cdm_id, uint32 session_id) {
407 Send(new CdmMsg_SessionReady(routing_id(), cdm_id, session_id)); 407 Send(new CdmMsg_SessionReady(routing_id(), cdm_id, session_id));
408 } 408 }
409 409
410 void BrowserMediaPlayerManager::OnSessionClosed(int cdm_id, uint32 session_id) { 410 void BrowserMediaPlayerManager::OnSessionClosed(int cdm_id, uint32 session_id) {
411 Send(new CdmMsg_SessionClosed(routing_id(), cdm_id, session_id)); 411 Send(new CdmMsg_SessionClosed(routing_id(), cdm_id, session_id));
412 } 412 }
413 413
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 #if defined(VIDEO_HOLE) 892 #if defined(VIDEO_HOLE)
893 MediaPlayerAndroid* player = GetPlayer(player_id); 893 MediaPlayerAndroid* player = GetPlayer(player_id);
894 if (player && player->IsSurfaceInUse()) 894 if (player && player->IsSurfaceInUse())
895 return; 895 return;
896 if (external_video_surface_container_) 896 if (external_video_surface_container_)
897 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); 897 external_video_surface_container_->ReleaseExternalVideoSurface(player_id);
898 #endif // defined(VIDEO_HOLE) 898 #endif // defined(VIDEO_HOLE)
899 } 899 }
900 900
901 } // namespace content 901 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698