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 #include "chrome/browser/gpu_process_host_ui_shim.h" | 5 #include "chrome/browser/gpu_process_host_ui_shim.h" |
6 | 6 |
7 #include "chrome/browser/browser_thread.h" | 7 #include "chrome/browser/browser_thread.h" |
8 #include "chrome/browser/gpu_process_host.h" | 8 #include "chrome/browser/gpu_process_host.h" |
9 #include "chrome/common/gpu_messages.h" | 9 #include "chrome/common/gpu_messages.h" |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 GpuProcessHostUIShim::~GpuProcessHostUIShim() { | 31 GpuProcessHostUIShim::~GpuProcessHostUIShim() { |
32 } | 32 } |
33 | 33 |
34 // static | 34 // static |
35 GpuProcessHostUIShim* GpuProcessHostUIShim::Get() { | 35 GpuProcessHostUIShim* GpuProcessHostUIShim::Get() { |
36 return Singleton<GpuProcessHostUIShim>::get(); | 36 return Singleton<GpuProcessHostUIShim>::get(); |
37 } | 37 } |
38 | 38 |
39 int32 GpuProcessHostUIShim::NewRenderWidgetHostView( | |
40 GpuNativeWindowHandle parent) { | |
41 int32 routing_id = GetNextRoutingId(); | |
42 Send(new GpuMsg_NewRenderWidgetHostView(parent, routing_id)); | |
43 return routing_id; | |
44 } | |
45 | |
46 bool GpuProcessHostUIShim::Send(IPC::Message* msg) { | 39 bool GpuProcessHostUIShim::Send(IPC::Message* msg) { |
47 BrowserThread::PostTask(BrowserThread::IO, | 40 BrowserThread::PostTask(BrowserThread::IO, |
48 FROM_HERE, | 41 FROM_HERE, |
49 new SendOnIOThreadTask(msg)); | 42 new SendOnIOThreadTask(msg)); |
50 return true; | 43 return true; |
51 } | 44 } |
52 | 45 |
53 int32 GpuProcessHostUIShim::GetNextRoutingId() { | 46 int32 GpuProcessHostUIShim::GetNextRoutingId() { |
54 return ++last_routing_id_; | 47 return ++last_routing_id_; |
55 } | 48 } |
(...skipping 11 matching lines...) Expand all Loading... |
67 router_.RouteMessage(message); | 60 router_.RouteMessage(message); |
68 } | 61 } |
69 | 62 |
70 void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously() { | 63 void GpuProcessHostUIShim::CollectGraphicsInfoAsynchronously() { |
71 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); | 64 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::IO)); |
72 BrowserThread::PostTask( | 65 BrowserThread::PostTask( |
73 BrowserThread::IO, | 66 BrowserThread::IO, |
74 FROM_HERE, | 67 FROM_HERE, |
75 new SendOnIOThreadTask(new GpuMsg_CollectGraphicsInfo())); | 68 new SendOnIOThreadTask(new GpuMsg_CollectGraphicsInfo())); |
76 } | 69 } |
OLD | NEW |