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

Side by Side Diff: content/renderer/media/media_factory.cc

Issue 2913153004: Fix MediaRemoting MediaObserver (Closed)
Patch Set: remove debugging Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/media_factory.h" 5 #include "content/renderer/media/media_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/metrics/field_trial_params.h" 9 #include "base/metrics/field_trial_params.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 #if BUILDFLAG(ENABLE_MEDIA_REMOTING) 342 #if BUILDFLAG(ENABLE_MEDIA_REMOTING)
343 media::mojom::RemotingSourcePtr remoting_source; 343 media::mojom::RemotingSourcePtr remoting_source;
344 auto remoting_source_request = mojo::MakeRequest(&remoting_source); 344 auto remoting_source_request = mojo::MakeRequest(&remoting_source);
345 media::mojom::RemoterPtr remoter; 345 media::mojom::RemoterPtr remoter;
346 GetRemoterFactory()->Create(std::move(remoting_source), 346 GetRemoterFactory()->Create(std::move(remoting_source),
347 mojo::MakeRequest(&remoter)); 347 mojo::MakeRequest(&remoter));
348 using RemotingController = media::remoting::RendererController; 348 using RemotingController = media::remoting::RendererController;
349 std::unique_ptr<RemotingController> remoting_controller( 349 std::unique_ptr<RemotingController> remoting_controller(
350 new RemotingController(new media::remoting::SharedSession( 350 new RemotingController(new media::remoting::SharedSession(
351 std::move(remoting_source_request), std::move(remoter)))); 351 std::move(remoting_source_request), std::move(remoter))));
352 base::WeakPtr<media::MediaObserver> media_observer = 352 *out_media_observer = remoting_controller->GetWeakPtr();
miu 2017/06/05 20:02:03 Hmm...Surprised the old code didn't generate a com
353 remoting_controller->GetWeakPtr();
354 353
355 auto courier_factory = 354 auto courier_factory =
356 base::MakeUnique<media::remoting::CourierRendererFactory>( 355 base::MakeUnique<media::remoting::CourierRendererFactory>(
357 std::move(remoting_controller)); 356 std::move(remoting_controller));
358 357
359 // base::Unretained is safe here because |factory_selector| owns 358 // base::Unretained is safe here because |factory_selector| owns
360 // |courier_factory|. 359 // |courier_factory|.
361 factory_selector->SetQueryIsRemotingActiveCB( 360 factory_selector->SetQueryIsRemotingActiveCB(
362 base::Bind(&media::remoting::CourierRendererFactory::IsRemotingActive, 361 base::Bind(&media::remoting::CourierRendererFactory::IsRemotingActive,
363 base::Unretained(courier_factory.get()))); 362 base::Unretained(courier_factory.get())));
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 DCHECK(remote_interfaces_); 492 DCHECK(remote_interfaces_);
494 media_interface_provider_.reset( 493 media_interface_provider_.reset(
495 new MediaInterfaceProvider(remote_interfaces_)); 494 new MediaInterfaceProvider(remote_interfaces_));
496 } 495 }
497 496
498 return media_interface_provider_.get(); 497 return media_interface_provider_.get();
499 } 498 }
500 #endif // BUILDFLAG(ENABLE_MOJO_MEDIA) 499 #endif // BUILDFLAG(ENABLE_MOJO_MEDIA)
501 500
502 } // namespace content 501 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698