| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ | 5 #ifndef CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ |
| 6 #define CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ | 6 #define CHROME_BROWSER_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 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 int32 GetNextRoutingId(); | 30 int32 GetNextRoutingId(); |
| 31 | 31 |
| 32 // IPC::Channel::Sender implementation. | 32 // IPC::Channel::Sender implementation. |
| 33 virtual bool Send(IPC::Message* msg); | 33 virtual bool Send(IPC::Message* msg); |
| 34 | 34 |
| 35 // IPC::Channel::Listener implementation. | 35 // IPC::Channel::Listener implementation. |
| 36 // The GpuProcessHost causes this to be called on the UI thread to | 36 // The GpuProcessHost causes this to be called on the UI thread to |
| 37 // dispatch the incoming messages from the GPU process, which are | 37 // dispatch the incoming messages from the GPU process, which are |
| 38 // actually received on the IO thread. | 38 // actually received on the IO thread. |
| 39 virtual void OnMessageReceived(const IPC::Message& message); | 39 virtual bool OnMessageReceived(const IPC::Message& message); |
| 40 | 40 |
| 41 // See documentation on MessageRouter for AddRoute and RemoveRoute | 41 // See documentation on MessageRouter for AddRoute and RemoveRoute |
| 42 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); | 42 void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); |
| 43 void RemoveRoute(int32 routing_id); | 43 void RemoveRoute(int32 routing_id); |
| 44 | 44 |
| 45 // Sends a message to the browser process to collect the information from the | 45 // Sends a message to the browser process to collect the information from the |
| 46 // graphics card. | 46 // graphics card. |
| 47 void CollectGraphicsInfoAsynchronously(); | 47 void CollectGraphicsInfoAsynchronously(); |
| 48 | 48 |
| 49 // Tells the GPU process to crash. Useful for testing. | 49 // Tells the GPU process to crash. Useful for testing. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 friend struct DefaultSingletonTraits<GpuProcessHostUIShim>; | 67 friend struct DefaultSingletonTraits<GpuProcessHostUIShim>; |
| 68 | 68 |
| 69 GpuProcessHostUIShim(); | 69 GpuProcessHostUIShim(); |
| 70 virtual ~GpuProcessHostUIShim(); | 70 virtual ~GpuProcessHostUIShim(); |
| 71 | 71 |
| 72 // Message handlers. | 72 // Message handlers. |
| 73 void OnGraphicsInfoCollected(const GPUInfo& gpu_info); | 73 void OnGraphicsInfoCollected(const GPUInfo& gpu_info); |
| 74 void OnScheduleComposite(int32 renderer_id, int32 render_view_id); | 74 void OnScheduleComposite(int32 renderer_id, int32 render_view_id); |
| 75 void OnControlMessageReceived(const IPC::Message& message); | 75 bool OnControlMessageReceived(const IPC::Message& message); |
| 76 | 76 |
| 77 int last_routing_id_; | 77 int last_routing_id_; |
| 78 | 78 |
| 79 GPUInfo gpu_info_; | 79 GPUInfo gpu_info_; |
| 80 | 80 |
| 81 MessageRouter router_; | 81 MessageRouter router_; |
| 82 | 82 |
| 83 // Used only in testing. If set, the callback is invoked when the GPU info | 83 // Used only in testing. If set, the callback is invoked when the GPU info |
| 84 // has been collected. | 84 // has been collected. |
| 85 scoped_ptr<Callback0::Type> gpu_info_collected_callback_; | 85 scoped_ptr<Callback0::Type> gpu_info_collected_callback_; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ | 88 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ |
| 89 | 89 |
| OLD | NEW |