| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| 60 // UI shim. | 60 // UI shim. |
| 61 static void Destroy(int host_id); | 61 static void Destroy(int host_id); |
| 62 | 62 |
| 63 // Destroy all remaining GpuProcessHostUIShims. | 63 // Destroy all remaining GpuProcessHostUIShims. |
| 64 CONTENT_EXPORT static void DestroyAll(); | 64 CONTENT_EXPORT static void DestroyAll(); |
| 65 | 65 |
| 66 static GpuProcessHostUIShim* FromID(int host_id); | 66 CONTENT_EXPORT static GpuProcessHostUIShim* FromID(int host_id); |
| 67 | 67 |
| 68 // IPC::Channel::Sender implementation. | 68 // IPC::Channel::Sender implementation. |
| 69 virtual bool Send(IPC::Message* msg); | 69 virtual bool Send(IPC::Message* msg); |
| 70 | 70 |
| 71 // IPC::Channel::Listener implementation. | 71 // IPC::Channel::Listener implementation. |
| 72 // The GpuProcessHost causes this to be called on the UI thread to | 72 // The GpuProcessHost causes this to be called on the UI thread to |
| 73 // dispatch the incoming messages from the GPU process, which are | 73 // dispatch the incoming messages from the GPU process, which are |
| 74 // actually received on the IO thread. | 74 // actually received on the IO thread. |
| 75 virtual bool OnMessageReceived(const IPC::Message& message); | 75 virtual bool OnMessageReceived(const IPC::Message& message); |
| 76 | 76 |
| 77 CONTENT_EXPORT void SimulateRemoveAllContext(); |
| 78 CONTENT_EXPORT void SimulateCrash(); |
| 79 CONTENT_EXPORT void SimulateHang(); |
| 80 |
| 77 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 81 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 78 // TODO(apatrick): Remove this when mac does not use AcceleratedSurfaces for | 82 // TODO(apatrick): Remove this when mac does not use AcceleratedSurfaces for |
| 79 // when running the GPU thread in the browser process. | 83 // when running the GPU thread in the browser process. |
| 80 // This is now also used in TOUCH_UI builds. | 84 // This is now also used in TOUCH_UI builds. |
| 81 static void SendToGpuHost(int host_id, IPC::Message* msg); | 85 static void SendToGpuHost(int host_id, IPC::Message* msg); |
| 82 #endif | 86 #endif |
| 83 | 87 |
| 84 private: | 88 private: |
| 85 explicit GpuProcessHostUIShim(int host_id); | 89 explicit GpuProcessHostUIShim(int host_id); |
| 86 virtual ~GpuProcessHostUIShim(); | 90 virtual ~GpuProcessHostUIShim(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 108 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) | 112 #if defined(UI_COMPOSITOR_IMAGE_TRANSPORT) |
| 109 void OnAcceleratedSurfaceRelease( | 113 void OnAcceleratedSurfaceRelease( |
| 110 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); | 114 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params); |
| 111 #endif | 115 #endif |
| 112 | 116 |
| 113 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 117 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
| 114 int host_id_; | 118 int host_id_; |
| 115 }; | 119 }; |
| 116 | 120 |
| 117 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 121 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
| OLD | NEW |