diff options
author | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 00:25:18 +0000 |
---|---|---|
committer | groby@chromium.org <groby@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-23 00:25:18 +0000 |
commit | e28403a126a99d7795e84ce85660dbb515be8e06 (patch) | |
tree | 811a5991f4840d7133857a6dd5dee2fa4ee6a258 /base/debug | |
parent | 99528bd9ca0fe1c976fdaf0ad4cf8ccbda3e4d90 (diff) | |
download | chromium_src-e28403a126a99d7795e84ce85660dbb515be8e06.zip chromium_src-e28403a126a99d7795e84ce85660dbb515be8e06.tar.gz chromium_src-e28403a126a99d7795e84ce85660dbb515be8e06.tar.bz2 |
Revert 123140 - Use SequencedWorkerPool for disk operations in TraceSubscriberStdio.
Reverted since it causes compile failure on Win/Aura.
(scoped_refptr of TraceSubscriberStdioImpl which is only forward-declared)
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
TBR=husky@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9447003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123146 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug')
-rw-r--r-- | base/debug/trace_event_impl.cc | 2 | ||||
-rw-r--r-- | base/debug/trace_event_impl.h | 5 | ||||
-rw-r--r-- | base/debug/trace_event_unittest.cc | 6 |
3 files changed, 8 insertions, 5 deletions
diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc index fbe315e..1f23c36 100644 --- a/base/debug/trace_event_impl.cc +++ b/base/debug/trace_event_impl.cc @@ -564,7 +564,7 @@ void TraceLog::Flush() { TraceEvent::AppendEventsAsJSON(previous_logged_events, i, kTraceEventBatchSize, - &(json_events_str_ptr->data())); + &(json_events_str_ptr->data)); output_callback_copy.Run(json_events_str_ptr); } } diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h index 04aea18..1806f893 100644 --- a/base/debug/trace_event_impl.h +++ b/base/debug/trace_event_impl.h @@ -42,6 +42,8 @@ struct StaticMemorySingletonTraits; namespace base { +class RefCountedString; + namespace debug { const int kTraceMaxNumArgs = 2; @@ -219,7 +221,8 @@ class BASE_EXPORT TraceLog { // silently dropped. The callback must be thread safe. The string format is // undefined. Use TraceResultBuffer to convert one or more trace strings to // JSON. - typedef base::Callback<void(const scoped_refptr<base::RefCountedString>&)> + typedef RefCountedData<std::string> RefCountedString; + typedef base::Callback<void(const scoped_refptr<RefCountedString>&)> OutputCallback; void SetOutputCallback(const OutputCallback& cb); diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc index befd4e8..9afd68b 100644 --- a/base/debug/trace_event_unittest.cc +++ b/base/debug/trace_event_unittest.cc @@ -42,7 +42,7 @@ class TraceEventTestFixture : public testing::Test { // up multiple times when testing AtExit. Use ManualTestSetUp for this. void ManualTestSetUp(); void OnTraceDataCollected( - const scoped_refptr<base::RefCountedString>& events_str); + const scoped_refptr<TraceLog::RefCountedString>& events_str); DictionaryValue* FindMatchingTraceEntry(const JsonKeyValue* key_values); DictionaryValue* FindNamePhase(const char* name, const char* phase); DictionaryValue* FindNamePhaseKeyValue(const char* name, @@ -91,11 +91,11 @@ void TraceEventTestFixture::ManualTestSetUp() { } void TraceEventTestFixture::OnTraceDataCollected( - const scoped_refptr<base::RefCountedString>& events_str) { + const scoped_refptr<TraceLog::RefCountedString>& events_str) { AutoLock lock(lock_); json_output_.json_output.clear(); trace_buffer_.Start(); - trace_buffer_.AddFragment(events_str->data()); + trace_buffer_.AddFragment(events_str->data); trace_buffer_.Finish(); scoped_ptr<Value> root; |