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

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

Issue 5698009: Wait for the GPU info to be collected. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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
« no previous file with comments | « chrome/browser/gpu_process_host_ui_shim.h ('k') | chrome/test/gpu/gpu_pixel_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser/renderer_host/render_view_host.h" 9 #include "chrome/browser/renderer_host/render_view_host.h"
10 #include "chrome/common/child_process_logging.h" 10 #include "chrome/common/child_process_logging.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 } 97 }
98 98
99 const GPUInfo& GpuProcessHostUIShim::gpu_info() const { 99 const GPUInfo& GpuProcessHostUIShim::gpu_info() const {
100 DCHECK(CalledOnValidThread()); 100 DCHECK(CalledOnValidThread());
101 return gpu_info_; 101 return gpu_info_;
102 } 102 }
103 103
104 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) { 104 void GpuProcessHostUIShim::OnGraphicsInfoCollected(const GPUInfo& gpu_info) {
105 gpu_info_ = gpu_info; 105 gpu_info_ = gpu_info;
106 child_process_logging::SetGpuInfo(gpu_info); 106 child_process_logging::SetGpuInfo(gpu_info);
107
108 // Used only in testing.
109 if (gpu_info_collected_callback_.get())
110 gpu_info_collected_callback_->Run();
107 } 111 }
108 112
109 void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id, 113 void GpuProcessHostUIShim::OnScheduleComposite(int renderer_id,
110 int render_view_id) { 114 int render_view_id) {
111 RenderViewHost* host = RenderViewHost::FromID(renderer_id, 115 RenderViewHost* host = RenderViewHost::FromID(renderer_id,
112 render_view_id); 116 render_view_id);
113 if (!host) { 117 if (!host) {
114 return; 118 return;
115 } 119 }
116 host->ScheduleComposite(); 120 host->ScheduleComposite();
117 } 121 }
118 void GpuProcessHostUIShim::OnControlMessageReceived( 122 void GpuProcessHostUIShim::OnControlMessageReceived(
119 const IPC::Message& message) { 123 const IPC::Message& message) {
120 DCHECK(CalledOnValidThread()); 124 DCHECK(CalledOnValidThread());
121 125
122 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) 126 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message)
123 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, 127 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected,
124 OnGraphicsInfoCollected) 128 OnGraphicsInfoCollected)
125 #if defined(OS_WIN) 129 #if defined(OS_WIN)
126 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite, 130 IPC_MESSAGE_HANDLER(GpuHostMsg_ScheduleComposite,
127 OnScheduleComposite); 131 OnScheduleComposite);
128 #endif 132 #endif
129 IPC_MESSAGE_UNHANDLED_ERROR() 133 IPC_MESSAGE_UNHANDLED_ERROR()
130 IPC_END_MESSAGE_MAP() 134 IPC_END_MESSAGE_MAP()
131 } 135 }
OLDNEW
« no previous file with comments | « chrome/browser/gpu_process_host_ui_shim.h ('k') | chrome/test/gpu/gpu_pixel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698