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

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

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 basic_info->Append(NewDescriptionValuePair("Window system binding vendor", 196 basic_info->Append(NewDescriptionValuePair("Window system binding vendor",
197 gpu_info.gl_ws_vendor)); 197 gpu_info.gl_ws_vendor));
198 basic_info->Append(NewDescriptionValuePair("Window system binding version", 198 basic_info->Append(NewDescriptionValuePair("Window system binding version",
199 gpu_info.gl_ws_version)); 199 gpu_info.gl_ws_version));
200 basic_info->Append(NewDescriptionValuePair("Window system binding extensions", 200 basic_info->Append(NewDescriptionValuePair("Window system binding extensions",
201 gpu_info.gl_ws_extensions)); 201 gpu_info.gl_ws_extensions));
202 #if defined(OS_LINUX) && defined(USE_X11) 202 #if defined(OS_LINUX) && defined(USE_X11)
203 basic_info->Append(NewDescriptionValuePair("Window manager", 203 basic_info->Append(NewDescriptionValuePair("Window manager",
204 ui::GuessWindowManagerName())); 204 ui::GuessWindowManagerName()));
205 { 205 {
206 scoped_ptr<base::Environment> env(base::Environment::Create()); 206 std::unique_ptr<base::Environment> env(base::Environment::Create());
207 std::string value; 207 std::string value;
208 const char kXDGCurrentDesktop[] = "XDG_CURRENT_DESKTOP"; 208 const char kXDGCurrentDesktop[] = "XDG_CURRENT_DESKTOP";
209 if (env->GetVar(kXDGCurrentDesktop, &value)) 209 if (env->GetVar(kXDGCurrentDesktop, &value))
210 basic_info->Append(NewDescriptionValuePair(kXDGCurrentDesktop, value)); 210 basic_info->Append(NewDescriptionValuePair(kXDGCurrentDesktop, value));
211 const char kGDMSession[] = "GDMSESSION"; 211 const char kGDMSession[] = "GDMSESSION";
212 if (env->GetVar(kGDMSession, &value)) 212 if (env->GetVar(kGDMSession, &value))
213 basic_info->Append(NewDescriptionValuePair(kGDMSession, value)); 213 basic_info->Append(NewDescriptionValuePair(kGDMSession, value));
214 const char* kAtomsToCache[] = { 214 const char* kAtomsToCache[] = {
215 "_NET_WM_CM_S0", 215 "_NET_WM_CM_S0",
216 NULL 216 NULL
(...skipping 16 matching lines...) Expand all
233 "Reset notification strategy", reset_strategy)); 233 "Reset notification strategy", reset_strategy));
234 234
235 basic_info->Append(NewDescriptionValuePair( 235 basic_info->Append(NewDescriptionValuePair(
236 "GPU process crash count", 236 "GPU process crash count",
237 new base::FundamentalValue(gpu_info.process_crash_count))); 237 new base::FundamentalValue(gpu_info.process_crash_count)));
238 238
239 base::DictionaryValue* info = new base::DictionaryValue(); 239 base::DictionaryValue* info = new base::DictionaryValue();
240 info->Set("basic_info", basic_info); 240 info->Set("basic_info", basic_info);
241 241
242 #if defined(OS_WIN) 242 #if defined(OS_WIN)
243 scoped_ptr<base::Value> dx_info = base::Value::CreateNullValue(); 243 std::unique_ptr<base::Value> dx_info = base::Value::CreateNullValue();
244 if (gpu_info.dx_diagnostics.children.size()) 244 if (gpu_info.dx_diagnostics.children.size())
245 dx_info.reset(DxDiagNodeToList(gpu_info.dx_diagnostics)); 245 dx_info.reset(DxDiagNodeToList(gpu_info.dx_diagnostics));
246 info->Set("diagnostics", std::move(dx_info)); 246 info->Set("diagnostics", std::move(dx_info));
247 #endif 247 #endif
248 248
249 return info; 249 return info;
250 } 250 }
251 251
252 const char* BufferFormatToString(gfx::BufferFormat format) { 252 const char* BufferFormatToString(gfx::BufferFormat format) {
253 switch (format) { 253 switch (format) {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 } 494 }
495 495
496 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) { 496 base::Value* GpuMessageHandler::OnRequestLogMessages(const base::ListValue*) {
497 DCHECK_CURRENTLY_ON(BrowserThread::UI); 497 DCHECK_CURRENTLY_ON(BrowserThread::UI);
498 498
499 return GpuDataManagerImpl::GetInstance()->GetLogMessages(); 499 return GpuDataManagerImpl::GetInstance()->GetLogMessages();
500 } 500 }
501 501
502 void GpuMessageHandler::OnGpuInfoUpdate() { 502 void GpuMessageHandler::OnGpuInfoUpdate() {
503 // Get GPU Info. 503 // Get GPU Info.
504 scoped_ptr<base::DictionaryValue> gpu_info_val(GpuInfoAsDictionaryValue()); 504 std::unique_ptr<base::DictionaryValue> gpu_info_val(
505 505 GpuInfoAsDictionaryValue());
506 506
507 // Add in blacklisting features 507 // Add in blacklisting features
508 base::DictionaryValue* feature_status = new base::DictionaryValue; 508 base::DictionaryValue* feature_status = new base::DictionaryValue;
509 feature_status->Set("featureStatus", GetFeatureStatus()); 509 feature_status->Set("featureStatus", GetFeatureStatus());
510 feature_status->Set("problems", GetProblems()); 510 feature_status->Set("problems", GetProblems());
511 base::ListValue* workarounds = new base::ListValue(); 511 base::ListValue* workarounds = new base::ListValue();
512 for (const std::string& workaround : GetDriverBugWorkarounds()) 512 for (const std::string& workaround : GetDriverBugWorkarounds())
513 workarounds->AppendString(workaround); 513 workarounds->AppendString(workaround);
514 feature_status->Set("workarounds", workarounds); 514 feature_status->Set("workarounds", workarounds);
515 gpu_info_val->Set("featureStatus", feature_status); 515 gpu_info_val->Set("featureStatus", feature_status);
(...skipping 22 matching lines...) Expand all
538 : WebUIController(web_ui) { 538 : WebUIController(web_ui) {
539 web_ui->AddMessageHandler(new GpuMessageHandler()); 539 web_ui->AddMessageHandler(new GpuMessageHandler());
540 540
541 // Set up the chrome://gpu/ source. 541 // Set up the chrome://gpu/ source.
542 BrowserContext* browser_context = 542 BrowserContext* browser_context =
543 web_ui->GetWebContents()->GetBrowserContext(); 543 web_ui->GetWebContents()->GetBrowserContext();
544 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); 544 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource());
545 } 545 }
546 546
547 } // namespace content 547 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_data_manager_impl_private.h ('k') | content/browser/gpu/gpu_ipc_browsertests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698