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

Unified Diff: chrome/browser/ui/webui/gpu_internals_ui.cc

Issue 10154004: re-use WebUIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix reload DCHECKs Created 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/gpu_internals_ui.cc
diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc
index 8fb3657bf54dfc3d48119586f5779cfa41937146..e51998a66f48bb1541082c374d9957a769321fc8 100644
--- a/chrome/browser/ui/webui/gpu_internals_ui.cc
+++ b/chrome/browser/ui/webui/gpu_internals_ui.cc
@@ -88,6 +88,7 @@ class GpuMessageHandler
private:
scoped_refptr<CrashUploadList> crash_list_;
bool crash_list_available_;
Dan Beam 2012/04/21 02:53:07 doc comment
Evan Stade 2012/04/24 17:52:40 Done.
+ bool observing_;
DISALLOW_COPY_AND_ASSIGN(GpuMessageHandler);
};
@@ -99,7 +100,8 @@ class GpuMessageHandler
////////////////////////////////////////////////////////////////////////////////
GpuMessageHandler::GpuMessageHandler()
- : crash_list_available_(false) {
+ : crash_list_available_(false),
+ observing_(true) {
stuartmorgan 2012/04/24 09:12:20 It's initialized to true, and only set to true fro
Evan Stade 2012/04/24 17:52:40 yea, good catch.
crash_list_ = CrashUploadList::Create(this);
}
@@ -175,7 +177,9 @@ void GpuMessageHandler::OnBrowserBridgeInitialized(const ListValue* args) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// Watch for changes in GPUInfo
- GpuDataManager::GetInstance()->AddObserver(this);
+ if (!observing_)
+ GpuDataManager::GetInstance()->AddObserver(this);
+ observing_ = true;
// Tell GpuDataManager it should have full GpuInfo. If the
// Gpu process has not run yet, this will trigger its launch.

Powered by Google App Engine
This is Rietveld 408576698