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 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // Destroy the GpuProcessHostUIShim with the given host ID. This can only | 44 // Destroy the GpuProcessHostUIShim with the given host ID. This can only |
45 // be called on the UI thread. Only the GpuProcessHost should destroy the | 45 // be called on the UI thread. Only the GpuProcessHost should destroy the |
46 // UI shim. | 46 // UI shim. |
47 static void Destroy(int host_id, const std::string& message); | 47 static void Destroy(int host_id, const std::string& message); |
48 | 48 |
49 // Destroy all remaining GpuProcessHostUIShims. | 49 // Destroy all remaining GpuProcessHostUIShims. |
50 CONTENT_EXPORT static void DestroyAll(); | 50 CONTENT_EXPORT static void DestroyAll(); |
51 | 51 |
52 CONTENT_EXPORT static GpuProcessHostUIShim* FromID(int host_id); | 52 CONTENT_EXPORT static GpuProcessHostUIShim* FromID(int host_id); |
53 | 53 |
54 // Stops the GPU process. | |
55 CONTENT_EXPORT void StopGpuProcess(const base::Closure& callback); | |
56 | |
57 // IPC::Listener implementation. | 54 // IPC::Listener implementation. |
58 // The GpuProcessHost causes this to be called on the UI thread to | 55 // The GpuProcessHost causes this to be called on the UI thread to |
59 // dispatch the incoming messages from the GPU process, which are | 56 // dispatch the incoming messages from the GPU process, which are |
60 // actually received on the IO thread. | 57 // actually received on the IO thread. |
61 bool OnMessageReceived(const IPC::Message& message) override; | 58 bool OnMessageReceived(const IPC::Message& message) override; |
62 | 59 |
63 private: | 60 private: |
64 explicit GpuProcessHostUIShim(int host_id); | 61 explicit GpuProcessHostUIShim(int host_id); |
65 ~GpuProcessHostUIShim() override; | 62 ~GpuProcessHostUIShim() override; |
66 | 63 |
67 // Message handlers. | 64 // Message handlers. |
68 bool OnControlMessageReceived(const IPC::Message& message); | 65 bool OnControlMessageReceived(const IPC::Message& message); |
69 void OnLogMessage(int level, const std::string& header, | 66 void OnLogMessage(int level, const std::string& header, |
70 const std::string& message); | 67 const std::string& message); |
71 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); | 68 void OnGraphicsInfoCollected(const gpu::GPUInfo& gpu_info); |
72 | 69 |
73 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. | 70 // The serial number of the GpuProcessHost / GpuProcessHostUIShim pair. |
74 int host_id_; | 71 int host_id_; |
75 base::Closure close_callback_; | |
76 }; | 72 }; |
77 | 73 |
78 } // namespace content | 74 } // namespace content |
79 | 75 |
80 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ | 76 #endif // CONTENT_BROWSER_GPU_GPU_PROCESS_HOST_UI_SHIM_H_ |
OLD | NEW |