| 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/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
| 14 #include "chrome/browser/browser_child_process_host.h" | 14 #include "chrome/browser/browser_child_process_host.h" |
| 15 #include "gfx/native_widget_types.h" | 15 #include "gfx/native_widget_types.h" |
| 16 | 16 |
| 17 struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params; | |
| 18 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | |
| 19 class GpuBlacklist; | 17 class GpuBlacklist; |
| 20 class GPUInfo; | 18 class GPUInfo; |
| 21 class RenderMessageFilter; | 19 class RenderMessageFilter; |
| 22 | 20 |
| 23 namespace gfx { | |
| 24 class Size; | |
| 25 } | |
| 26 | |
| 27 namespace IPC { | 21 namespace IPC { |
| 28 struct ChannelHandle; | 22 struct ChannelHandle; |
| 29 class Message; | 23 class Message; |
| 30 } | 24 } |
| 31 | 25 |
| 32 class GpuProcessHost : public BrowserChildProcessHost, | 26 class GpuProcessHost : public BrowserChildProcessHost, |
| 33 public base::NonThreadSafe { | 27 public base::NonThreadSafe { |
| 34 public: | 28 public: |
| 35 // Getter for the singleton. This will return NULL on failure. | 29 // Getter for the singleton. This will return NULL on failure. |
| 36 static GpuProcessHost* Get(); | 30 static GpuProcessHost* Get(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 71 |
| 78 bool EnsureInitialized(); | 72 bool EnsureInitialized(); |
| 79 bool Init(); | 73 bool Init(); |
| 80 | 74 |
| 81 bool OnControlMessageReceived(const IPC::Message& message); | 75 bool OnControlMessageReceived(const IPC::Message& message); |
| 82 | 76 |
| 83 // Message handlers. | 77 // Message handlers. |
| 84 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle, | 78 void OnChannelEstablished(const IPC::ChannelHandle& channel_handle, |
| 85 const GPUInfo& gpu_info); | 79 const GPUInfo& gpu_info); |
| 86 void OnSynchronizeReply(); | 80 void OnSynchronizeReply(); |
| 87 #if defined(OS_LINUX) | |
| 88 void OnGetViewXID(gfx::NativeViewId id, IPC::Message* reply_msg); | |
| 89 void OnReleaseXID(unsigned long xid); | |
| 90 void OnResizeXID(unsigned long xid, gfx::Size size, IPC::Message* reply_msg); | |
| 91 #elif defined(OS_MACOSX) | |
| 92 void OnAcceleratedSurfaceSetIOSurface( | |
| 93 const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params); | |
| 94 void OnAcceleratedSurfaceBuffersSwapped( | |
| 95 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | |
| 96 #elif defined(OS_WIN) | |
| 97 void OnGetCompositorHostWindow(int renderer_id, | |
| 98 int render_view_id, | |
| 99 IPC::Message* reply_message); | |
| 100 #endif | |
| 101 | 81 |
| 102 // Sends the response for establish channel request to the renderer. | 82 // Sends the response for establish channel request to the renderer. |
| 103 void SendEstablishChannelReply(const IPC::ChannelHandle& channel, | 83 void SendEstablishChannelReply(const IPC::ChannelHandle& channel, |
| 104 const GPUInfo& gpu_info, | 84 const GPUInfo& gpu_info, |
| 105 RenderMessageFilter* filter); | 85 RenderMessageFilter* filter); |
| 106 // Sends the response for synchronization request to the renderer. | 86 // Sends the response for synchronization request to the renderer. |
| 107 void SendSynchronizationReply(IPC::Message* reply, | 87 void SendSynchronizationReply(IPC::Message* reply, |
| 108 RenderMessageFilter* filter); | 88 RenderMessageFilter* filter); |
| 109 | 89 |
| 110 // Sends outstanding replies to renderer processes. This is only called | 90 // Sends outstanding replies to renderer processes. This is only called |
| (...skipping 21 matching lines...) Expand all Loading... |
| 132 // the GPU process, but haven't heard back about yet. | 112 // the GPU process, but haven't heard back about yet. |
| 133 std::queue<ChannelRequest> sent_requests_; | 113 std::queue<ChannelRequest> sent_requests_; |
| 134 | 114 |
| 135 // The pending synchronization requests we need to reply to. | 115 // The pending synchronization requests we need to reply to. |
| 136 std::queue<SynchronizationRequest> queued_synchronization_replies_; | 116 std::queue<SynchronizationRequest> queued_synchronization_replies_; |
| 137 | 117 |
| 138 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); | 118 DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
| 139 }; | 119 }; |
| 140 | 120 |
| 141 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ | 121 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_H_ |
| OLD | NEW |