OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 // This class lives on the UI thread and supports classes like the | 8 // This class lives on the UI thread and supports classes like the |
9 // BackingStoreProxy, which must live on the UI thread. The IO thread | 9 // BackingStoreProxy, which must live on the UI thread. The IO thread |
10 // portion of this class, the GpuProcessHost, is responsible for | 10 // portion of this class, the GpuProcessHost, is responsible for |
11 // shuttling messages between the browser and GPU processes. | 11 // shuttling messages between the browser and GPU processes. |
12 | 12 |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 | 14 |
15 #include <string> | 15 #include <string> |
16 | 16 |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
19 #include "base/memory/linked_ptr.h" | 19 #include "base/memory/linked_ptr.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "base/threading/non_thread_safe.h" | 21 #include "base/threading/non_thread_safe.h" |
22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
23 #include "content/common/content_export.h" | 23 #include "content/common/content_export.h" |
24 #include "content/public/common/gpu_memory_stats.h" | |
25 #include "gpu/config/gpu_info.h" | 24 #include "gpu/config/gpu_info.h" |
| 25 #include "gpu/ipc/common/memory_stats.h" |
26 #include "ipc/ipc_listener.h" | 26 #include "ipc/ipc_listener.h" |
27 #include "ipc/ipc_sender.h" | 27 #include "ipc/ipc_sender.h" |
28 #include "ipc/message_router.h" | 28 #include "ipc/message_router.h" |
29 | 29 |
30 namespace ui { | 30 namespace ui { |
31 class LatencyInfo; | 31 class LatencyInfo; |
32 } | 32 } |
33 | 33 |
34 namespace gfx { | 34 namespace gfx { |
35 class Size; | 35 class Size; |
36 } | 36 } |
37 | 37 |
38 namespace IPC { | 38 namespace IPC { |
39 class Message; | 39 class Message; |
40 } | 40 } |
41 | 41 |
| 42 namespace gpu { |
| 43 struct VideoMemoryUsageStats; |
| 44 } |
| 45 |
42 namespace content { | 46 namespace content { |
43 #if defined(OS_MACOSX) | 47 #if defined(OS_MACOSX) |
44 struct AcceleratedSurfaceBuffersSwappedParams; | 48 struct AcceleratedSurfaceBuffersSwappedParams; |
45 #endif | 49 #endif |
46 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); | 50 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); |
47 | 51 |
48 class GpuProcessHostUIShim : public IPC::Listener, | 52 class GpuProcessHostUIShim : public IPC::Listener, |
49 public IPC::Sender, | 53 public IPC::Sender, |
50 public base::NonThreadSafe { | 54 public base::NonThreadSafe { |
51 public: | 55 public: |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 void OnLogMessage(int level, const std::string& header, | 97 void OnLogMessage(int level, const std::string& header, |
94 const std::string& message); | 98 const std::string& message); |
95 | 99 |
96 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); | 100 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); |
97 | 101 |
98 #if defined(OS_MACOSX) | 102 #if defined(OS_MACOSX) |
99 void OnAcceleratedSurfaceBuffersSwapped( | 103 void OnAcceleratedSurfaceBuffersSwapped( |
100 const AcceleratedSurfaceBuffersSwappedParams& params); | 104 const AcceleratedSurfaceBuffersSwappedParams& params); |
101 #endif | 105 #endif |
102 void OnVideoMemoryUsageStatsReceived( | 106 void OnVideoMemoryUsageStatsReceived( |
103 const GPUVideoMemoryUsageStats& video_memory_usage_stats); | 107 const gpu::VideoMemoryUsageStats& video_memory_usage_stats); |
104 void OnAddSubscription(int32_t process_id, unsigned int target); | 108 void OnAddSubscription(int32_t process_id, unsigned int target); |
105 void OnRemoveSubscription(int32_t process_id, unsigned int target); | 109 void OnRemoveSubscription(int32_t process_id, unsigned int target); |
106 | 110 |
107 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 111 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
108 int host_id_; | 112 int host_id_; |
109 base::Closure close_callback_; | 113 base::Closure close_callback_; |
110 }; | 114 }; |
111 | 115 |
112 } // namespace content | 116 } // namespace content |
113 | 117 |
114 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 118 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
OLD | NEW |