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

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

Issue 2434673002: media: Rename MojoMediaApplication to MediaService (Closed)
Patch Set: media: Rename MojoMediaApplication to MediaService 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
« no previous file with comments | « media/mojo/services/mojo_cdm_service.h ('k') | media/mojo/services/mojo_media_application.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11
12 #include "base/callback.h"
13 #include "base/compiler_specific.h"
14 #include "base/memory/ref_counted.h"
15 #include "media/mojo/interfaces/media_service.mojom.h"
16 #include "media/mojo/interfaces/service_factory.mojom.h"
17 #include "media/mojo/services/media_mojo_export.h"
18 #include "mojo/public/cpp/bindings/binding_set.h"
19 #include "services/service_manager/public/cpp/interface_factory.h"
20 #include "services/service_manager/public/cpp/service.h"
21 #include "services/service_manager/public/cpp/service_context_ref.h"
22 #include "url/gurl.h"
23
24 namespace media {
25
26 class MediaLog;
27 class MojoMediaClient;
28
29 class MEDIA_MOJO_EXPORT MojoMediaApplication
30 : public NON_EXPORTED_BASE(service_manager::Service),
31 public NON_EXPORTED_BASE(
32 service_manager::InterfaceFactory<mojom::MediaService>),
33 public NON_EXPORTED_BASE(mojom::MediaService) {
34 public:
35 MojoMediaApplication(std::unique_ptr<MojoMediaClient> mojo_media_client,
36 const base::Closure& quit_closure);
37 ~MojoMediaApplication() final;
38
39 private:
40 // service_manager::Service implementation.
41 void OnStart(const service_manager::Identity& identity) final;
42 bool OnConnect(const service_manager::Identity& remote_identity,
43 service_manager::InterfaceRegistry* registry) final;
44 bool OnStop() final;
45
46 // service_manager::InterfaceFactory<mojom::MediaService> implementation.
47 void Create(const service_manager::Identity& remote_identity,
48 mojom::MediaServiceRequest request) final;
49
50 // mojom::MediaService implementation.
51 void CreateServiceFactory(
52 mojom::ServiceFactoryRequest request,
53 service_manager::mojom::InterfaceProviderPtr remote_interfaces) final;
54
55 // Note: Since each instance runs on a different thread, do not share a common
56 // MojoMediaClient with other instances to avoid threading issues. Hence using
57 // a unique_ptr here.
58 std::unique_ptr<MojoMediaClient> mojo_media_client_;
59
60 scoped_refptr<MediaLog> media_log_;
61 service_manager::ServiceContextRefFactory ref_factory_;
62
63 mojo::BindingSet<mojom::MediaService> bindings_;
64 };
65
66 } // namespace media
67
68 #endif // MEDIA_MOJO_SERVICES_MOJO_MEDIA_APPLICATION_H_
OLDNEW
« no previous file with comments | « media/mojo/services/mojo_cdm_service.h ('k') | media/mojo/services/mojo_media_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698