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 |
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 "base/singleton.h" | 14 #include "base/singleton.h" |
15 #include "chrome/common/gpu_native_window_handle.h" | |
16 #include "chrome/common/message_router.h" | 15 #include "chrome/common/message_router.h" |
17 #include "ipc/ipc_channel.h" | 16 #include "ipc/ipc_channel.h" |
18 #include "gfx/native_widget_types.h" | 17 #include "gfx/native_widget_types.h" |
19 | 18 |
20 class GpuProcessHostUIShim : public IPC::Channel::Sender, | 19 class GpuProcessHostUIShim : public IPC::Channel::Sender, |
21 public IPC::Channel::Listener { | 20 public IPC::Channel::Listener { |
22 public: | 21 public: |
23 // Getter for the singleton. This will return NULL on failure. | 22 // Getter for the singleton. This will return NULL on failure. |
24 static GpuProcessHostUIShim* Get(); | 23 static GpuProcessHostUIShim* Get(); |
25 | 24 |
26 int32 GetNextRoutingId(); | 25 int32 GetNextRoutingId(); |
27 | 26 |
28 // Creates the new remote view and returns the routing ID for the view, or 0 | |
29 // on failure. | |
30 int32 NewRenderWidgetHostView(GpuNativeWindowHandle parent); | |
31 | |
32 // IPC::Channel::Sender implementation. | 27 // IPC::Channel::Sender implementation. |
33 virtual bool Send(IPC::Message* msg); | 28 virtual bool Send(IPC::Message* msg); |
34 | 29 |
35 // IPC::Channel::Listener implementation. | 30 // IPC::Channel::Listener implementation. |
36 // The GpuProcessHost causes this to be called on the UI thread to | 31 // The GpuProcessHost causes this to be called on the UI thread to |
37 // dispatch the incoming messages from the GPU process, which are | 32 // dispatch the incoming messages from the GPU process, which are |
38 // actually received on the IO thread. | 33 // actually received on the IO thread. |
39 virtual void OnMessageReceived(const IPC::Message& message); | 34 virtual void OnMessageReceived(const IPC::Message& message); |
40 | 35 |
41 // See documentation on MessageRouter for AddRoute and RemoveRoute | 36 // See documentation on MessageRouter for AddRoute and RemoveRoute |
(...skipping 10 matching lines...) Expand all Loading... |
52 GpuProcessHostUIShim(); | 47 GpuProcessHostUIShim(); |
53 virtual ~GpuProcessHostUIShim(); | 48 virtual ~GpuProcessHostUIShim(); |
54 | 49 |
55 int last_routing_id_; | 50 int last_routing_id_; |
56 | 51 |
57 MessageRouter router_; | 52 MessageRouter router_; |
58 }; | 53 }; |
59 | 54 |
60 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ | 55 #endif // CHROME_BROWSER_GPU_PROCESS_HOST_UI_SHIM_H_ |
61 | 56 |
OLD | NEW |