OLD | NEW |
1 // TODO(jam): move this file to src/content once we have an interface that the | 1 // TODO(jam): move this file to src/content once we have an interface that the |
2 // embedder provides. We can then use it to get the resource and resize the | 2 // embedder provides. We can then use it to get the resource and resize the |
3 // window. | 3 // window. |
4 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 4 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
5 // Use of this source code is governed by a BSD-style license that can be | 5 // Use of this source code is governed by a BSD-style license that can be |
6 // found in the LICENSE file. | 6 // found in the LICENSE file. |
7 | 7 |
8 #include "chrome/browser/gpu_process_host_ui_shim.h" | 8 #include "chrome/browser/gpu_process_host_ui_shim.h" |
9 | 9 |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
11 #include "chrome/browser/gpu_data_manager.h" | 11 #include "chrome/browser/gpu_data_manager.h" |
12 #include "content/browser/browser_thread.h" | 12 #include "content/browser/browser_thread.h" |
13 #include "content/browser/gpu_process_host.h" | 13 #include "content/browser/gpu_process_host.h" |
14 #include "content/browser/renderer_host/render_process_host.h" | 14 #include "content/browser/renderer_host/render_process_host.h" |
15 #include "content/browser/renderer_host/render_view_host.h" | 15 #include "content/browser/renderer_host/render_view_host.h" |
16 #include "content/browser/renderer_host/render_widget_host_view.h" | 16 #include "content/browser/renderer_host/render_widget_host_view.h" |
17 #include "content/common/gpu_messages.h" | 17 #include "content/common/gpu_messages.h" |
| 18 #include "gpu/common/gpu_trace_event.h" |
18 | 19 |
19 #if defined(OS_LINUX) | 20 #if defined(OS_LINUX) |
20 // These two #includes need to come after gpu_messages.h. | 21 // These two #includes need to come after gpu_messages.h. |
21 #include <gdk/gdkwindow.h> // NOLINT | 22 #include <gdk/gdkwindow.h> // NOLINT |
22 #include <gdk/gdkx.h> // NOLINT | 23 #include <gdk/gdkx.h> // NOLINT |
23 #include "ui/base/x/x11_util.h" | 24 #include "ui/base/x/x11_util.h" |
24 #include "ui/gfx/gtk_native_view_id_manager.h" | 25 #include "ui/gfx/gtk_native_view_id_manager.h" |
25 #include "ui/gfx/size.h" | 26 #include "ui/gfx/size.h" |
26 #endif // defined(OS_LINUX) | 27 #endif // defined(OS_LINUX) |
27 | 28 |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 if (message.routing_id() != MSG_ROUTING_CONTROL) | 263 if (message.routing_id() != MSG_ROUTING_CONTROL) |
263 return false; | 264 return false; |
264 | 265 |
265 return OnControlMessageReceived(message); | 266 return OnControlMessageReceived(message); |
266 } | 267 } |
267 | 268 |
268 void GpuProcessHostUIShim::EstablishGpuChannel( | 269 void GpuProcessHostUIShim::EstablishGpuChannel( |
269 int renderer_id, | 270 int renderer_id, |
270 EstablishChannelCallback *callback) { | 271 EstablishChannelCallback *callback) { |
271 DCHECK(CalledOnValidThread()); | 272 DCHECK(CalledOnValidThread()); |
| 273 GPU_TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel"); |
272 linked_ptr<EstablishChannelCallback> wrapped_callback(callback); | 274 linked_ptr<EstablishChannelCallback> wrapped_callback(callback); |
273 | 275 |
274 // If GPU features are already blacklisted, no need to establish the channel. | 276 // If GPU features are already blacklisted, no need to establish the channel. |
275 if (!gpu_data_manager_->GpuAccessAllowed()) { | 277 if (!gpu_data_manager_->GpuAccessAllowed()) { |
276 EstablishChannelError( | 278 EstablishChannelError( |
277 wrapped_callback.release(), IPC::ChannelHandle(), NULL, GPUInfo()); | 279 wrapped_callback.release(), IPC::ChannelHandle(), NULL, GPUInfo()); |
278 return; | 280 return; |
279 } | 281 } |
280 | 282 |
281 if (Send(new GpuMsg_EstablishChannel(renderer_id))) { | 283 if (Send(new GpuMsg_EstablishChannel(renderer_id))) { |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 int render_view_id) { | 534 int render_view_id) { |
533 RenderViewHost* host = RenderViewHost::FromID(renderer_id, | 535 RenderViewHost* host = RenderViewHost::FromID(renderer_id, |
534 render_view_id); | 536 render_view_id); |
535 if (!host) { | 537 if (!host) { |
536 return; | 538 return; |
537 } | 539 } |
538 host->ScheduleComposite(); | 540 host->ScheduleComposite(); |
539 } | 541 } |
540 | 542 |
541 #endif | 543 #endif |
542 | |
OLD | NEW |