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_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 5 #ifndef CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 6 #define CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // This class lives on the UI thread and supports classes like the | 9 // This class lives on the UI thread and supports classes like the |
10 // BackingStoreProxy, which must live on the UI thread. The IO thread | 10 // BackingStoreProxy, which must live on the UI thread. The IO thread |
11 // portion of this class, the GpuProcessHost, is responsible for | 11 // portion of this class, the GpuProcessHost, is responsible for |
12 // shuttling messages between the browser and GPU processes. | 12 // shuttling messages between the browser and GPU processes. |
13 | 13 |
14 #include <queue> | 14 #include <queue> |
15 | 15 |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/task.h" |
17 #include "base/memory/linked_ptr.h" | 18 #include "base/memory/linked_ptr.h" |
18 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
19 #include "base/threading/non_thread_safe.h" | 20 #include "base/threading/non_thread_safe.h" |
20 #include "content/common/gpu/gpu_channel_manager.h" | |
21 #include "content/common/gpu/gpu_feature_flags.h" | |
22 #include "content/common/gpu/gpu_info.h" | |
23 #include "content/common/gpu/gpu_process_launch_causes.h" | |
24 #include "content/common/message_router.h" | 21 #include "content/common/message_router.h" |
25 | 22 |
26 namespace gfx { | 23 namespace gfx { |
27 class Size; | 24 class Size; |
28 } | 25 } |
29 | 26 |
30 struct GPUCreateCommandBufferConfig; | 27 struct GPUCreateCommandBufferConfig; |
31 struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params; | 28 struct GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params; |
32 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 29 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
33 | 30 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 gfx::Size size); | 99 gfx::Size size); |
103 #elif defined(OS_MACOSX) | 100 #elif defined(OS_MACOSX) |
104 void OnAcceleratedSurfaceSetIOSurface( | 101 void OnAcceleratedSurfaceSetIOSurface( |
105 const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params); | 102 const GpuHostMsg_AcceleratedSurfaceSetIOSurface_Params& params); |
106 void OnAcceleratedSurfaceBuffersSwapped( | 103 void OnAcceleratedSurfaceBuffersSwapped( |
107 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | 104 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); |
108 #endif | 105 #endif |
109 | 106 |
110 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 107 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
111 int host_id_; | 108 int host_id_; |
112 | |
113 // In single process and in process GPU mode, this references the | |
114 // GpuChannelManager or null otherwise. It must be called and deleted on the | |
115 // GPU thread. | |
116 GpuChannelManager* gpu_channel_manager_; | |
117 | |
118 // This is likewise single process / in process GPU specific. This is a Sender | |
119 // implementation that forwards IPC messages to this UI shim on the UI thread. | |
120 IPC::Channel::Sender* ui_thread_sender_; | |
121 }; | 109 }; |
122 | 110 |
123 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 111 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
OLD | NEW |