| 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" |
| 24 #include "gpu/config/gpu_info.h" | 25 #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 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 31 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 31 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| 32 #endif | 32 #endif |
| 33 | 33 |
| 34 namespace ui { | 34 namespace ui { |
| 35 class LatencyInfo; | 35 class LatencyInfo; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace gfx { | 38 namespace gfx { |
| 39 class Size; | 39 class Size; |
| 40 } | 40 } |
| 41 | 41 |
| 42 namespace IPC { | 42 namespace IPC { |
| 43 class Message; | 43 class Message; |
| 44 } | 44 } |
| 45 | 45 |
| 46 namespace gpu { | |
| 47 struct VideoMemoryUsageStats; | |
| 48 } | |
| 49 | |
| 50 namespace content { | 46 namespace content { |
| 51 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); | 47 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); |
| 52 | 48 |
| 53 class GpuProcessHostUIShim : public IPC::Listener, | 49 class GpuProcessHostUIShim : public IPC::Listener, |
| 54 public IPC::Sender, | 50 public IPC::Sender, |
| 55 public base::NonThreadSafe { | 51 public base::NonThreadSafe { |
| 56 public: | 52 public: |
| 57 // Create a GpuProcessHostUIShim with the given ID. The object can be found | 53 // Create a GpuProcessHostUIShim with the given ID. The object can be found |
| 58 // using FromID with the same id. | 54 // using FromID with the same id. |
| 59 static GpuProcessHostUIShim* Create(int host_id); | 55 static GpuProcessHostUIShim* Create(int host_id); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void OnLogMessage(int level, const std::string& header, | 94 void OnLogMessage(int level, const std::string& header, |
| 99 const std::string& message); | 95 const std::string& message); |
| 100 | 96 |
| 101 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); | 97 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); |
| 102 | 98 |
| 103 #if defined(OS_MACOSX) | 99 #if defined(OS_MACOSX) |
| 104 void OnAcceleratedSurfaceBuffersSwapped( | 100 void OnAcceleratedSurfaceBuffersSwapped( |
| 105 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | 101 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); |
| 106 #endif | 102 #endif |
| 107 void OnVideoMemoryUsageStatsReceived( | 103 void OnVideoMemoryUsageStatsReceived( |
| 108 const gpu::VideoMemoryUsageStats& video_memory_usage_stats); | 104 const GPUVideoMemoryUsageStats& video_memory_usage_stats); |
| 109 void OnAddSubscription(int32_t process_id, unsigned int target); | 105 void OnAddSubscription(int32_t process_id, unsigned int target); |
| 110 void OnRemoveSubscription(int32_t process_id, unsigned int target); | 106 void OnRemoveSubscription(int32_t process_id, unsigned int target); |
| 111 | 107 |
| 112 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 108 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
| 113 int host_id_; | 109 int host_id_; |
| 114 base::Closure close_callback_; | 110 base::Closure close_callback_; |
| 115 }; | 111 }; |
| 116 | 112 |
| 117 } // namespace content | 113 } // namespace content |
| 118 | 114 |
| 119 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 115 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
| OLD | NEW |