OLD | NEW |
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 "Reset notification strategy", reset_strategy)); | 214 "Reset notification strategy", reset_strategy)); |
215 | 215 |
216 basic_info->Append(NewDescriptionValuePair( | 216 basic_info->Append(NewDescriptionValuePair( |
217 "GPU process crash count", | 217 "GPU process crash count", |
218 new base::FundamentalValue(gpu_info.process_crash_count))); | 218 new base::FundamentalValue(gpu_info.process_crash_count))); |
219 | 219 |
220 base::DictionaryValue* info = new base::DictionaryValue(); | 220 base::DictionaryValue* info = new base::DictionaryValue(); |
221 info->Set("basic_info", basic_info); | 221 info->Set("basic_info", basic_info); |
222 | 222 |
223 #if defined(OS_WIN) | 223 #if defined(OS_WIN) |
224 base::Value* dx_info = gpu_info.dx_diagnostics.children.size() ? | 224 scoped_ptr<base::Value> dx_info = base::Value::CreateNullValue(); |
225 DxDiagNodeToList(gpu_info.dx_diagnostics) : | 225 if (gpu_info.dx_diagnostics.children.size()) |
226 base::Value::CreateNullValue(); | 226 dx_info.reset(DxDiagNodeToList(gpu_info.dx_diagnostics)); |
227 info->Set("diagnostics", dx_info); | 227 info->Set("diagnostics", dx_info.Pass()); |
228 #endif | 228 #endif |
229 | 229 |
230 return info; | 230 return info; |
231 } | 231 } |
232 | 232 |
233 // This class receives javascript messages from the renderer. | 233 // This class receives javascript messages from the renderer. |
234 // Note that the WebUI infrastructure runs on the UI thread, therefore all of | 234 // Note that the WebUI infrastructure runs on the UI thread, therefore all of |
235 // this class's methods are expected to run on the UI thread. | 235 // this class's methods are expected to run on the UI thread. |
236 class GpuMessageHandler | 236 class GpuMessageHandler |
237 : public WebUIMessageHandler, | 237 : public WebUIMessageHandler, |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 : WebUIController(web_ui) { | 426 : WebUIController(web_ui) { |
427 web_ui->AddMessageHandler(new GpuMessageHandler()); | 427 web_ui->AddMessageHandler(new GpuMessageHandler()); |
428 | 428 |
429 // Set up the chrome://gpu/ source. | 429 // Set up the chrome://gpu/ source. |
430 BrowserContext* browser_context = | 430 BrowserContext* browser_context = |
431 web_ui->GetWebContents()->GetBrowserContext(); | 431 web_ui->GetWebContents()->GetBrowserContext(); |
432 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); | 432 WebUIDataSource::Add(browser_context, CreateGpuHTMLSource()); |
433 } | 433 } |
434 | 434 |
435 } // namespace content | 435 } // namespace content |
OLD | NEW |