| Index: content/browser/tracing/trace_controller_impl.cc
|
| diff --git a/content/browser/tracing/trace_controller_impl.cc b/content/browser/tracing/trace_controller_impl.cc
|
| index e0aed6edcd7969acd9f874f2fd7ed73f414a3f87..2819fd1f26af48ee6a0a452599a436a9d18a69d1 100644
|
| --- a/content/browser/tracing/trace_controller_impl.cc
|
| +++ b/content/browser/tracing/trace_controller_impl.cc
|
| @@ -119,22 +119,6 @@ bool TraceControllerImpl::GetKnownCategoriesAsync(TraceSubscriber* subscriber) {
|
| return success;
|
| }
|
|
|
| -bool TraceControllerImpl::BeginTracing(
|
| - TraceSubscriber* subscriber,
|
| - const std::vector<std::string>& included_categories,
|
| - const std::vector<std::string>& excluded_categories) {
|
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| -
|
| - if (!can_begin_tracing(subscriber))
|
| - return false;
|
| -
|
| - // Enable tracing
|
| - TraceLog::GetInstance()->SetEnabled(included_categories, excluded_categories);
|
| - OnTracingBegan(subscriber);
|
| -
|
| - return true;
|
| -}
|
| -
|
| bool TraceControllerImpl::BeginTracing(TraceSubscriber* subscriber,
|
| const std::string& categories) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| @@ -143,7 +127,8 @@ bool TraceControllerImpl::BeginTracing(TraceSubscriber* subscriber,
|
| return false;
|
|
|
| // Enable tracing
|
| - TraceLog::GetInstance()->SetEnabled(categories);
|
| + base::debug::CategoryFilter category_filter(categories);
|
| + TraceLog::GetInstance()->SetEnabled(category_filter);
|
|
|
| OnTracingBegan(subscriber);
|
|
|
| @@ -261,7 +246,10 @@ void TraceControllerImpl::AddFilter(TraceMessageFilter* filter) {
|
|
|
| filters_.insert(filter);
|
| if (is_tracing_enabled()) {
|
| - filter->SendBeginTracing(included_categories_, excluded_categories_);
|
| + scoped_refptr<base::RefCountedString> category_filter_str_ptr =
|
| + new base::RefCountedString();
|
| + category_filter_.ToString(&(category_filter_str_ptr->data()));
|
| + filter->SendBeginTracing(category_filter_str_ptr->data());
|
| if (!watch_category_.empty())
|
| filter->SendSetWatchEvent(watch_category_, watch_name_);
|
| }
|
| @@ -283,11 +271,13 @@ void TraceControllerImpl::OnTracingBegan(TraceSubscriber* subscriber) {
|
|
|
| subscriber_ = subscriber;
|
|
|
| - TraceLog::GetInstance()->GetEnabledTraceCategories(&included_categories_,
|
| - &excluded_categories_);
|
| + category_filter_ = TraceLog::GetInstance()->GetCurrentCategoryFilter();
|
| + scoped_refptr<base::RefCountedString> category_filter_str_ptr =
|
| + new base::RefCountedString();
|
| + category_filter_.ToString(&(category_filter_str_ptr->data()));
|
| // Notify all child processes.
|
| for (FilterMap::iterator it = filters_.begin(); it != filters_.end(); ++it) {
|
| - it->get()->SendBeginTracing(included_categories_, excluded_categories_);
|
| + it->get()->SendBeginTracing(category_filter_str_ptr->data());
|
| }
|
| }
|
|
|
|
|