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

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

Issue 10154004: re-use WebUIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WeakPtr solution 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
« no previous file with comments | « chrome/browser/ui/webui/options2/options_ui2.cc ('k') | chrome/browser/ui/webui/uber/uber_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/tracing_ui.cc
diff --git a/chrome/browser/ui/webui/tracing_ui.cc b/chrome/browser/ui/webui/tracing_ui.cc
index af2f0a44532a00caf2cbf8d7ded78e99531ec7b5..58cf5bbe564b0866df8378cc34290dd9fd108033 100644
--- a/chrome/browser/ui/webui/tracing_ui.cc
+++ b/chrome/browser/ui/webui/tracing_ui.cc
@@ -118,6 +118,10 @@ class TracingMessageHandler
// True while system tracing is active.
bool system_trace_in_progress_;
+ // True if observing the GpuDataManager (re-attaching as observer would
+ // DCHECK).
+ bool observing_;
+
void OnEndSystemTracingAck(
const scoped_refptr<base::RefCountedString>& events_str_ptr);
@@ -160,7 +164,8 @@ class TaskProxy : public base::RefCountedThreadSafe<TaskProxy> {
TracingMessageHandler::TracingMessageHandler()
: select_trace_file_dialog_type_(SelectFileDialog::SELECT_NONE),
trace_enabled_(false),
- system_trace_in_progress_(false) {
+ system_trace_in_progress_(false),
+ observing_(false) {
}
TracingMessageHandler::~TracingMessageHandler() {
@@ -210,7 +215,9 @@ void TracingMessageHandler::OnTracingControllerInitialized(
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.
« no previous file with comments | « chrome/browser/ui/webui/options2/options_ui2.cc ('k') | chrome/browser/ui/webui/uber/uber_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698