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 |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace gfx { | 28 namespace gfx { |
29 class Size; | 29 class Size; |
30 } | 30 } |
31 | 31 |
32 namespace IPC { | 32 namespace IPC { |
33 class Message; | 33 class Message; |
34 } | 34 } |
35 | 35 |
36 // A task that will forward an IPC message to the UI shim. | 36 // A task that will forward an IPC message to the UI shim. |
37 class CONTENT_EXPORT RouteToGpuProcessHostUIShimTask : public Task { | 37 class RouteToGpuProcessHostUIShimTask : public Task { |
38 public: | 38 public: |
39 RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); | 39 RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); |
40 virtual ~RouteToGpuProcessHostUIShimTask(); | 40 virtual ~RouteToGpuProcessHostUIShimTask(); |
41 | 41 |
42 private: | 42 private: |
43 virtual void Run() OVERRIDE; | 43 virtual void Run() OVERRIDE; |
44 | 44 |
45 int host_id_; | 45 int host_id_; |
46 IPC::Message msg_; | 46 IPC::Message msg_; |
47 }; | 47 }; |
48 | 48 |
49 class CONTENT_EXPORT GpuProcessHostUIShim | 49 class GpuProcessHostUIShim |
50 : public IPC::Channel::Listener, | 50 : public IPC::Channel::Listener, |
51 public IPC::Channel::Sender, | 51 public IPC::Channel::Sender, |
52 public base::NonThreadSafe { | 52 public base::NonThreadSafe { |
53 public: | 53 public: |
54 // Create a GpuProcessHostUIShim with the given ID. The object can be found | 54 // Create a GpuProcessHostUIShim with the given ID. The object can be found |
55 // using FromID with the same id. | 55 // using FromID with the same id. |
56 static GpuProcessHostUIShim* Create(int host_id); | 56 static GpuProcessHostUIShim* Create(int host_id); |
57 | 57 |
58 // Destroy the GpuProcessHostUIShim with the given host ID. This can only | 58 // Destroy the GpuProcessHostUIShim with the given host ID. This can only |
59 // be called on the UI thread. Only the GpuProcessHost should destroy the | 59 // be called on the UI thread. Only the GpuProcessHost should destroy the |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 108 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
109 void OnAcceleratedSurfaceRelease( | 109 void OnAcceleratedSurfaceRelease( |
110 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); | 110 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); |
111 #endif | 111 #endif |
112 | 112 |
113 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 113 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
114 int host_id_; | 114 int host_id_; |
115 }; | 115 }; |
116 | 116 |
117 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 117 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
OLD | NEW |