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

Side by Side Diff: chrome/browser/ui/webui/gpu_internals_ui.cc

Issue 10891013: Make GpuDataManager thread safe. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
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 "chrome/browser/ui/webui/gpu_internals_ui.h" 5 #include "chrome/browser/ui/webui/gpu_internals_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 #endif 233 #endif
234 dict->SetString("blacklist_version", 234 dict->SetString("blacklist_version",
235 GpuBlacklist::GetInstance()->GetVersion()); 235 GpuBlacklist::GetInstance()->GetVersion());
236 236
237 return dict; 237 return dict;
238 } 238 }
239 239
240 Value* GpuMessageHandler::OnRequestLogMessages(const ListValue*) { 240 Value* GpuMessageHandler::OnRequestLogMessages(const ListValue*) {
241 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 241 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
242 242
243 return GpuDataManager::GetInstance()->GetLogMessages().DeepCopy(); 243 return GpuDataManager::GetInstance()->GetLogMessages();
244 } 244 }
245 245
246 Value* GpuMessageHandler::OnRequestCrashList(const ListValue*) { 246 Value* GpuMessageHandler::OnRequestCrashList(const ListValue*) {
247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 247 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
248 248
249 if (!CrashesUI::CrashReportingEnabled()) { 249 if (!CrashesUI::CrashReportingEnabled()) {
250 // We need to return an empty list instead of NULL. 250 // We need to return an empty list instead of NULL.
251 return new ListValue; 251 return new ListValue;
252 } 252 }
253 if (!crash_list_available_) { 253 if (!crash_list_available_) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 //////////////////////////////////////////////////////////////////////////////// 299 ////////////////////////////////////////////////////////////////////////////////
300 300
301 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) 301 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui)
302 : WebUIController(web_ui) { 302 : WebUIController(web_ui) {
303 web_ui->AddMessageHandler(new GpuMessageHandler()); 303 web_ui->AddMessageHandler(new GpuMessageHandler());
304 304
305 // Set up the chrome://gpu-internals/ source. 305 // Set up the chrome://gpu-internals/ source.
306 Profile* profile = Profile::FromWebUI(web_ui); 306 Profile* profile = Profile::FromWebUI(web_ui);
307 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); 307 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource());
308 } 308 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698