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

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

Issue 6370013: Revert 72704 - Defered collect DirectX diagnostics until they are needed for ... (Closed) Base URL: svn://svn.chromium.org/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.level() == GPUInfo::kPartial) { 304 if (gpu_info.progress() == GPUInfo::kPartial) {
305 info->SetString("level", "partial"); 305 info->SetString("progress", "partial");
306 } else { 306 } else {
307 info->SetString("level", "complete"); 307 info->SetString("progress", "complete");
308 } 308 }
309 #if defined(OS_WIN) 309 #if defined(OS_WIN)
310 if (gpu_info.level() == GPUInfo::kComplete) { 310 if (gpu_info.progress() == 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.level() != GPUInfo::kComplete) { 326 if (gpu_info.progress() != GPUInfo::kComplete) {
327 GpuProcessHostUIShim::GetInstance()->CollectGraphicsInfoAsynchronously( 327 GpuProcessHostUIShim::GetInstance()->CollectGraphicsInfoAsynchronously();
328 GPUInfo::kComplete);
329 } 328 }
330 329
331 if (gpu_info.level() != GPUInfo::kUninitialized) { 330 if (gpu_info.progress() != GPUInfo::kUninitialized) {
332 return GpuInfoToDict(gpu_info); 331 return GpuInfoToDict(gpu_info);
333 } else { 332 } else {
334 return NULL; 333 return NULL;
335 } 334 }
336 } 335 }
337 336
338 } // namespace 337 } // namespace
339 338
340 339
341 //////////////////////////////////////////////////////////////////////////////// 340 ////////////////////////////////////////////////////////////////////////////////
342 // 341 //
343 // GpuInternalsUI 342 // GpuInternalsUI
344 // 343 //
345 //////////////////////////////////////////////////////////////////////////////// 344 ////////////////////////////////////////////////////////////////////////////////
346 345
347 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : DOMUI(contents) { 346 GpuInternalsUI::GpuInternalsUI(TabContents* contents) : DOMUI(contents) {
348 AddMessageHandler((new GpuMessageHandler())->Attach(this)); 347 AddMessageHandler((new GpuMessageHandler())->Attach(this));
349 348
350 GpuHTMLSource* html_source = new GpuHTMLSource(); 349 GpuHTMLSource* html_source = new GpuHTMLSource();
351 350
352 // Set up the chrome://gpu/ source. 351 // Set up the chrome://gpu/ source.
353 BrowserThread::PostTask( 352 BrowserThread::PostTask(
354 BrowserThread::IO, FROM_HERE, 353 BrowserThread::IO, FROM_HERE,
355 NewRunnableMethod( 354 NewRunnableMethod(
356 ChromeURLDataManager::GetInstance(), 355 ChromeURLDataManager::GetInstance(),
357 &ChromeURLDataManager::AddDataSource, 356 &ChromeURLDataManager::AddDataSource,
358 make_scoped_refptr(html_source))); 357 make_scoped_refptr(html_source)));
359 } 358 }
360 359
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