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 <string> | 14 #include <string> |
15 | 15 |
16 #include "base/callback_forward.h" | 16 #include "base/callback_forward.h" |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "base/task.h" | |
19 #include "base/memory/linked_ptr.h" | 18 #include "base/memory/linked_ptr.h" |
20 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
21 #include "base/threading/non_thread_safe.h" | 20 #include "base/threading/non_thread_safe.h" |
22 #include "content/common/content_export.h" | 21 #include "content/common/content_export.h" |
23 #include "content/common/message_router.h" | 22 #include "content/common/message_router.h" |
24 | 23 |
25 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; | 24 struct GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params; |
26 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; | 25 struct GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params; |
27 struct GpuHostMsg_AcceleratedSurfaceNew_Params; | 26 struct GpuHostMsg_AcceleratedSurfaceNew_Params; |
28 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; | 27 struct GpuHostMsg_AcceleratedSurfaceRelease_Params; |
29 | 28 |
30 namespace gfx { | 29 namespace gfx { |
31 class Size; | 30 class Size; |
32 } | 31 } |
33 | 32 |
34 namespace IPC { | 33 namespace IPC { |
35 class Message; | 34 class Message; |
36 } | 35 } |
37 | 36 |
38 // A task that will forward an IPC message to the UI shim. | 37 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); |
39 class RouteToGpuProcessHostUIShimTask : public Task { | |
40 public: | |
41 RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg); | |
42 virtual ~RouteToGpuProcessHostUIShimTask(); | |
43 | |
44 private: | |
45 virtual void Run() OVERRIDE; | |
46 | |
47 int host_id_; | |
48 IPC::Message msg_; | |
49 }; | |
50 | 38 |
51 class GpuProcessHostUIShim | 39 class GpuProcessHostUIShim |
52 : public IPC::Channel::Listener, | 40 : public IPC::Channel::Listener, |
53 public IPC::Channel::Sender, | 41 public IPC::Channel::Sender, |
54 public base::NonThreadSafe { | 42 public base::NonThreadSafe { |
55 public: | 43 public: |
56 // Create a GpuProcessHostUIShim with the given ID. The object can be found | 44 // Create a GpuProcessHostUIShim with the given ID. The object can be found |
57 // using FromID with the same id. | 45 // using FromID with the same id. |
58 static GpuProcessHostUIShim* Create(int host_id); | 46 static GpuProcessHostUIShim* Create(int host_id); |
59 | 47 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 101 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
114 void OnAcceleratedSurfaceRelease( | 102 void OnAcceleratedSurfaceRelease( |
115 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); | 103 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); |
116 #endif | 104 #endif |
117 | 105 |
118 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 106 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
119 int host_id_; | 107 int host_id_; |
120 }; | 108 }; |
121 | 109 |
122 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 110 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
OLD | NEW |