OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_GPU_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ |
6 #define CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Create a surface in the GPU process. Returns null on failure. | 95 // Create a surface in the GPU process. Returns null on failure. |
96 GpuSurfaceProxy* CreateOffscreenSurface(const gfx::Size& size); | 96 GpuSurfaceProxy* CreateOffscreenSurface(const gfx::Size& size); |
97 | 97 |
98 // Destroy a surface in the GPU process. | 98 // Destroy a surface in the GPU process. |
99 void DestroySurface(GpuSurfaceProxy* surface); | 99 void DestroySurface(GpuSurfaceProxy* surface); |
100 | 100 |
101 TransportTextureService* transport_texture_service() { | 101 TransportTextureService* transport_texture_service() { |
102 return transport_texture_service_.get(); | 102 return transport_texture_service_.get(); |
103 } | 103 } |
104 | 104 |
| 105 // Called to add/remove a listener for a particular message routing ID. |
| 106 void AddRoute(int32 route_id, IPC::Channel::Listener* listener); |
| 107 void RemoveRoute(int32 route_id); |
| 108 |
105 private: | 109 private: |
106 State state_; | 110 State state_; |
107 | 111 |
108 GPUInfo gpu_info_; | 112 GPUInfo gpu_info_; |
109 | 113 |
110 scoped_ptr<IPC::SyncChannel> channel_; | 114 scoped_ptr<IPC::SyncChannel> channel_; |
111 | 115 |
112 // Used to implement message routing functionality to CommandBufferProxy | 116 // Used to implement message routing functionality to CommandBufferProxy |
113 // objects | 117 // objects |
114 MessageRouter router_; | 118 MessageRouter router_; |
115 | 119 |
116 // Keep track of all the registered CommandBufferProxies to | 120 // Keep track of all the registered CommandBufferProxies to |
117 // inform about OnChannelError | 121 // inform about OnChannelError |
118 typedef base::hash_map<int, CommandBufferProxy*> ProxyMap; | 122 typedef base::hash_map<int, CommandBufferProxy*> ProxyMap; |
119 ProxyMap proxies_; | 123 ProxyMap proxies_; |
120 | 124 |
121 // This is a MessageFilter to intercept IPC messages related to transport | 125 // This is a MessageFilter to intercept IPC messages related to transport |
122 // textures. These messages are routed to TransportTextureHost. | 126 // textures. These messages are routed to TransportTextureHost. |
123 scoped_refptr<TransportTextureService> transport_texture_service_; | 127 scoped_refptr<TransportTextureService> transport_texture_service_; |
124 | 128 |
125 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 129 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
126 }; | 130 }; |
127 | 131 |
128 #endif // CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ | 132 #endif // CONTENT_RENDERER_GPU_GPU_CHANNEL_HOST_H_ |
OLD | NEW |