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

Side by Side Diff: content/gpu/gpu_service_factory.h

Issue 2882813002: media: Convert mojo media defines to buildflags (Closed)
Patch Set: rebase Created 3 years, 7 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 | « content/gpu/BUILD.gn ('k') | content/gpu/gpu_service_factory.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef CONTENT_GPU_GPU_SERVICE_FACTORY_H_ 5 #ifndef CONTENT_GPU_GPU_SERVICE_FACTORY_H_
6 #define CONTENT_GPU_GPU_SERVICE_FACTORY_H_ 6 #define CONTENT_GPU_GPU_SERVICE_FACTORY_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
11 #include "base/single_thread_task_runner.h" 11 #include "base/single_thread_task_runner.h"
12 #include "content/child/service_factory.h" 12 #include "content/child/service_factory.h"
13 #include "media/mojo/features.h"
13 14
14 namespace media { 15 namespace media {
15 class MediaGpuChannelManager; 16 class MediaGpuChannelManager;
16 } 17 }
17 18
18 namespace content { 19 namespace content {
19 20
20 // Customization of ServiceFactory for the GPU process. 21 // Customization of ServiceFactory for the GPU process.
21 class GpuServiceFactory : public ServiceFactory { 22 class GpuServiceFactory : public ServiceFactory {
22 public: 23 public:
23 explicit GpuServiceFactory( 24 explicit GpuServiceFactory(
24 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager); 25 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager);
25 ~GpuServiceFactory() override; 26 ~GpuServiceFactory() override;
26 27
27 // ServiceFactory overrides: 28 // ServiceFactory overrides:
28 void RegisterServices(ServiceMap* services) override; 29 void RegisterServices(ServiceMap* services) override;
29 30
30 private: 31 private:
31 #if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS) 32 #if BUILDFLAG(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
32 // Task runner we were constructed on, and that |media_gpu_channel_manager_| 33 // Task runner we were constructed on, and that |media_gpu_channel_manager_|
33 // must be accessed from (the GPU main thread task runner). We expect 34 // must be accessed from (the GPU main thread task runner). We expect
34 // RegisterServices() to be called on this task runner as well, but the 35 // RegisterServices() to be called on this task runner as well, but the
35 // implementation doesn't care. 36 // implementation doesn't care.
36 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 37 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
37 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager_; 38 base::WeakPtr<media::MediaGpuChannelManager> media_gpu_channel_manager_;
38 #endif 39 #endif
39 40
40 DISALLOW_COPY_AND_ASSIGN(GpuServiceFactory); 41 DISALLOW_COPY_AND_ASSIGN(GpuServiceFactory);
41 }; 42 };
42 43
43 } // namespace content 44 } // namespace content
44 45
45 #endif // CONTENT_GPU_GPU_SERVICE_FACTORY_H_ 46 #endif // CONTENT_GPU_GPU_SERVICE_FACTORY_H_
OLDNEW
« no previous file with comments | « content/gpu/BUILD.gn ('k') | content/gpu/gpu_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698