diff options
author | husky@chromium.org <husky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-22 23:53:00 +0000 |
---|---|---|
committer | husky@chromium.org <husky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-22 23:53:00 +0000 |
commit | ecc6a5b5f2a4eda6554c1526e918cee14ba097f2 (patch) | |
tree | cc36e8d3a09055017b11c6a83b18ccd70e0c2d45 /content/browser/trace_controller.cc | |
parent | 47a1f70b7eb09d7fc11f00beab94532544044ed1 (diff) | |
download | chromium_src-ecc6a5b5f2a4eda6554c1526e918cee14ba097f2.zip chromium_src-ecc6a5b5f2a4eda6554c1526e918cee14ba097f2.tar.gz chromium_src-ecc6a5b5f2a4eda6554c1526e918cee14ba097f2.tar.bz2 |
Use SequencedWorkerPool for disk operations in TraceSubscriberStdio.
This class was hitting a ThreadRestrictions assert because it called
OpenFile on the UI thread. To reduce unnecessary copying, I've changed
the OnTraceDataCollected argument from std::string to RefCountedString.
BUG=None
TEST=content_unittests
Review URL: http://codereview.chromium.org/9333003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123140 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/trace_controller.cc')
-rw-r--r-- | content/browser/trace_controller.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/content/browser/trace_controller.cc b/content/browser/trace_controller.cc index c7e570d..41770cd 100644 --- a/content/browser/trace_controller.cc +++ b/content/browser/trace_controller.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -20,7 +20,7 @@ using content::BrowserThread; namespace { -class AutoStopTraceSubscriberStdio : public TraceSubscriberStdio { +class AutoStopTraceSubscriberStdio : public content::TraceSubscriberStdio { public: AutoStopTraceSubscriberStdio(const FilePath& file_path) : TraceSubscriberStdio(file_path) {} @@ -86,10 +86,6 @@ void TraceController::InitStartupTracing(const CommandLine& command_line) { scoped_ptr<AutoStopTraceSubscriberStdio> subscriber( new AutoStopTraceSubscriberStdio(trace_file)); DCHECK(can_begin_tracing(subscriber.get())); - if (!subscriber->IsValid()) { - TraceLog::GetInstance()->SetDisabled(); - return; - } std::string delay_str = command_line.GetSwitchValueASCII( switches::kTraceStartupDuration); @@ -314,7 +310,7 @@ void TraceController::OnEndTracingAck( } void TraceController::OnTraceDataCollected( - const scoped_refptr<TraceLog::RefCountedString>& events_str_ptr) { + const scoped_refptr<base::RefCountedString>& events_str_ptr) { // OnTraceDataCollected may be called from any browser thread, either by the // local event trace system or from child processes via TraceMessageFilter. if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { @@ -326,7 +322,7 @@ void TraceController::OnTraceDataCollected( // Drop trace events if we are just getting categories. if (subscriber_ && !is_get_categories_) - subscriber_->OnTraceDataCollected(events_str_ptr->data); + subscriber_->OnTraceDataCollected(events_str_ptr); } void TraceController::OnTraceBufferFull() { |