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

Side by Side Diff: media/mojo/clients/mojo_renderer.cc

Issue 2434413002: Plumb firstPartyForCookies() to MediaPlayerBridge (Closed)
Patch Set: Added bug number to TODO Created 4 years, 2 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "media/mojo/clients/mojo_renderer.h" 5 #include "media/mojo/clients/mojo_renderer.h"
6 6
7 #include <utility> 7 #include <utility>
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 BindRemoteRendererIfNeeded(); 105 BindRemoteRendererIfNeeded();
106 106
107 mojom::RendererClientAssociatedPtrInfo client_ptr_info; 107 mojom::RendererClientAssociatedPtrInfo client_ptr_info;
108 client_binding_.Bind(&client_ptr_info, remote_renderer_.associated_group()); 108 client_binding_.Bind(&client_ptr_info, remote_renderer_.associated_group());
109 109
110 // Using base::Unretained(this) is safe because |this| owns 110 // Using base::Unretained(this) is safe because |this| owns
111 // |remote_renderer_|, and the callback won't be dispatched if 111 // |remote_renderer_|, and the callback won't be dispatched if
112 // |remote_renderer_| is destroyed. 112 // |remote_renderer_| is destroyed.
113 remote_renderer_->Initialize( 113 remote_renderer_->Initialize(
114 std::move(client_ptr_info), std::move(audio_stream), 114 std::move(client_ptr_info), std::move(audio_stream),
115 std::move(video_stream), base::nullopt, 115 std::move(video_stream), base::nullopt, base::nullopt,
116 base::Bind(&MojoRenderer::OnInitialized, base::Unretained(this), client)); 116 base::Bind(&MojoRenderer::OnInitialized, base::Unretained(this), client));
117 } 117 }
118 118
119 void MojoRenderer::InitializeRendererFromUrl(media::RendererClient* client) { 119 void MojoRenderer::InitializeRendererFromUrl(media::RendererClient* client) {
120 DVLOG(2) << __FUNCTION__; 120 DVLOG(2) << __FUNCTION__;
121 DCHECK(task_runner_->BelongsToCurrentThread()); 121 DCHECK(task_runner_->BelongsToCurrentThread());
122 122
123 BindRemoteRendererIfNeeded(); 123 BindRemoteRendererIfNeeded();
124 124
125 mojom::RendererClientAssociatedPtrInfo client_ptr_info; 125 mojom::RendererClientAssociatedPtrInfo client_ptr_info;
126 client_binding_.Bind(&client_ptr_info, remote_renderer_.associated_group()); 126 client_binding_.Bind(&client_ptr_info, remote_renderer_.associated_group());
127 127
128 MediaUrlParams url_params = demuxer_stream_provider_->GetMediaUrlParams();
129
128 // Using base::Unretained(this) is safe because |this| owns 130 // Using base::Unretained(this) is safe because |this| owns
129 // |remote_renderer_|, and the callback won't be dispatched if 131 // |remote_renderer_|, and the callback won't be dispatched if
130 // |remote_renderer_| is destroyed. 132 // |remote_renderer_| is destroyed.
131 remote_renderer_->Initialize( 133 remote_renderer_->Initialize(
132 std::move(client_ptr_info), mojom::DemuxerStreamPtr(), 134 std::move(client_ptr_info), mojom::DemuxerStreamPtr(),
133 mojom::DemuxerStreamPtr(), demuxer_stream_provider_->GetUrl(), 135 mojom::DemuxerStreamPtr(), url_params.media_url,
136 url_params.first_party_for_cookies,
134 base::Bind(&MojoRenderer::OnInitialized, base::Unretained(this), client)); 137 base::Bind(&MojoRenderer::OnInitialized, base::Unretained(this), client));
135 } 138 }
136 139
137 void MojoRenderer::SetCdm(CdmContext* cdm_context, 140 void MojoRenderer::SetCdm(CdmContext* cdm_context,
138 const CdmAttachedCB& cdm_attached_cb) { 141 const CdmAttachedCB& cdm_attached_cb) {
139 DVLOG(1) << __FUNCTION__; 142 DVLOG(1) << __FUNCTION__;
140 DCHECK(task_runner_->BelongsToCurrentThread()); 143 DCHECK(task_runner_->BelongsToCurrentThread());
141 DCHECK(cdm_context); 144 DCHECK(cdm_context);
142 DCHECK(!cdm_attached_cb.is_null()); 145 DCHECK(!cdm_attached_cb.is_null());
143 DCHECK(cdm_attached_cb_.is_null()); 146 DCHECK(cdm_attached_cb_.is_null());
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED); 413 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
411 414
412 if (!flush_cb_.is_null()) 415 if (!flush_cb_.is_null())
413 base::ResetAndReturn(&flush_cb_).Run(); 416 base::ResetAndReturn(&flush_cb_).Run();
414 417
415 if (!cdm_attached_cb_.is_null()) 418 if (!cdm_attached_cb_.is_null())
416 base::ResetAndReturn(&cdm_attached_cb_).Run(false); 419 base::ResetAndReturn(&cdm_attached_cb_).Run(false);
417 } 420 }
418 421
419 } // namespace media 422 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698