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

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

Issue 2698063002: Mojo C++ bindings: remove usage of AssociatedGroup from media/ (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « media/mojo/clients/mojo_audio_decoder.cc ('k') | media/mojo/clients/mojo_video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 mojo_stream->set_connection_error_handler( 101 mojo_stream->set_connection_error_handler(
102 base::Bind(&MojoRenderer::OnDemuxerStreamConnectionError, 102 base::Bind(&MojoRenderer::OnDemuxerStreamConnectionError,
103 base::Unretained(this), mojo_stream.get())); 103 base::Unretained(this), mojo_stream.get()));
104 streams_.push_back(std::move(mojo_stream)); 104 streams_.push_back(std::move(mojo_stream));
105 streams.push_back(std::move(video_stream)); 105 streams.push_back(std::move(video_stream));
106 } 106 }
107 107
108 BindRemoteRendererIfNeeded(); 108 BindRemoteRendererIfNeeded();
109 109
110 mojom::RendererClientAssociatedPtrInfo client_ptr_info; 110 mojom::RendererClientAssociatedPtrInfo client_ptr_info;
111 client_binding_.Bind(&client_ptr_info, remote_renderer_.associated_group()); 111 client_binding_.Bind(&client_ptr_info);
112 112
113 // Using base::Unretained(this) is safe because |this| owns 113 // Using base::Unretained(this) is safe because |this| owns
114 // |remote_renderer_|, and the callback won't be dispatched if 114 // |remote_renderer_|, and the callback won't be dispatched if
115 // |remote_renderer_| is destroyed. 115 // |remote_renderer_| is destroyed.
116 remote_renderer_->Initialize( 116 remote_renderer_->Initialize(
117 std::move(client_ptr_info), std::move(streams), base::nullopt, 117 std::move(client_ptr_info), std::move(streams), base::nullopt,
118 base::nullopt, 118 base::nullopt,
119 base::Bind(&MojoRenderer::OnInitialized, base::Unretained(this), client)); 119 base::Bind(&MojoRenderer::OnInitialized, base::Unretained(this), client));
120 } 120 }
121 121
122 void MojoRenderer::InitializeRendererFromUrl(media::RendererClient* client) { 122 void MojoRenderer::InitializeRendererFromUrl(media::RendererClient* client) {
123 DVLOG(2) << __func__; 123 DVLOG(2) << __func__;
124 DCHECK(task_runner_->BelongsToCurrentThread()); 124 DCHECK(task_runner_->BelongsToCurrentThread());
125 125
126 BindRemoteRendererIfNeeded(); 126 BindRemoteRendererIfNeeded();
127 127
128 mojom::RendererClientAssociatedPtrInfo client_ptr_info; 128 mojom::RendererClientAssociatedPtrInfo client_ptr_info;
129 client_binding_.Bind(&client_ptr_info, remote_renderer_.associated_group()); 129 client_binding_.Bind(&client_ptr_info);
130 130
131 MediaUrlParams url_params = media_resource_->GetMediaUrlParams(); 131 MediaUrlParams url_params = media_resource_->GetMediaUrlParams();
132 132
133 // Using base::Unretained(this) is safe because |this| owns 133 // Using base::Unretained(this) is safe because |this| owns
134 // |remote_renderer_|, and the callback won't be dispatched if 134 // |remote_renderer_|, and the callback won't be dispatched if
135 // |remote_renderer_| is destroyed. 135 // |remote_renderer_| is destroyed.
136 std::vector<mojom::DemuxerStreamPtr> streams; 136 std::vector<mojom::DemuxerStreamPtr> streams;
137 remote_renderer_->Initialize( 137 remote_renderer_->Initialize(
138 std::move(client_ptr_info), std::move(streams), url_params.media_url, 138 std::move(client_ptr_info), std::move(streams), url_params.media_url,
139 url_params.first_party_for_cookies, 139 url_params.first_party_for_cookies,
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED); 391 base::ResetAndReturn(&init_cb_).Run(PIPELINE_ERROR_INITIALIZATION_FAILED);
392 392
393 if (!flush_cb_.is_null()) 393 if (!flush_cb_.is_null())
394 base::ResetAndReturn(&flush_cb_).Run(); 394 base::ResetAndReturn(&flush_cb_).Run();
395 395
396 if (!cdm_attached_cb_.is_null()) 396 if (!cdm_attached_cb_.is_null())
397 base::ResetAndReturn(&cdm_attached_cb_).Run(false); 397 base::ResetAndReturn(&cdm_attached_cb_).Run(false);
398 } 398 }
399 399
400 } // namespace media 400 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/clients/mojo_audio_decoder.cc ('k') | media/mojo/clients/mojo_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698