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

Side by Side Diff: chrome/browser/dom_ui/gpu_internals_ui.cc

Issue 6341011: Reland 72704 - Defered collect DirectX diagnostics until they are needed for ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/gpu_blacklist.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/dom_ui/gpu_internals_ui.h" 5 #include "chrome/browser/dom_ui/gpu_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 basic_info->Append(NewDescriptionValuePair("GL_RENDERER", 294 basic_info->Append(NewDescriptionValuePair("GL_RENDERER",
295 gpu_info.gl_renderer())); 295 gpu_info.gl_renderer()));
296 basic_info->Append(NewDescriptionValuePair("GL_VERSION", 296 basic_info->Append(NewDescriptionValuePair("GL_VERSION",
297 gpu_info.gl_version_string())); 297 gpu_info.gl_version_string()));
298 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", 298 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS",
299 gpu_info.gl_extensions())); 299 gpu_info.gl_extensions()));
300 300
301 DictionaryValue* info = new DictionaryValue(); 301 DictionaryValue* info = new DictionaryValue();
302 info->Set("basic_info", basic_info); 302 info->Set("basic_info", basic_info);
303 303
304 if (gpu_info.progress() == GPUInfo::kPartial) { 304 if (gpu_info.level() == GPUInfo::kPartial) {
305 info->SetString("progress", "partial"); 305 info->SetString("level", "partial");
306 } else { 306 } else {
307 info->SetString("progress", "complete"); 307 info->SetString("level", "complete");
308 } 308 }
309 #if defined(OS_WIN) 309 #if defined(OS_WIN)
310 if (gpu_info.progress() == GPUInfo::kComplete) { 310 if (gpu_info.level() == GPUInfo::kComplete) {
311 ListValue* dx_info = DxDiagNodeToList(gpu_info.dx_diagnostics()); 311 ListValue* dx_info = DxDiagNodeToList(gpu_info.dx_diagnostics());
312 info->Set("diagnostics", dx_info); 312 info->Set("diagnostics", dx_info);
313 } 313 }
314 #endif 314 #endif
315 315
316 return info; 316 return info;
317 } 317 }
318 318
319 Value* GpuMessageHandler::OnRequestGpuInfo(const ListValue* list) { 319 Value* GpuMessageHandler::OnRequestGpuInfo(const ListValue* list) {
320 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 320 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
321 321
322 // Get GPU Info. 322 // Get GPU Info.
323 GPUInfo gpu_info = GpuProcessHostUIShim::GetInstance()->gpu_info(); 323 GPUInfo gpu_info = GpuProcessHostUIShim::GetInstance()->gpu_info();
324 324
325 std::string html; 325 std::string html;
326 if (gpu_info.progress() != GPUInfo::kComplete) { 326 if (gpu_info.level() != GPUInfo::kComplete) {
327 GpuProcessHostUIShim::GetInstance()->CollectGraphicsInfoAsynchronously(); 327 GpuProcessHostUIShim::GetInstance()->CollectGraphicsInfoAsynchronously(
328 GPUInfo::kComplete);
328 } 329 }
329 330
330 if (gpu_info.progress() != GPUInfo::kUninitialized) { 331 if (gpu_info.level() != GPUInfo::kUninitialized) {
331 return GpuInfoToDict(gpu_info); 332 return GpuInfoToDict(gpu_info);
332 } else { 333 } else {
333 return NULL; 334 return NULL;
334 } 335 }
335 } 336 }
336 337
337 } // namespace 338 } // namespace
338 339
339 340
340 //////////////////////////////////////////////////////////////////////////////// 341 ////////////////////////////////////////////////////////////////////////////////
341 // 342 //
342 // GpuInternalsUI 343 // GpuInternalsUI
343 // 344 //
344 //////////////////////////////////////////////////////////////////////////////// 345 ////////////////////////////////////////////////////////////////////////////////
345 346
346 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : DOMUI(contents) { 347 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : DOMUI(contents) {
347 AddMessageHandler((new GpuMessageHandler())->Attach(this)); 348 AddMessageHandler((new GpuMessageHandler())->Attach(this));
348 349
349 GpuHTMLSource* html_source = new GpuHTMLSource(); 350 GpuHTMLSource* html_source = new GpuHTMLSource();
350 351
351 // Set up the chrome://gpu/ source. 352 // Set up the chrome://gpu/ source.
352 BrowserThread::PostTask( 353 BrowserThread::PostTask(
353 BrowserThread::IO, FROM_HERE, 354 BrowserThread::IO, FROM_HERE,
354 NewRunnableMethod( 355 NewRunnableMethod(
355 ChromeURLDataManager::GetInstance(), 356 ChromeURLDataManager::GetInstance(),
356 &ChromeURLDataManager::AddDataSource, 357 &ChromeURLDataManager::AddDataSource,
357 make_scoped_refptr(html_source))); 358 make_scoped_refptr(html_source)));
358 } 359 }
359 360
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gpu_blacklist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698