| 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 <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/callback.h" | 15 #include "base/callback.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/threading/non_thread_safe.h" | 19 #include "base/threading/non_thread_safe.h" |
| 20 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "content/common/message_router.h" | 21 #include "content/common/message_router.h" |
| 22 #include "content/public/common/gpu_memory_stats.h" | 22 #include "content/public/common/gpu_memory_stats.h" |
| 23 #include "gpu/config/gpu_info.h" | 23 #include "gpu/config/gpu_info.h" |
| 24 #include "ipc/ipc_listener.h" | 24 #include "ipc/ipc_listener.h" |
| 25 #include "ipc/ipc_sender.h" | 25 #include "ipc/ipc_sender.h" |
| 26 | 26 |
| 27 #if defined(OS_MACOSX) |
| 27 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 28 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
| 29 #endif |
| 28 | 30 |
| 29 namespace ui { | 31 namespace ui { |
| 30 struct LatencyInfo; | 32 struct LatencyInfo; |
| 31 } | 33 } |
| 32 | 34 |
| 33 namespace gfx { | 35 namespace gfx { |
| 34 class Size; | 36 class Size; |
| 35 } | 37 } |
| 36 | 38 |
| 37 namespace IPC { | 39 namespace IPC { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 85 |
| 84 // Message handlers. | 86 // Message handlers. |
| 85 bool OnControlMessageReceived(const IPC::Message& message); | 87 bool OnControlMessageReceived(const IPC::Message& message); |
| 86 | 88 |
| 87 void OnLogMessage(int level, const std::string& header, | 89 void OnLogMessage(int level, const std::string& header, |
| 88 const std::string& message); | 90 const std::string& message); |
| 89 | 91 |
| 90 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); | 92 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); |
| 91 | 93 |
| 92 void OnAcceleratedSurfaceInitialized(int32 surface_id, int32 route_id); | 94 void OnAcceleratedSurfaceInitialized(int32 surface_id, int32 route_id); |
| 95 #if defined(OS_MACOSX) |
| 93 void OnAcceleratedSurfaceBuffersSwapped( | 96 void OnAcceleratedSurfaceBuffersSwapped( |
| 94 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); | 97 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params); |
| 98 #endif |
| 95 void OnVideoMemoryUsageStatsReceived( | 99 void OnVideoMemoryUsageStatsReceived( |
| 96 const GPUVideoMemoryUsageStats& video_memory_usage_stats); | 100 const GPUVideoMemoryUsageStats& video_memory_usage_stats); |
| 97 void OnResourcesRelinquished(); | 101 void OnResourcesRelinquished(); |
| 98 void OnAddSubscription(int32 process_id, unsigned int target); | 102 void OnAddSubscription(int32 process_id, unsigned int target); |
| 99 void OnRemoveSubscription(int32 process_id, unsigned int target); | 103 void OnRemoveSubscription(int32 process_id, unsigned int target); |
| 100 | 104 |
| 101 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 105 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
| 102 int host_id_; | 106 int host_id_; |
| 103 base::Closure relinquish_callback_; | 107 base::Closure relinquish_callback_; |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 } // namespace content | 110 } // namespace content |
| 107 | 111 |
| 108 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 112 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
| OLD | NEW |