| 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_BROWSER_GPU_PROCESS_HOST_H_ | 5 #ifndef CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
| 6 #define CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 6 #define CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/browser_child_process_host.h" | 13 #include "chrome/browser/browser_child_process_host.h" |
| 14 #include "chrome/browser/renderer_host/resource_message_filter.h" | 14 #include "chrome/browser/renderer_host/resource_message_filter.h" |
| 15 #include "chrome/common/gpu_info.h" | 15 #include "chrome/common/gpu_info.h" |
| 16 #include "gfx/native_widget_types.h" | 16 #include "gfx/native_widget_types.h" |
| 17 | 17 |
| 18 class CommandBufferProxy; | 18 class CommandBufferProxy; |
| 19 struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params; |
| 19 | 20 |
| 20 namespace IPC { | 21 namespace IPC { |
| 21 struct ChannelHandle; | 22 struct ChannelHandle; |
| 22 class Message; | 23 class Message; |
| 23 } | 24 } |
| 24 | 25 |
| 25 class GpuProcessHost : public BrowserChildProcessHost { | 26 class GpuProcessHost : public BrowserChildProcessHost { |
| 26 public: | 27 public: |
| 27 // Getter for the singleton. This will return NULL on failure. | 28 // Getter for the singleton. This will return NULL on failure. |
| 28 static GpuProcessHost* Get(); | 29 static GpuProcessHost* Get(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 bool Init(); | 81 bool Init(); |
| 81 | 82 |
| 82 void OnControlMessageReceived(const IPC::Message& message); | 83 void OnControlMessageReceived(const IPC::Message& message); |
| 83 | 84 |
| 84 // Message handlers. | 85 // Message handlers. |
| 85 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle, | 86 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle, |
| 86 const GPUInfo& gpu_info); | 87 const GPUInfo& gpu_info); |
| 87 void OnSynchronizeReply(); | 88 void OnSynchronizeReply(); |
| 88 #if defined(OS_LINUX) | 89 #if defined(OS_LINUX) |
| 89 void OnGetViewXID(gfx::NativeViewId id, unsigned long* xid); | 90 void OnGetViewXID(gfx::NativeViewId id, unsigned long* xid); |
| 91 #elif defined(OS_MACOSX) |
| 92 void OnAcceleratedSurfaceSetIOSurface( |
| 93 const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params); |
| 94 void OnAcceleratedSurfaceBuffersSwapped(int32 renderer_id, |
| 95 int32 render_view_id, |
| 96 gfx::PluginWindowHandle window); |
| 90 #endif | 97 #endif |
| 91 | 98 |
| 92 void ReplyToRenderer(const IPC::ChannelHandle& channel, | 99 void ReplyToRenderer(const IPC::ChannelHandle& channel, |
| 93 ResourceMessageFilter* filter); | 100 ResourceMessageFilter* filter); |
| 94 | 101 |
| 95 // ResourceDispatcherHost::Receiver implementation: | 102 // ResourceDispatcherHost::Receiver implementation: |
| 96 virtual URLRequestContext* GetRequestContext( | 103 virtual URLRequestContext* GetRequestContext( |
| 97 uint32 request_id, | 104 uint32 request_id, |
| 98 const ViewHostMsg_Resource_Request& request_data); | 105 const ViewHostMsg_Resource_Request& request_data); |
| 99 | 106 |
| 100 virtual bool CanShutdown(); | 107 virtual bool CanShutdown(); |
| 101 | 108 |
| 102 bool initialized_; | 109 bool initialized_; |
| 103 bool initialized_successfully_; | 110 bool initialized_successfully_; |
| 104 | 111 |
| 105 // GPUInfo class used for collecting gpu stats | 112 // GPUInfo class used for collecting gpu stats |
| 106 GPUInfo gpu_info_; | 113 GPUInfo gpu_info_; |
| 107 | 114 |
| 108 // These are the channel requests that we have already sent to | 115 // These are the channel requests that we have already sent to |
| 109 // the GPU process, but haven't heard back about yet. | 116 // the GPU process, but haven't heard back about yet. |
| 110 std::queue<ChannelRequest> sent_requests_; | 117 std::queue<ChannelRequest> sent_requests_; |
| 111 | 118 |
| 112 // The pending synchronization requests we need to reply to. | 119 // The pending synchronization requests we need to reply to. |
| 113 std::queue<SynchronizationRequest> queued_synchronization_replies_; | 120 std::queue<SynchronizationRequest> queued_synchronization_replies_; |
| 114 | 121 |
| 115 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 122 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 116 }; | 123 }; |
| 117 | 124 |
| 118 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 125 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
| OLD | NEW |