Chromium Code Reviews| Index: base/debug/trace_event_impl.cc |
| diff --git a/base/debug/trace_event_impl.cc b/base/debug/trace_event_impl.cc |
| index db321e2bfa42c893e34acce70c37d802459c0e6f..1819d1a6dd3cbd8d7ad95651493a5fc16d99d5a1 100644 |
| --- a/base/debug/trace_event_impl.cc |
| +++ b/base/debug/trace_event_impl.cc |
| @@ -1212,7 +1212,8 @@ TraceLog::TraceLog() |
| event_callback_category_filter_( |
| CategoryFilter::kDefaultCategoryFilterString), |
| thread_shared_chunk_index_(0), |
| - generation_(0) { |
| + generation_(0), |
| + weak_ptr_factory_(this) { |
| // Trace is enabled or disabled on one thread while other threads are |
| // accessing the enabled flag. We don't care whether edge-case events are |
| // traced or not, so we allow races on the enabled flag to keep the trace |
| @@ -1729,7 +1730,9 @@ void TraceLog::Flush(const TraceLog::OutputCallback& cb) { |
| } |
| flush_message_loop_proxy_->PostDelayedTask( |
|
mmenke
2014/09/12 17:47:46
The weak pointer factory can only vend weak points
|
| FROM_HERE, |
| - Bind(&TraceLog::OnFlushTimeout, Unretained(this), generation), |
| + Bind(&TraceLog::OnFlushTimeout, |
| + weak_ptr_factory_.GetWeakPtr(), |
| + generation), |
| TimeDelta::FromMilliseconds(kThreadFlushTimeoutMs)); |
| return; |
| } |