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

Side by Side Diff: content/browser/gpu/gpu_internals_ui.cc

Issue 665123002: [DevTools] Move SystemInfo domain to generated handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@browserProtocol
Patch Set: Rebased Created 6 years, 1 month 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
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/content_browser.gypi » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/gpu/gpu_internals_ui.h" 5 #include "content/browser/gpu/gpu_internals_ui.h"
6 6
7 #if defined(OS_LINUX) && defined(USE_X11) 7 #if defined(OS_LINUX) && defined(USE_X11)
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 #endif 9 #endif
10 10
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { 390 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) {
391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
392 392
393 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); 393 return GpuDataManagerImpl::GetInstance()->GetLogMessages();
394 } 394 }
395 395
396 void GpuMessageHandler::OnGpuInfoUpdate() { 396 void GpuMessageHandler::OnGpuInfoUpdate() {
397 // Get GPU Info. 397 // Get GPU Info.
398 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); 398 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue());
399 399
400
400 // Add in blacklisting features 401 // Add in blacklisting features
401 base::DictionaryValue* feature_status = new base::DictionaryValue; 402 base::DictionaryValue* feature_status = new base::DictionaryValue;
402 feature_status->Set("featureStatus", GetFeatureStatus()); 403 feature_status->Set("featureStatus", GetFeatureStatus());
403 feature_status->Set("problems", GetProblems()); 404 feature_status->Set("problems", GetProblems());
404 feature_status->Set("workarounds", GetDriverBugWorkarounds()); 405 base::ListValue* workarounds = new base::ListValue();
405 if (feature_status) 406 for (const std::string& workaround : GetDriverBugWorkarounds())
406 gpu_info_val->Set("featureStatus", feature_status); 407 workarounds->AppendString(workaround);
408 feature_status->Set("workarounds", workarounds);
409 gpu_info_val->Set("featureStatus", feature_status);
407 410
408 // Send GPU Info to javascript. 411 // Send GPU Info to javascript.
409 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate", 412 web_ui()->CallJavascriptFunction("browserBridge.onGpuInfoUpdate",
410 *(gpu_info_val.get())); 413 *(gpu_info_val.get()));
411 } 414 }
412 415
413 void GpuMessageHandler::OnGpuSwitched() { 416 void GpuMessageHandler::OnGpuSwitched() {
414 GpuDataManagerImpl::GetInstance()->RequestCompleteGpuInfoIfNeeded(); 417 GpuDataManagerImpl::GetInstance()->RequestCompleteGpuInfoIfNeeded();
415 } 418 }
416 419
(...skipping 10 matching lines...) Expand all
427 : WebUIController(web_ui) { 430 : WebUIController(web_ui) {
428 web_ui->AddMessageHandler(new GpuMessageHandler()); 431 web_ui->AddMessageHandler(new GpuMessageHandler());
429 432
430 // Set up the chrome://gpu/ source. 433 // Set up the chrome://gpu/ source.
431 BrowserContext* browser_context = 434 BrowserContext* browser_context =
432 web_ui->GetWebContents()->GetBrowserContext(); 435 web_ui->GetWebContents()->GetBrowserContext();
433 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); 436 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource());
434 } 437 }
435 438
436 } // namespace content 439 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698