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

Side by Side Diff: media/gpu/ipc/service/media_gpu_channel_manager.h

Issue 2864603002: Provide callback to create mojo AndroidOverlays to AVDA. (Closed)
Patch Set: fixed deps 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ 5 #ifndef MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_
6 #define MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ 6 #define MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <unordered_map> 11 #include <unordered_map>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
15 #include "base/unguessable_token.h" 15 #include "base/unguessable_token.h"
16 #include "ipc/ipc_listener.h" 16 #include "ipc/ipc_listener.h"
17 #include "ipc/ipc_sender.h" 17 #include "ipc/ipc_sender.h"
18 #include "media/video/video_decode_accelerator.h" 18 #include "media/video/video_decode_accelerator.h"
19 19
20 namespace gpu { 20 namespace gpu {
21 class GpuChannel; 21 class GpuChannel;
22 class GpuChannelManager; 22 class GpuChannelManager;
23 } 23 }
24 24
25 namespace service_manager {
26 class Connector;
27 }
28
25 namespace media { 29 namespace media {
26 30
27 class MediaGpuChannel; 31 class MediaGpuChannel;
28 32
29 class MediaGpuChannelManager 33 class MediaGpuChannelManager
30 : public base::SupportsWeakPtr<MediaGpuChannelManager> { 34 : public base::SupportsWeakPtr<MediaGpuChannelManager> {
31 public: 35 public:
32 explicit MediaGpuChannelManager(gpu::GpuChannelManager* channel_manager); 36 explicit MediaGpuChannelManager(gpu::GpuChannelManager* channel_manager);
33 ~MediaGpuChannelManager(); 37 ~MediaGpuChannelManager();
34 38
35 void AddChannel(int32_t client_id); 39 void AddChannel(int32_t client_id);
36 void RemoveChannel(int32_t client_id); 40 void RemoveChannel(int32_t client_id);
37 void DestroyAllChannels(); 41 void DestroyAllChannels();
38 42
43 void SetMojoConnector(service_manager::Connector* connector,
44 const char* browser_service_name);
45
39 // TODO(sandersd): Should we expose the MediaGpuChannel instead? 46 // TODO(sandersd): Should we expose the MediaGpuChannel instead?
40 gpu::GpuChannel* LookupChannel(const base::UnguessableToken& channel_token); 47 gpu::GpuChannel* LookupChannel(const base::UnguessableToken& channel_token);
41 48
42 private: 49 private:
43 gpu::GpuChannelManager* const channel_manager_; 50 gpu::GpuChannelManager* const channel_manager_;
44 std::unordered_map<int32_t, std::unique_ptr<MediaGpuChannel>> 51 std::unordered_map<int32_t, std::unique_ptr<MediaGpuChannel>>
45 media_gpu_channels_; 52 media_gpu_channels_;
46 std::map<base::UnguessableToken, int32_t> token_to_channel_; 53 std::map<base::UnguessableToken, int32_t> token_to_channel_;
47 std::map<int32_t, base::UnguessableToken> channel_to_token_; 54 std::map<int32_t, base::UnguessableToken> channel_to_token_;
55 service_manager::Connector* connector_ = nullptr;
56 const char* browser_service_name_ = nullptr;
48 DISALLOW_COPY_AND_ASSIGN(MediaGpuChannelManager); 57 DISALLOW_COPY_AND_ASSIGN(MediaGpuChannelManager);
49 }; 58 };
50 59
51 } // namespace media 60 } // namespace media
52 61
53 #endif // MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_ 62 #endif // MEDIA_GPU_IPC_SERVICE_MEDIA_GPU_CHANNEL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698