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

Side by Side Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 408873004: Fix for cross-origin video check for webgl on android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pass allow_credentials to android mediaplayer Created 6 years, 5 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 | Annotate | Revision Log
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/renderer/media/android/webmediaplayer_android.h" 5 #include "content/renderer/media/android/webmediaplayer_android.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 base::Bind(&WebMediaPlayerAndroid::OnDurationChanged, 221 base::Bind(&WebMediaPlayerAndroid::OnDurationChanged,
222 weak_factory_.GetWeakPtr())); 222 weak_factory_.GetWeakPtr()));
223 } 223 }
224 } else { 224 } else {
225 info_loader_.reset( 225 info_loader_.reset(
226 new MediaInfoLoader( 226 new MediaInfoLoader(
227 url, 227 url,
228 cors_mode, 228 cors_mode,
229 base::Bind(&WebMediaPlayerAndroid::DidLoadMediaInfo, 229 base::Bind(&WebMediaPlayerAndroid::DidLoadMediaInfo,
230 weak_factory_.GetWeakPtr()))); 230 weak_factory_.GetWeakPtr())));
231 // TODO(qinmin): The url might be redirected when android media player
232 // requests the stream. As a result, we cannot guarantee there is only
233 // a single origin. Remove the following line when b/12573548 is fixed.
234 // Check http://crbug.com/334204.
palmer 2014/07/22 19:19:47 We should retain this comment, and re-open issue 3
qinmin 2014/07/30 03:12:02 moved it to another place
235 info_loader_->set_single_origin(false);
236 info_loader_->Start(frame_); 231 info_loader_->Start(frame_);
237 } 232 }
238 233
239 url_ = url; 234 url_ = url;
240 GURL first_party_url = frame_->document().firstPartyForCookies(); 235 GURL first_party_url = frame_->document().firstPartyForCookies();
241 player_manager_->Initialize( 236 player_manager_->Initialize(
242 player_type_, player_id_, url, first_party_url, demuxer_client_id, 237 player_type_, player_id_, url, first_party_url, demuxer_client_id,
243 frame_->document().url()); 238 frame_->document().url(), hasSingleSecurityOrigin(),
239 cors_mode != CORSModeAnonymous);
244 240
245 if (player_manager_->ShouldEnterFullscreen(frame_)) 241 if (player_manager_->ShouldEnterFullscreen(frame_))
246 player_manager_->EnterFullscreen(player_id_, frame_); 242 player_manager_->EnterFullscreen(player_id_, frame_);
247 243
248 UpdateNetworkState(WebMediaPlayer::NetworkStateLoading); 244 UpdateNetworkState(WebMediaPlayer::NetworkStateLoading);
249 UpdateReadyState(WebMediaPlayer::ReadyStateHaveNothing); 245 UpdateReadyState(WebMediaPlayer::ReadyStateHaveNothing);
250 } 246 }
251 247
252 void WebMediaPlayerAndroid::DidLoadMediaInfo(MediaInfoLoader::Status status) { 248 void WebMediaPlayerAndroid::DidLoadMediaInfo(MediaInfoLoader::Status status) {
253 DCHECK(!media_source_delegate_); 249 DCHECK(!media_source_delegate_);
(...skipping 1283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 player_manager_->EnterFullscreen(player_id_, frame_); 1533 player_manager_->EnterFullscreen(player_id_, frame_);
1538 SetNeedsEstablishPeer(false); 1534 SetNeedsEstablishPeer(false);
1539 } 1535 }
1540 } 1536 }
1541 1537
1542 bool WebMediaPlayerAndroid::canEnterFullscreen() const { 1538 bool WebMediaPlayerAndroid::canEnterFullscreen() const {
1543 return player_manager_->CanEnterFullscreen(frame_); 1539 return player_manager_->CanEnterFullscreen(frame_);
1544 } 1540 }
1545 1541
1546 } // namespace content 1542 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698