| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_RENDERER_GPU_CHANNEL_HOST_H_ | 5 #ifndef CHROME_RENDERER_GPU_CHANNEL_HOST_H_ |
| 6 #define CHROME_RENDERER_GPU_CHANNEL_HOST_H_ | 6 #define CHROME_RENDERER_GPU_CHANNEL_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/hash_tables.h" | 12 #include "base/hash_tables.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "chrome/common/gpu_feature_flags.h" |
| 14 #include "chrome/common/gpu_info.h" | 15 #include "chrome/common/gpu_info.h" |
| 15 #include "chrome/common/message_router.h" | 16 #include "chrome/common/message_router.h" |
| 16 #include "gfx/native_widget_types.h" | 17 #include "gfx/native_widget_types.h" |
| 17 #include "gfx/size.h" | 18 #include "gfx/size.h" |
| 18 #include "ipc/ipc_channel.h" | 19 #include "ipc/ipc_channel.h" |
| 19 #include "ipc/ipc_message.h" | 20 #include "ipc/ipc_message.h" |
| 20 #include "ipc/ipc_sync_channel.h" | 21 #include "ipc/ipc_sync_channel.h" |
| 21 | 22 |
| 22 class CommandBufferProxy; | 23 class CommandBufferProxy; |
| 23 class GpuVideoServiceHost; | 24 class GpuVideoServiceHost; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 | 45 |
| 45 // Connect to GPU process channel. | 46 // Connect to GPU process channel. |
| 46 void Connect(const std::string& channel_name); | 47 void Connect(const std::string& channel_name); |
| 47 | 48 |
| 48 State state() const { return state_; } | 49 State state() const { return state_; } |
| 49 | 50 |
| 50 // The GPU stats reported by the GPU process. | 51 // The GPU stats reported by the GPU process. |
| 51 void set_gpu_info(const GPUInfo& gpu_info); | 52 void set_gpu_info(const GPUInfo& gpu_info); |
| 52 const GPUInfo& gpu_info() const; | 53 const GPUInfo& gpu_info() const; |
| 53 | 54 |
| 55 // The GPU feature flags established by Browser using blacklist information. |
| 56 void set_gpu_feature_flags(const GpuFeatureFlags& gpu_feature_flags); |
| 57 const GpuFeatureFlags& gpu_feature_flags() const; |
| 58 |
| 54 // IPC::Channel::Listener implementation: | 59 // IPC::Channel::Listener implementation: |
| 55 virtual void OnMessageReceived(const IPC::Message& msg); | 60 virtual void OnMessageReceived(const IPC::Message& msg); |
| 56 virtual void OnChannelConnected(int32 peer_pid); | 61 virtual void OnChannelConnected(int32 peer_pid); |
| 57 virtual void OnChannelError(); | 62 virtual void OnChannelError(); |
| 58 | 63 |
| 59 // IPC::Message::Sender implementation: | 64 // IPC::Message::Sender implementation: |
| 60 virtual bool Send(IPC::Message* msg); | 65 virtual bool Send(IPC::Message* msg); |
| 61 | 66 |
| 62 // Create and connect to a command buffer in the GPU process. | 67 // Create and connect to a command buffer in the GPU process. |
| 63 CommandBufferProxy* CreateViewCommandBuffer( | 68 CommandBufferProxy* CreateViewCommandBuffer( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 78 void DestroyCommandBuffer(CommandBufferProxy* command_buffer); | 83 void DestroyCommandBuffer(CommandBufferProxy* command_buffer); |
| 79 | 84 |
| 80 GpuVideoServiceHost* gpu_video_service_host() { | 85 GpuVideoServiceHost* gpu_video_service_host() { |
| 81 return gpu_video_service_host_.get(); | 86 return gpu_video_service_host_.get(); |
| 82 } | 87 } |
| 83 | 88 |
| 84 private: | 89 private: |
| 85 State state_; | 90 State state_; |
| 86 | 91 |
| 87 GPUInfo gpu_info_; | 92 GPUInfo gpu_info_; |
| 93 GpuFeatureFlags gpu_feature_flags_; |
| 88 | 94 |
| 89 scoped_ptr<IPC::SyncChannel> channel_; | 95 scoped_ptr<IPC::SyncChannel> channel_; |
| 90 | 96 |
| 91 // Used to implement message routing functionality to CommandBufferProxy | 97 // Used to implement message routing functionality to CommandBufferProxy |
| 92 // objects | 98 // objects |
| 93 MessageRouter router_; | 99 MessageRouter router_; |
| 94 | 100 |
| 95 // Keep track of all the registered CommandBufferProxies to | 101 // Keep track of all the registered CommandBufferProxies to |
| 96 // inform about OnChannelError | 102 // inform about OnChannelError |
| 97 typedef base::hash_map<int, IPC::Channel::Listener*> ProxyMap; | 103 typedef base::hash_map<int, IPC::Channel::Listener*> ProxyMap; |
| 98 ProxyMap proxies_; | 104 ProxyMap proxies_; |
| 99 | 105 |
| 100 // This is a MessageFilter to intercept IPC messages and distribute them | 106 // This is a MessageFilter to intercept IPC messages and distribute them |
| 101 // to the corresponding GpuVideoDecoderHost. | 107 // to the corresponding GpuVideoDecoderHost. |
| 102 scoped_refptr<GpuVideoServiceHost> gpu_video_service_host_; | 108 scoped_refptr<GpuVideoServiceHost> gpu_video_service_host_; |
| 103 | 109 |
| 104 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 110 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 105 }; | 111 }; |
| 106 | 112 |
| 107 #endif // CHROME_RENDERER_GPU_CHANNEL_HOST_H_ | 113 #endif // CHROME_RENDERER_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |