Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/browser/gpu_process_host_ui_shim.cc

Issue 6862002: Merge gpu_trace_event back into base/debug/trace_event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: "fix gpu/command_buffer/client/cmd_buffer_helper to new macros" Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/command_line.h" 10 #include "base/command_line.h"
11 #include "base/id_map.h" 11 #include "base/id_map.h"
12 #include "base/debug/trace_event.h"
12 #include "base/process_util.h" 13 #include "base/process_util.h"
13 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/gpu_data_manager.h" 15 #include "chrome/browser/gpu_data_manager.h"
15 #include "chrome/browser/io_thread.h" 16 #include "chrome/browser/io_thread.h"
16 #include "content/browser/browser_thread.h" 17 #include "content/browser/browser_thread.h"
17 #include "content/browser/gpu_process_host.h" 18 #include "content/browser/gpu_process_host.h"
18 #include "content/browser/renderer_host/render_process_host.h" 19 #include "content/browser/renderer_host/render_process_host.h"
19 #include "content/browser/renderer_host/render_view_host.h" 20 #include "content/browser/renderer_host/render_view_host.h"
20 #include "content/browser/renderer_host/render_widget_host_view.h" 21 #include "content/browser/renderer_host/render_widget_host_view.h"
21 #include "content/common/content_switches.h" 22 #include "content/common/content_switches.h"
22 #include "content/common/gpu_messages.h" 23 #include "content/common/gpu_messages.h"
23 #include "gpu/common/gpu_trace_event.h"
24 #include "ui/gfx/gl/gl_context.h" 24 #include "ui/gfx/gl/gl_context.h"
25 25
26 #if defined(OS_LINUX) 26 #if defined(OS_LINUX)
27 // These two #includes need to come after gpu_messages.h. 27 // These two #includes need to come after gpu_messages.h.
28 #include <gdk/gdkwindow.h> // NOLINT 28 #include <gdk/gdkwindow.h> // NOLINT
29 #include <gdk/gdkx.h> // NOLINT 29 #include <gdk/gdkx.h> // NOLINT
30 #include "ui/base/x/x11_util.h" 30 #include "ui/base/x/x11_util.h"
31 #include "ui/gfx/gtk_native_view_id_manager.h" 31 #include "ui/gfx/gtk_native_view_id_manager.h"
32 #include "ui/gfx/size.h" 32 #include "ui/gfx/size.h"
33 #endif // defined(OS_LINUX) 33 #endif // defined(OS_LINUX)
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 if (message.routing_id() != MSG_ROUTING_CONTROL) 376 if (message.routing_id() != MSG_ROUTING_CONTROL)
377 return false; 377 return false;
378 378
379 return OnControlMessageReceived(message); 379 return OnControlMessageReceived(message);
380 } 380 }
381 381
382 void GpuProcessHostUIShim::EstablishGpuChannel( 382 void GpuProcessHostUIShim::EstablishGpuChannel(
383 int renderer_id, 383 int renderer_id,
384 EstablishChannelCallback *callback) { 384 EstablishChannelCallback *callback) {
385 DCHECK(CalledOnValidThread()); 385 DCHECK(CalledOnValidThread());
386 GPU_TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel"); 386 TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel");
387 linked_ptr<EstablishChannelCallback> wrapped_callback(callback); 387 linked_ptr<EstablishChannelCallback> wrapped_callback(callback);
388 388
389 // If GPU features are already blacklisted, no need to establish the channel. 389 // If GPU features are already blacklisted, no need to establish the channel.
390 if (!gpu_data_manager_->GpuAccessAllowed()) { 390 if (!gpu_data_manager_->GpuAccessAllowed()) {
391 EstablishChannelError( 391 EstablishChannelError(
392 wrapped_callback.release(), IPC::ChannelHandle(), 392 wrapped_callback.release(), IPC::ChannelHandle(),
393 base::kNullProcessHandle, GPUInfo()); 393 base::kNullProcessHandle, GPUInfo());
394 return; 394 return;
395 } 395 }
396 396
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 int render_view_id) { 669 int render_view_id) {
670 RenderViewHost* host = RenderViewHost::FromID(renderer_id, 670 RenderViewHost* host = RenderViewHost::FromID(renderer_id,
671 render_view_id); 671 render_view_id);
672 if (!host) { 672 if (!host) {
673 return; 673 return;
674 } 674 }
675 host->ScheduleComposite(); 675 host->ScheduleComposite();
676 } 676 }
677 677
678 #endif 678 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698