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

Side by Side Diff: media/mojo/services/mojo_media_application.cc

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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/services/mojo_cdm_service.cc ('k') | media/mojo/services/mojo_renderer_service.h » ('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/services/mojo_media_application.h" 5 #include "media/mojo/services/mojo_media_application.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "media/base/media_log.h" 9 #include "media/base/media_log.h"
10 #include "media/mojo/services/mojo_media_client.h" 10 #include "media/mojo/services/mojo_media_client.h"
11 #include "media/mojo/services/service_factory_impl.h" 11 #include "media/mojo/services/service_factory_impl.h"
12 #include "mojo/public/cpp/bindings/strong_binding.h"
12 #include "services/shell/public/cpp/connection.h" 13 #include "services/shell/public/cpp/connection.h"
13 #include "services/shell/public/cpp/connector.h" 14 #include "services/shell/public/cpp/connector.h"
14 15
15 namespace media { 16 namespace media {
16 17
17 // TODO(xhwang): Hook up MediaLog when possible. 18 // TODO(xhwang): Hook up MediaLog when possible.
18 MojoMediaApplication::MojoMediaApplication( 19 MojoMediaApplication::MojoMediaApplication(
19 std::unique_ptr<MojoMediaClient> mojo_media_client, 20 std::unique_ptr<MojoMediaClient> mojo_media_client,
20 const base::Closure& quit_closure) 21 const base::Closure& quit_closure)
21 : mojo_media_client_(std::move(mojo_media_client)), 22 : mojo_media_client_(std::move(mojo_media_client)),
(...skipping 24 matching lines...) Expand all
46 bindings_.AddBinding(this, std::move(request)); 47 bindings_.AddBinding(this, std::move(request));
47 } 48 }
48 49
49 void MojoMediaApplication::CreateServiceFactory( 50 void MojoMediaApplication::CreateServiceFactory(
50 mojom::ServiceFactoryRequest request, 51 mojom::ServiceFactoryRequest request,
51 shell::mojom::InterfaceProviderPtr remote_interfaces) { 52 shell::mojom::InterfaceProviderPtr remote_interfaces) {
52 // Ignore request if service has already stopped. 53 // Ignore request if service has already stopped.
53 if (!mojo_media_client_) 54 if (!mojo_media_client_)
54 return; 55 return;
55 56
56 // The created object is owned by the pipe. 57 mojo::MakeStrongBinding(
57 new ServiceFactoryImpl(std::move(request), std::move(remote_interfaces), 58 base::MakeUnique<ServiceFactoryImpl>(std::move(remote_interfaces),
58 media_log_, ref_factory_.CreateRef(), 59 media_log_, ref_factory_.CreateRef(),
59 mojo_media_client_.get()); 60 mojo_media_client_.get()),
61 std::move(request));
60 } 62 }
61 63
62 } // namespace media 64 } // namespace media
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm_service.cc ('k') | media/mojo/services/mojo_renderer_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698