diff options
44 files changed, 181 insertions, 201 deletions
diff --git a/content/app/android/library_loader_hooks.cc b/content/app/android/library_loader_hooks.cc index 5f0c4e5..0063813 100644 --- a/content/app/android/library_loader_hooks.cc +++ b/content/app/android/library_loader_hooks.cc @@ -83,19 +83,19 @@ bool LibraryLoaded(JNIEnv* env, jclass clazz) { base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); if (command_line->HasSwitch(switches::kTraceStartup)) { - base::debug::CategoryFilter category_filter( + base::trace_event::CategoryFilter category_filter( command_line->GetSwitchValueASCII(switches::kTraceStartup)); - base::debug::TraceLog::GetInstance()->SetEnabled( + base::trace_event::TraceLog::GetInstance()->SetEnabled( category_filter, - base::debug::TraceLog::RECORDING_MODE, - base::debug::TraceOptions()); + base::trace_event::TraceLog::RECORDING_MODE, + base::trace_event::TraceOptions()); } // Android's main browser loop is custom so we set the browser // name here as early as possible. TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); - base::debug::TraceLog::GetInstance()->SetProcessName("Browser"); - base::debug::TraceLog::GetInstance()->SetProcessSortIndex( + base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser"); + base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( kTraceEventBrowserProcessSortIndex); // Can only use event tracing after setting up the command line. diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc index 378a509..a57f04a 100644 --- a/content/app/content_main_runner.cc +++ b/content/app/content_main_runner.cc @@ -656,13 +656,13 @@ class ContentMainRunnerImpl : public ContentMainRunner { // Enable startup tracing asap to avoid early TRACE_EVENT calls being // ignored. if (command_line.HasSwitch(switches::kTraceStartup)) { - base::debug::CategoryFilter category_filter( + base::trace_event::CategoryFilter category_filter( command_line.GetSwitchValueASCII(switches::kTraceStartup)); - base::debug::TraceLog::GetInstance()->SetEnabled( + base::trace_event::TraceLog::GetInstance()->SetEnabled( category_filter, - base::debug::TraceLog::RECORDING_MODE, - base::debug::TraceOptions( - base::debug::RECORD_UNTIL_FULL)); + base::trace_event::TraceLog::RECORDING_MODE, + base::trace_event::TraceOptions( + base::trace_event::RECORD_UNTIL_FULL)); } #if !defined(OS_ANDROID) // Android tracing started at the beginning of the method. diff --git a/content/browser/android/tracing_controller_android.cc b/content/browser/android/tracing_controller_android.cc index bd11672..6953a0d 100644 --- a/content/browser/android/tracing_controller_android.cc +++ b/content/browser/android/tracing_controller_android.cc @@ -35,7 +35,7 @@ bool TracingControllerAndroid::StartTracing(JNIEnv* env, jstring jtraceoptions) { std::string categories = base::android::ConvertJavaStringToUTF8(env, jcategories); - base::debug::TraceOptions trace_options; + base::trace_event::TraceOptions trace_options; trace_options.SetFromString( base::android::ConvertJavaStringToUTF8(env, jtraceoptions)); @@ -43,7 +43,7 @@ bool TracingControllerAndroid::StartTracing(JNIEnv* env, LOG(WARNING) << "Logging performance trace to file"; return TracingController::GetInstance()->EnableRecording( - base::debug::CategoryFilter(categories), + base::trace_event::CategoryFilter(categories), trace_options, TracingController::EnableRecordingDoneCallback()); } @@ -105,8 +105,10 @@ void TracingControllerAndroid::OnKnownCategoriesReceived( } static jstring GetDefaultCategories(JNIEnv* env, jobject obj) { - return base::android::ConvertUTF8ToJavaString(env, - base::debug::CategoryFilter::kDefaultCategoryFilterString).Release(); + return base::android::ConvertUTF8ToJavaString( + env, + base::trace_event::CategoryFilter::kDefaultCategoryFilterString) + .Release(); } bool RegisterTracingControllerAndroid(JNIEnv* env) { diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc index 7bf79a3..4c114b4 100644 --- a/content/browser/browser_main.cc +++ b/content/browser/browser_main.cc @@ -13,8 +13,8 @@ namespace content { // Main routine for running as the Browser process. int BrowserMain(const MainFunctionParams& parameters) { TRACE_EVENT_BEGIN_ETW("BrowserMain", 0, ""); - base::debug::TraceLog::GetInstance()->SetProcessName("Browser"); - base::debug::TraceLog::GetInstance()->SetProcessSortIndex( + base::trace_event::TraceLog::GetInstance()->SetProcessName("Browser"); + base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( kTraceEventBrowserProcessSortIndex); scoped_ptr<BrowserMainRunner> main_runner(BrowserMainRunner::Create()); diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index 402a7c3..d0386c7 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -541,8 +541,9 @@ void BrowserMainLoop::MainMessageLoopStart() { } { - system_stats_monitor_.reset(new base::debug::TraceEventSystemStatsMonitor( - base::ThreadTaskRunnerHandle::Get())); + system_stats_monitor_.reset( + new base::trace_event::TraceEventSystemStatsMonitor( + base::ThreadTaskRunnerHandle::Get())); } #endif // !defined(OS_IOS) @@ -585,10 +586,9 @@ void BrowserMainLoop::MainMessageLoopStart() { } #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) - trace_memory_controller_.reset(new base::debug::TraceMemoryController( + trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( base::MessageLoop::current()->message_loop_proxy(), - ::HeapProfilerWithPseudoStackStart, - ::HeapProfilerStop, + ::HeapProfilerWithPseudoStackStart, ::HeapProfilerStop, ::GetHeapProfile)); #endif } diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h index 176c4ba..5050cd0 100644 --- a/content/browser/browser_main_loop.h +++ b/content/browser/browser_main_loop.h @@ -27,13 +27,6 @@ namespace trace_event { class TraceMemoryController; class TraceEventSystemStatsMonitor; } // namespace trace_event - -// TODO(ssid): remove these aliases after the tracing clients are moved to the -// new trace_event namespace. See crbug.com/451032. ETA: March 2015 -namespace debug { -using ::base::trace_event::TraceEventSystemStatsMonitor; -using ::base::trace_event::TraceMemoryController; -} // namespace debug } // namespace base namespace media { @@ -219,8 +212,9 @@ class CONTENT_EXPORT BrowserMainLoop { scoped_ptr<BrowserProcessSubThread> io_thread_; scoped_ptr<base::Thread> indexed_db_thread_; scoped_ptr<MemoryObserver> memory_observer_; - scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; - scoped_ptr<base::debug::TraceEventSystemStatsMonitor> system_stats_monitor_; + scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; + scoped_ptr<base::trace_event::TraceEventSystemStatsMonitor> + system_stats_monitor_; bool is_tracing_startup_; base::FilePath startup_trace_file_; diff --git a/content/browser/browser_shutdown_profile_dumper.cc b/content/browser/browser_shutdown_profile_dumper.cc index 30bddd0..6c4d8c8 100644 --- a/content/browser/browser_shutdown_profile_dumper.cc +++ b/content/browser/browser_shutdown_profile_dumper.cc @@ -30,8 +30,8 @@ BrowserShutdownProfileDumper::~BrowserShutdownProfileDumper() { } static float GetTraceBufferPercentFull() { - base::debug::TraceLogStatus status = - base::debug::TraceLog::GetInstance()->GetStatus(); + base::trace_event::TraceLogStatus status = + base::trace_event::TraceLog::GetInstance()->GetStatus(); return 100 * static_cast<float>(static_cast<double>(status.event_count) / status.event_capacity); } @@ -72,8 +72,8 @@ void BrowserShutdownProfileDumper::WriteTracesToDisc() { void BrowserShutdownProfileDumper::EndTraceAndFlush( base::WaitableEvent* flush_complete_event) { - base::debug::TraceLog::GetInstance()->SetDisabled(); - base::debug::TraceLog::GetInstance()->Flush( + base::trace_event::TraceLog::GetInstance()->SetDisabled(); + base::trace_event::TraceLog::GetInstance()->Flush( base::Bind(&BrowserShutdownProfileDumper::WriteTraceDataCollected, base::Unretained(this), base::Unretained(flush_complete_event))); diff --git a/content/browser/devtools/protocol/tracing_handler.cc b/content/browser/devtools/protocol/tracing_handler.cc index 6cb81a3..a4319b9 100644 --- a/content/browser/devtools/protocol/tracing_handler.cc +++ b/content/browser/devtools/protocol/tracing_handler.cc @@ -91,8 +91,9 @@ Response TracingHandler::Start(DevToolsCommandId command_id, return Response::InternalError("Tracing is already started"); is_recording_ = true; - base::debug::TraceOptions options = TraceOptionsFromString(options_str); - base::debug::CategoryFilter filter(categories ? *categories : std::string()); + base::trace_event::TraceOptions options = TraceOptionsFromString(options_str); + base::trace_event::CategoryFilter filter(categories ? *categories + : std::string()); if (buffer_usage_reporting_interval) SetupTimer(*buffer_usage_reporting_interval); @@ -157,9 +158,9 @@ void TracingHandler::OnCategoriesReceived( GetCategoriesResponse::Create()->set_categories(categories)); } -base::debug::TraceOptions TracingHandler::TraceOptionsFromString( +base::trace_event::TraceOptions TracingHandler::TraceOptionsFromString( const std::string* options) { - base::debug::TraceOptions ret; + base::trace_event::TraceOptions ret; if (!options) return ret; @@ -169,11 +170,11 @@ base::debug::TraceOptions TracingHandler::TraceOptionsFromString( base::SplitString(*options, ',', &split); for (iter = split.begin(); iter != split.end(); ++iter) { if (*iter == kRecordUntilFull) { - ret.record_mode = base::debug::RECORD_UNTIL_FULL; + ret.record_mode = base::trace_event::RECORD_UNTIL_FULL; } else if (*iter == kRecordContinuously) { - ret.record_mode = base::debug::RECORD_CONTINUOUSLY; + ret.record_mode = base::trace_event::RECORD_CONTINUOUSLY; } else if (*iter == kRecordAsMuchAsPossible) { - ret.record_mode = base::debug::RECORD_AS_MUCH_AS_POSSIBLE; + ret.record_mode = base::trace_event::RECORD_AS_MUCH_AS_POSSIBLE; } else if (*iter == kEnableSampling) { ret.enable_sampling = true; } diff --git a/content/browser/devtools/protocol/tracing_handler.h b/content/browser/devtools/protocol/tracing_handler.h index 7b41ce6..1afd6b3 100644 --- a/content/browser/devtools/protocol/tracing_handler.h +++ b/content/browser/devtools/protocol/tracing_handler.h @@ -50,7 +50,8 @@ class TracingHandler { void OnCategoriesReceived(DevToolsCommandId command_id, const std::set<std::string>& category_set); - base::debug::TraceOptions TraceOptionsFromString(const std::string* options); + base::trace_event::TraceOptions TraceOptionsFromString( + const std::string* options); void SetupTimer(double usage_reporting_interval); diff --git a/content/browser/media/webrtc_getusermedia_browsertest.cc b/content/browser/media/webrtc_getusermedia_browsertest.cc index c2c934e..8c3eb9c 100644 --- a/content/browser/media/webrtc_getusermedia_browsertest.cc +++ b/content/browser/media/webrtc_getusermedia_browsertest.cc @@ -82,11 +82,12 @@ class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest { void StartTracing() { CHECK(trace_log_ == NULL) << "Can only can start tracing once"; - trace_log_ = base::debug::TraceLog::GetInstance(); - base::debug::TraceOptions trace_options(base::debug::RECORD_UNTIL_FULL); + trace_log_ = base::trace_event::TraceLog::GetInstance(); + base::trace_event::TraceOptions trace_options( + base::trace_event::RECORD_UNTIL_FULL); trace_options.enable_sampling = true; - trace_log_->SetEnabled(base::debug::CategoryFilter("video"), - base::debug::TraceLog::RECORDING_MODE, + trace_log_->SetEnabled(base::trace_event::CategoryFilter("video"), + base::trace_event::TraceLog::RECORDING_MODE, trace_options); // Check that we are indeed recording. EXPECT_EQ(trace_log_->GetNumTracesRecorded(), 1); @@ -231,7 +232,7 @@ class WebRtcGetUserMediaBrowserTest: public WebRtcContentBrowserTest { } private: - base::debug::TraceLog* trace_log_; + base::trace_event::TraceLog* trace_log_; scoped_refptr<base::RefCountedString> recorded_trace_data_; scoped_refptr<MessageLoopRunner> message_loop_runner_; }; diff --git a/content/browser/tracing/trace_message_filter.cc b/content/browser/tracing/trace_message_filter.cc index 96721d2..e1dbdeb 100644 --- a/content/browser/tracing/trace_message_filter.cc +++ b/content/browser/tracing/trace_message_filter.cc @@ -28,7 +28,7 @@ void TraceMessageFilter::OnChannelClosing() { OnCaptureMonitoringSnapshotAcked(); if (is_awaiting_buffer_percent_full_ack_) - OnTraceLogStatusReply(base::debug::TraceLogStatus()); + OnTraceLogStatusReply(base::trace_event::TraceLogStatus()); TracingControllerImpl::GetInstance()->RemoveTraceMessageFilter(this); } @@ -57,8 +57,8 @@ bool TraceMessageFilter::OnMessageReceived(const IPC::Message& message) { } void TraceMessageFilter::SendBeginTracing( - const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& options) { + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& options) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); Send(new TracingMsg_BeginTracing(category_filter.ToString(), base::TimeTicks::NowFromSystemTraceTime(), @@ -73,8 +73,8 @@ void TraceMessageFilter::SendEndTracing() { } void TraceMessageFilter::SendEnableMonitoring( - const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& options) { + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& options) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); Send(new TracingMsg_EnableMonitoring(category_filter.ToString(), base::TimeTicks::NowFromSystemTraceTime(), @@ -158,7 +158,7 @@ void TraceMessageFilter::OnWatchEventMatched() { } void TraceMessageFilter::OnTraceLogStatusReply( - const base::debug::TraceLogStatus& status) { + const base::trace_event::TraceLogStatus& status) { if (is_awaiting_buffer_percent_full_ack_) { is_awaiting_buffer_percent_full_ack_ = false; TracingControllerImpl::GetInstance()->OnTraceLogStatusReply(this, status); diff --git a/content/browser/tracing/trace_message_filter.h b/content/browser/tracing/trace_message_filter.h index 6c03599..9bde6b7 100644 --- a/content/browser/tracing/trace_message_filter.h +++ b/content/browser/tracing/trace_message_filter.h @@ -24,11 +24,13 @@ class TraceMessageFilter : public BrowserMessageFilter { void OnChannelClosing() override; bool OnMessageReceived(const IPC::Message& message) override; - void SendBeginTracing(const base::debug::CategoryFilter& category_filter_str, - const base::debug::TraceOptions& options); + void SendBeginTracing( + const base::trace_event::CategoryFilter& category_filter_str, + const base::trace_event::TraceOptions& options); void SendEndTracing(); - void SendEnableMonitoring(const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& options); + void SendEnableMonitoring( + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& options); void SendDisableMonitoring(); void SendCaptureMonitoringSnapshot(); void SendGetTraceLogStatus(); @@ -45,7 +47,7 @@ class TraceMessageFilter : public BrowserMessageFilter { void OnEndTracingAck(const std::vector<std::string>& known_categories); void OnCaptureMonitoringSnapshotAcked(); void OnWatchEventMatched(); - void OnTraceLogStatusReply(const base::debug::TraceLogStatus& status); + void OnTraceLogStatusReply(const base::trace_event::TraceLogStatus& status); void OnTraceDataCollected(const std::string& data); void OnMonitoringTraceDataCollected(const std::string& data); diff --git a/content/browser/tracing/tracing_controller_browsertest.cc b/content/browser/tracing/tracing_controller_browsertest.cc index cb74923..de6c4dc 100644 --- a/content/browser/tracing/tracing_controller_browsertest.cc +++ b/content/browser/tracing/tracing_controller_browsertest.cc @@ -11,10 +11,10 @@ #include "content/public/test/content_browser_test_utils.h" #include "content/shell/browser/shell.h" -using base::debug::CategoryFilter; -using base::debug::TraceOptions; -using base::debug::RECORD_CONTINUOUSLY; -using base::debug::RECORD_UNTIL_FULL; +using base::trace_event::CategoryFilter; +using base::trace_event::TraceOptions; +using base::trace_event::RECORD_CONTINUOUSLY; +using base::trace_event::RECORD_UNTIL_FULL; namespace content { diff --git a/content/browser/tracing/tracing_controller_impl.cc b/content/browser/tracing/tracing_controller_impl.cc index 6717ee9..afff073 100644 --- a/content/browser/tracing/tracing_controller_impl.cc +++ b/content/browser/tracing/tracing_controller_impl.cc @@ -24,9 +24,9 @@ #include "content/browser/tracing/etw_system_event_consumer_win.h" #endif -using base::debug::TraceLog; -using base::debug::TraceOptions; -using base::debug::CategoryFilter; +using base::trace_event::TraceLog; +using base::trace_event::TraceOptions; +using base::trace_event::CategoryFilter; namespace content { @@ -264,7 +264,7 @@ bool TracingControllerImpl::EnableRecording( base::Bind(&TracingControllerImpl::SetEnabledOnFileThread, base::Unretained(this), category_filter, - base::debug::TraceLog::RECORDING_MODE, + base::trace_event::TraceLog::RECORDING_MODE, trace_options, on_enable_recording_done_callback)); return true; @@ -383,7 +383,7 @@ bool TracingControllerImpl::EnableMonitoring( base::Bind(&TracingControllerImpl::SetEnabledOnFileThread, base::Unretained(this), category_filter, - base::debug::TraceLog::MONITORING_MODE, + base::trace_event::TraceLog::MONITORING_MODE, trace_options, on_enable_monitoring_done_callback)); return true; @@ -515,7 +515,8 @@ bool TracingControllerImpl::GetTraceBufferUsage( maximum_trace_buffer_usage_ = 0; approximate_event_count_ = 0; - base::debug::TraceLogStatus status = TraceLog::GetInstance()->GetStatus(); + base::trace_event::TraceLogStatus status = + TraceLog::GetInstance()->GetStatus(); // Call OnTraceLogStatusReply unconditionally for the browser process. // This will result in immediate execution of the callback if there are no // child processes. @@ -643,7 +644,7 @@ void TracingControllerImpl::RemoveTraceMessageFilter( base::Bind(&TracingControllerImpl::OnTraceLogStatusReply, base::Unretained(this), make_scoped_refptr(trace_message_filter), - base::debug::TraceLogStatus())); + base::trace_event::TraceLogStatus())); } } @@ -820,7 +821,7 @@ void TracingControllerImpl::OnLocalMonitoringTraceDataCollected( void TracingControllerImpl::OnTraceLogStatusReply( TraceMessageFilter* trace_message_filter, - const base::debug::TraceLogStatus& status) { + const base::trace_event::TraceLogStatus& status) { if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, diff --git a/content/browser/tracing/tracing_controller_impl.h b/content/browser/tracing/tracing_controller_impl.h index 330b928..a5563a8 100644 --- a/content/browser/tracing/tracing_controller_impl.h +++ b/content/browser/tracing/tracing_controller_impl.h @@ -28,19 +28,20 @@ class TracingControllerImpl : public TracingController { // TracingController implementation. bool GetCategories(const GetCategoriesDoneCallback& callback) override; - bool EnableRecording(const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, + bool EnableRecording(const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& trace_options, const EnableRecordingDoneCallback& callback) override; bool DisableRecording(const scoped_refptr<TraceDataSink>& sink) override; - bool EnableMonitoring(const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, - const EnableMonitoringDoneCallback& callback) override; + bool EnableMonitoring( + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& trace_options, + const EnableMonitoringDoneCallback& callback) override; bool DisableMonitoring( const DisableMonitoringDoneCallback& callback) override; void GetMonitoringStatus( bool* out_enabled, - base::debug::CategoryFilter* out_category_filter, - base::debug::TraceOptions* out_trace_options) override; + base::trace_event::CategoryFilter* out_category_filter, + base::trace_event::TraceOptions* out_trace_options) override; bool CaptureMonitoringSnapshot( const scoped_refptr<TraceDataSink>& sink) override; bool GetTraceBufferUsage( @@ -117,23 +118,24 @@ class TracingControllerImpl : public TracingController { TraceMessageFilter* trace_message_filter); void OnTraceLogStatusReply(TraceMessageFilter* trace_message_filter, - const base::debug::TraceLogStatus& status); + const base::trace_event::TraceLogStatus& status); void OnWatchEventMatched(); void SetEnabledOnFileThread( - const base::debug::CategoryFilter& category_filter, + const base::trace_event::CategoryFilter& category_filter, int mode, - const base::debug::TraceOptions& trace_options, + const base::trace_event::TraceOptions& trace_options, const base::Closure& callback); void SetDisabledOnFileThread(const base::Closure& callback); - void OnEnableRecordingDone(const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, - const EnableRecordingDoneCallback& callback); + void OnEnableRecordingDone( + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& trace_options, + const EnableRecordingDoneCallback& callback); void OnDisableRecordingDone(); void OnEnableMonitoringDone( - const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& trace_options, const EnableMonitoringDoneCallback& callback); void OnDisableMonitoringDone(const DisableMonitoringDoneCallback& callback); @@ -158,7 +160,7 @@ class TracingControllerImpl : public TracingController { #endif bool is_recording_; bool is_monitoring_; - base::debug::TraceOptions trace_options_; + base::trace_event::TraceOptions trace_options_; GetCategoriesDoneCallback pending_get_categories_done_callback_; GetTraceBufferUsageCallback pending_trace_buffer_usage_callback_; diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc index a219c3d..facad79 100644 --- a/content/browser/tracing/tracing_ui.cc +++ b/content/browser/tracing/tracing_ui.cc @@ -54,8 +54,8 @@ void OnGotCategories(const WebUIDataSource::GotDataCallback& callback, } bool GetTracingOptions(const std::string& data64, - base::debug::CategoryFilter* category_filter, - base::debug::TraceOptions* tracing_options) { + base::trace_event::CategoryFilter* category_filter, + base::trace_event::TraceOptions* tracing_options) { std::string data; if (!base::Base64Decode(data64, &data)) { LOG(ERROR) << "Options were not base64 encoded."; @@ -86,7 +86,7 @@ bool GetTracingOptions(const std::string& data64, bool options_ok = true; std::string category_filter_string; options_ok &= options->GetString("categoryFilter", &category_filter_string); - *category_filter = base::debug::CategoryFilter(category_filter_string); + *category_filter = base::trace_event::CategoryFilter(category_filter_string); options_ok &= options->GetBoolean("useSystemTracing", &tracing_options->enable_systrace); @@ -98,9 +98,9 @@ bool GetTracingOptions(const std::string& data64, options->GetBoolean("useContinuousTracing", &use_continuous_tracing); if (use_continuous_tracing) - tracing_options->record_mode = base::debug::RECORD_CONTINUOUSLY; + tracing_options->record_mode = base::trace_event::RECORD_CONTINUOUSLY; else - tracing_options->record_mode = base::debug::RECORD_UNTIL_FULL; + tracing_options->record_mode = base::trace_event::RECORD_UNTIL_FULL; if (!options_ok) { LOG(ERROR) << "Malformed options"; @@ -113,8 +113,8 @@ void OnRecordingEnabledAck(const WebUIDataSource::GotDataCallback& callback); bool BeginRecording(const std::string& data64, const WebUIDataSource::GotDataCallback& callback) { - base::debug::CategoryFilter category_filter(""); - base::debug::TraceOptions tracing_options; + base::trace_event::CategoryFilter category_filter(""); + base::trace_event::TraceOptions tracing_options; if (!GetTracingOptions(data64, &category_filter, &tracing_options)) return false; @@ -155,8 +155,8 @@ void OnMonitoringEnabledAck(const WebUIDataSource::GotDataCallback& callback); bool EnableMonitoring(const std::string& data64, const WebUIDataSource::GotDataCallback& callback) { - base::debug::TraceOptions tracing_options; - base::debug::CategoryFilter category_filter(""); + base::trace_event::TraceOptions tracing_options; + base::trace_event::CategoryFilter category_filter(""); if (!GetTracingOptions(data64, &category_filter, &tracing_options)) return false; @@ -178,8 +178,8 @@ void OnMonitoringDisabled(const WebUIDataSource::GotDataCallback& callback) { void GetMonitoringStatus(const WebUIDataSource::GotDataCallback& callback) { bool is_monitoring; - base::debug::CategoryFilter category_filter(""); - base::debug::TraceOptions options; + base::trace_event::CategoryFilter category_filter(""); + base::trace_event::TraceOptions options; TracingController::GetInstance()->GetMonitoringStatus( &is_monitoring, &category_filter, &options); @@ -190,7 +190,7 @@ void GetMonitoringStatus(const WebUIDataSource::GotDataCallback& callback) { monitoring_options->SetBoolean("useSystemTracing", options.enable_systrace); monitoring_options->SetBoolean( "useContinuousTracing", - options.record_mode == base::debug::RECORD_CONTINUOUSLY); + options.record_mode == base::trace_event::RECORD_CONTINUOUSLY); monitoring_options->SetBoolean("useSampling", options.enable_sampling); std::string monitoring_options_json; diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc index 53b076f..c41f1f1 100644 --- a/content/child/blink_platform_impl.cc +++ b/content/child/blink_platform_impl.cc @@ -140,7 +140,7 @@ class MemoryUsageCache { }; class ConvertableToTraceFormatWrapper - : public base::debug::ConvertableToTraceFormat { + : public base::trace_event::ConvertableToTraceFormat { public: explicit ConvertableToTraceFormatWrapper( const blink::WebConvertableToTraceFormat& convertable) @@ -596,7 +596,7 @@ long* BlinkPlatformImpl::getTraceSamplingState( static_assert( sizeof(blink::Platform::TraceEventHandle) == - sizeof(base::debug::TraceEventHandle), + sizeof(base::trace_event::TraceEventHandle), "TraceEventHandle types must be same size"); blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( @@ -612,7 +612,7 @@ blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( unsigned char flags) { base::TimeTicks timestamp_tt = base::TimeTicks::FromInternalValue( static_cast<int64>(timestamp * base::Time::kMicrosecondsPerSecond)); - base::debug::TraceEventHandle handle = + base::trace_event::TraceEventHandle handle = TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP( phase, category_group_enabled, name, id, base::PlatformThread::CurrentId(), @@ -635,7 +635,8 @@ blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( const unsigned long long* arg_values, const blink::WebConvertableToTraceFormat* convertable_values, unsigned char flags) { - scoped_refptr<base::debug::ConvertableToTraceFormat> convertable_wrappers[2]; + scoped_refptr<base::trace_event::ConvertableToTraceFormat> + convertable_wrappers[2]; if (convertable_values) { size_t size = std::min(static_cast<size_t>(num_args), arraysize(convertable_wrappers)); @@ -648,7 +649,7 @@ blink::Platform::TraceEventHandle BlinkPlatformImpl::addTraceEvent( } base::TimeTicks timestamp_tt = base::TimeTicks::FromInternalValue( static_cast<int64>(timestamp * base::Time::kMicrosecondsPerSecond)); - base::debug::TraceEventHandle handle = + base::trace_event::TraceEventHandle handle = TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_THREAD_ID_AND_TIMESTAMP(phase, category_group_enabled, name, @@ -670,7 +671,7 @@ void BlinkPlatformImpl::updateTraceEventDuration( const unsigned char* category_group_enabled, const char* name, TraceEventHandle handle) { - base::debug::TraceEventHandle traceEventHandle; + base::trace_event::TraceEventHandle traceEventHandle; memcpy(&traceEventHandle, &handle, sizeof(handle)); TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION( category_group_enabled, name, traceEventHandle); diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc index 4db2e27..3fee9b3 100644 --- a/content/child/child_thread_impl.cc +++ b/content/child/child_thread_impl.cc @@ -382,11 +382,9 @@ void ChildThreadImpl::Init(const Options& options) { #endif #if defined(TCMALLOC_TRACE_MEMORY_SUPPORTED) - trace_memory_controller_.reset(new base::debug::TraceMemoryController( - message_loop_->message_loop_proxy(), - ::HeapProfilerWithPseudoStackStart, - ::HeapProfilerStop, - ::GetHeapProfile)); + trace_memory_controller_.reset(new base::trace_event::TraceMemoryController( + message_loop_->message_loop_proxy(), ::HeapProfilerWithPseudoStackStart, + ::HeapProfilerStop, ::GetHeapProfile)); #endif shared_bitmap_manager_.reset( diff --git a/content/child/child_thread_impl.h b/content/child/child_thread_impl.h index 6f1727a..4016861 100644 --- a/content/child/child_thread_impl.h +++ b/content/child/child_thread_impl.h @@ -25,12 +25,6 @@ class MessageLoop; namespace trace_event { class TraceMemoryController; } // namespace trace_event - -// TODO(ssid): remove these aliases after the tracing clients are moved to the -// new trace_event namespace. See crbug.com/451032. ETA: March 2015 -namespace debug { -using ::base::trace_event::TraceMemoryController; -} // namespace debug } // namespace base namespace IPC { @@ -295,7 +289,7 @@ class CONTENT_EXPORT ChildThreadImpl // Observes the trace event system. When tracing is enabled, optionally // starts profiling the tcmalloc heap. - scoped_ptr<base::debug::TraceMemoryController> trace_memory_controller_; + scoped_ptr<base::trace_event::TraceMemoryController> trace_memory_controller_; scoped_ptr<base::PowerMonitor> power_monitor_; diff --git a/content/common/gpu/client/gl_helper_unittest.cc b/content/common/gpu/client/gl_helper_unittest.cc index 85a300c..c28cc54 100644 --- a/content/common/gpu/client/gl_helper_unittest.cc +++ b/content/common/gpu/client/gl_helper_unittest.cc @@ -76,11 +76,11 @@ class GLHelperTest : public testing::Test { } void StartTracing(const std::string& filter) { - base::debug::TraceLog::GetInstance()->SetEnabled( - base::debug::CategoryFilter(filter), - base::debug::TraceLog::RECORDING_MODE, - base::debug::TraceOptions( - base::debug::RECORD_UNTIL_FULL)); + base::trace_event::TraceLog::GetInstance()->SetEnabled( + base::trace_event::CategoryFilter(filter), + base::trace_event::TraceLog::RECORDING_MODE, + base::trace_event::TraceOptions( + base::trace_event::RECORD_UNTIL_FULL)); } static void TraceDataCB( @@ -101,9 +101,9 @@ class GLHelperTest : public testing::Test { // of event name->counts. void EndTracing(std::map<std::string, int>* event_counts) { std::string json_data = "["; - base::debug::TraceLog::GetInstance()->SetDisabled(); + base::trace_event::TraceLog::GetInstance()->SetDisabled(); base::RunLoop run_loop; - base::debug::TraceLog::GetInstance()->Flush( + base::trace_event::TraceLog::GetInstance()->Flush( base::Bind(&GLHelperTest::TraceDataCB, run_loop.QuitClosure(), base::Unretained(&json_data))); diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index 4f1eeb3..62919d5 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -111,10 +111,10 @@ const int64 kHandleMoreWorkPeriodBusyMs = 1; // Prevents idle work from being starved. const int64 kMaxTimeSinceIdleMs = 10; -class DevToolsChannelData : public base::debug::ConvertableToTraceFormat { +class DevToolsChannelData : public base::trace_event::ConvertableToTraceFormat { public: - static scoped_refptr<base::debug::ConvertableToTraceFormat> CreateForChannel( - GpuChannel* channel); + static scoped_refptr<base::trace_event::ConvertableToTraceFormat> + CreateForChannel(GpuChannel* channel); void AppendAsTraceFormat(std::string* out) const override { std::string tmp; @@ -129,7 +129,7 @@ class DevToolsChannelData : public base::debug::ConvertableToTraceFormat { DISALLOW_COPY_AND_ASSIGN(DevToolsChannelData); }; -scoped_refptr<base::debug::ConvertableToTraceFormat> +scoped_refptr<base::trace_event::ConvertableToTraceFormat> DevToolsChannelData::CreateForChannel(GpuChannel* channel) { scoped_ptr<base::DictionaryValue> res(new base::DictionaryValue); res->SetInteger("renderer_pid", channel->renderer_pid()); diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index aeacd36..061ed17 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -104,8 +104,8 @@ bool GpuProcessLogMessageHandler(int severity, // Main function for starting the Gpu process. int GpuMain(const MainFunctionParams& parameters) { TRACE_EVENT0("gpu", "GpuMain"); - base::debug::TraceLog::GetInstance()->SetProcessName("GPU Process"); - base::debug::TraceLog::GetInstance()->SetProcessSortIndex( + base::trace_event::TraceLog::GetInstance()->SetProcessName("GPU Process"); + base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( kTraceEventGpuProcessSortIndex); const base::CommandLine& command_line = parameters.command_line; diff --git a/content/plugin/plugin_main.cc b/content/plugin/plugin_main.cc index 1de9508..2cef897 100644 --- a/content/plugin/plugin_main.cc +++ b/content/plugin/plugin_main.cc @@ -44,8 +44,8 @@ int PluginMain(const MainFunctionParams& parameters) { #endif base::MessageLoopForUI main_message_loop; base::PlatformThread::SetName("CrPluginMain"); - base::debug::TraceLog::GetInstance()->SetProcessName("Plugin Process"); - base::debug::TraceLog::GetInstance()->SetProcessSortIndex( + base::trace_event::TraceLog::GetInstance()->SetProcessName("Plugin Process"); + base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( kTraceEventPluginProcessSortIndex); const base::CommandLine& parsed_command_line = parameters.command_line; diff --git a/content/ppapi_plugin/ppapi_broker_main.cc b/content/ppapi_plugin/ppapi_broker_main.cc index 0178bf1..b441d7a 100644 --- a/content/ppapi_plugin/ppapi_broker_main.cc +++ b/content/ppapi_plugin/ppapi_broker_main.cc @@ -22,8 +22,9 @@ int PpapiBrokerMain(const MainFunctionParams& parameters) { base::MessageLoop main_message_loop; base::PlatformThread::SetName("CrPPAPIBrokerMain"); - base::debug::TraceLog::GetInstance()->SetProcessName("PPAPI Broker Process"); - base::debug::TraceLog::GetInstance()->SetProcessSortIndex( + base::trace_event::TraceLog::GetInstance()->SetProcessName( + "PPAPI Broker Process"); + base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( kTraceEventPpapiBrokerProcessSortIndex); ChildProcess ppapi_broker_process; diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index 065c6f2..6c80f03 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc @@ -111,8 +111,8 @@ int PpapiPluginMain(const MainFunctionParams& parameters) { base::MessageLoop main_message_loop; base::PlatformThread::SetName("CrPPAPIMain"); - base::debug::TraceLog::GetInstance()->SetProcessName("PPAPI Process"); - base::debug::TraceLog::GetInstance()->SetProcessSortIndex( + base::trace_event::TraceLog::GetInstance()->SetProcessName("PPAPI Process"); + base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( kTraceEventPpapiProcessSortIndex); #if defined(OS_LINUX) && defined(USE_NSS) diff --git a/content/public/browser/tracing_controller.h b/content/public/browser/tracing_controller.h index 8c548dc..0cbed70 100644 --- a/content/public/browser/tracing_controller.h +++ b/content/public/browser/tracing_controller.h @@ -87,8 +87,8 @@ class TracingController { // |options| controls what kind of tracing is enabled. typedef base::Callback<void()> EnableRecordingDoneCallback; virtual bool EnableRecording( - const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& trace_options, const EnableRecordingDoneCallback& callback) = 0; // Stop recording on all processes. @@ -124,8 +124,8 @@ class TracingController { // |options| controls what kind of tracing is enabled. typedef base::Callback<void()> EnableMonitoringDoneCallback; virtual bool EnableMonitoring( - const base::debug::CategoryFilter& category_filter, - const base::debug::TraceOptions& trace_options, + const base::trace_event::CategoryFilter& category_filter, + const base::trace_event::TraceOptions& trace_options, const EnableMonitoringDoneCallback& callback) = 0; // Stop monitoring on all processes. @@ -139,8 +139,8 @@ class TracingController { // Get the current monitoring configuration. virtual void GetMonitoringStatus( bool* out_enabled, - base::debug::CategoryFilter* out_category_filter, - base::debug::TraceOptions* out_trace_options) = 0; + base::trace_event::CategoryFilter* out_category_filter, + base::trace_event::TraceOptions* out_trace_options) = 0; // Get the current monitoring traced data. // diff --git a/content/public/test/browser_test_base.cc b/content/public/test/browser_test_base.cc index aa0d6e5..2cd9502 100644 --- a/content/public/test/browser_test_base.cc +++ b/content/public/test/browser_test_base.cc @@ -283,12 +283,12 @@ void BrowserTestBase::ProxyRunTestOnMainThreadLoop() { if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableTracing)) { - base::debug::CategoryFilter category_filter( + base::trace_event::CategoryFilter category_filter( base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( switches::kEnableTracing)); TracingController::GetInstance()->EnableRecording( category_filter, - base::debug::TraceOptions(base::debug::RECORD_CONTINUOUSLY), + base::trace_event::TraceOptions(base::trace_event::RECORD_CONTINUOUSLY), TracingController::EnableRecordingDoneCallback()); } diff --git a/content/renderer/devtools/devtools_agent.cc b/content/renderer/devtools/devtools_agent.cc index 07edd7b..caf4182 100644 --- a/content/renderer/devtools/devtools_agent.cc +++ b/content/renderer/devtools/devtools_agent.cc @@ -43,8 +43,8 @@ using blink::WebCString; using blink::WebVector; using blink::WebView; -using base::debug::TraceLog; -using base::debug::TraceOptions; +using base::trace_event::TraceLog; +using base::trace_event::TraceOptions; namespace content { @@ -163,8 +163,9 @@ void DevToolsAgent::setTraceEventCallback(const WebString& category_filter, base::subtle::NoBarrier_Store(&event_callback_, reinterpret_cast<base::subtle::AtomicWord>(cb)); if (!!cb) { - trace_log->SetEventCallbackEnabled(base::debug::CategoryFilter( - category_filter.utf8()), TraceEventCallbackWrapper); + trace_log->SetEventCallbackEnabled( + base::trace_event::CategoryFilter(category_filter.utf8()), + TraceEventCallbackWrapper); } else { trace_log->SetEventCallbackDisabled(); } @@ -172,9 +173,9 @@ void DevToolsAgent::setTraceEventCallback(const WebString& category_filter, void DevToolsAgent::enableTracing(const WebString& category_filter) { TraceLog* trace_log = TraceLog::GetInstance(); - trace_log->SetEnabled(base::debug::CategoryFilter(category_filter.utf8()), - TraceLog::RECORDING_MODE, - TraceOptions()); + trace_log->SetEnabled( + base::trace_event::CategoryFilter(category_filter.utf8()), + TraceLog::RECORDING_MODE, TraceOptions()); } void DevToolsAgent::disableTracing() { diff --git a/content/renderer/devtools/v8_sampling_profiler.cc b/content/renderer/devtools/v8_sampling_profiler.cc index 4249a73..a0e063a 100644 --- a/content/renderer/devtools/v8_sampling_profiler.cc +++ b/content/renderer/devtools/v8_sampling_profiler.cc @@ -57,13 +57,13 @@ void V8SamplingThread::Stop() { V8SamplingProfiler::V8SamplingProfiler() : sampling_thread_(nullptr) { // Force the "v8_cpu_profile" category to show up in the trace viewer. - base::debug::TraceLog::GetCategoryGroupEnabled( + base::trace_event::TraceLog::GetCategoryGroupEnabled( TRACE_DISABLED_BY_DEFAULT("v8_cpu_profile")); - base::debug::TraceLog::GetInstance()->AddEnabledStateObserver(this); + base::trace_event::TraceLog::GetInstance()->AddEnabledStateObserver(this); } V8SamplingProfiler::~V8SamplingProfiler() { - base::debug::TraceLog::GetInstance()->RemoveEnabledStateObserver(this); + base::trace_event::TraceLog::GetInstance()->RemoveEnabledStateObserver(this); DCHECK(!sampling_thread_.get()); } diff --git a/content/renderer/devtools/v8_sampling_profiler.h b/content/renderer/devtools/v8_sampling_profiler.h index acd01ef..9cc4c85 100644 --- a/content/renderer/devtools/v8_sampling_profiler.h +++ b/content/renderer/devtools/v8_sampling_profiler.h @@ -14,7 +14,7 @@ namespace content { // The class monitors enablement of V8 CPU profiler and // spawns a sampling thread when needed. class CONTENT_EXPORT V8SamplingProfiler final - : public base::debug::TraceLog::EnabledStateObserver { + : public base::trace_event::TraceLog::EnabledStateObserver { public: V8SamplingProfiler(); ~V8SamplingProfiler(); diff --git a/content/renderer/devtools/v8_sampling_profiler_browsertest.cc b/content/renderer/devtools/v8_sampling_profiler_browsertest.cc index 5f347a2..a270e7c 100644 --- a/content/renderer/devtools/v8_sampling_profiler_browsertest.cc +++ b/content/renderer/devtools/v8_sampling_profiler_browsertest.cc @@ -6,9 +6,9 @@ #include "content/renderer/devtools/v8_sampling_profiler.h" #include "testing/gtest/include/gtest/gtest.h" -using base::debug::CategoryFilter; -using base::debug::TraceLog; -using base::debug::TraceOptions; +using base::trace_event::CategoryFilter; +using base::trace_event::TraceLog; +using base::trace_event::TraceOptions; namespace content { diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index b69dd37..6827da7 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -2639,7 +2639,7 @@ void RenderFrameImpl::didReceiveTitle(blink::WebLocalFrame* frame, // Ignore all but top level navigations. if (!frame->parent()) { base::string16 title16 = title; - base::debug::TraceLog::GetInstance()->UpdateProcessLabel( + base::trace_event::TraceLog::GetInstance()->UpdateProcessLabel( routing_id_, base::UTF16ToUTF8(title16)); base::string16 shortened_title = title16.substr(0, kMaxTitleChars); diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index d96caefa..a55b557 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -453,7 +453,7 @@ RenderThreadImpl::RenderThreadImpl( void RenderThreadImpl::Init() { TRACE_EVENT_BEGIN_ETW("RenderThreadImpl::Init", 0, ""); - base::debug::TraceLog::GetInstance()->SetThreadSortIndex( + base::trace_event::TraceLog::GetInstance()->SetThreadSortIndex( base::PlatformThread::CurrentId(), kTraceEventRendererMainThreadSortIndex); diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 14901d8..7061b10 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -828,7 +828,7 @@ RenderViewImpl::~RenderViewImpl() { it != disambiguation_bitmaps_.end(); ++it) delete it->second; - base::debug::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_); + base::trace_event::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_); // If file chooser is still waiting for answer, dispatch empty answer. while (!file_chooser_completions_.empty()) { diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc index 85d78c4..efbbc63 100644 --- a/content/renderer/renderer_main.cc +++ b/content/renderer/renderer_main.cc @@ -96,8 +96,8 @@ class RendererMessageLoopObserver : public base::MessageLoop::TaskObserver { // mainline routine for running as the Renderer process int RendererMain(const MainFunctionParams& parameters) { TRACE_EVENT_BEGIN_ETW("RendererMain", 0, ""); - base::debug::TraceLog::GetInstance()->SetProcessName("Renderer"); - base::debug::TraceLog::GetInstance()->SetProcessSortIndex( + base::trace_event::TraceLog::GetInstance()->SetProcessName("Renderer"); + base::trace_event::TraceLog::GetInstance()->SetProcessSortIndex( kTraceEventRendererProcessSortIndex); const base::CommandLine& parsed_command_line = parameters.command_line; diff --git a/content/renderer/scheduler/renderer_scheduler_impl.cc b/content/renderer/scheduler/renderer_scheduler_impl.cc index f991820..2d4858b 100644 --- a/content/renderer/scheduler/renderer_scheduler_impl.cc +++ b/content/renderer/scheduler/renderer_scheduler_impl.cc @@ -338,15 +338,15 @@ const char* RendererSchedulerImpl::PolicyToString(Policy policy) { } } -scoped_refptr<base::debug::ConvertableToTraceFormat> +scoped_refptr<base::trace_event::ConvertableToTraceFormat> RendererSchedulerImpl::AsValueLocked(base::TimeTicks optional_now) const { DCHECK(main_thread_checker_.CalledOnValidThread()); incoming_signals_lock_.AssertAcquired(); if (optional_now.is_null()) optional_now = Now(); - scoped_refptr<base::debug::TracedValue> state = - new base::debug::TracedValue(); + scoped_refptr<base::trace_event::TracedValue> state = + new base::trace_event::TracedValue(); state->SetString("current_policy", PolicyToString(current_policy_)); state->SetDouble("now", (optional_now - base::TimeTicks()).InMillisecondsF()); diff --git a/content/renderer/scheduler/renderer_scheduler_impl.h b/content/renderer/scheduler/renderer_scheduler_impl.h index fcec44b..8ea4335 100644 --- a/content/renderer/scheduler/renderer_scheduler_impl.h +++ b/content/renderer/scheduler/renderer_scheduler_impl.h @@ -18,13 +18,7 @@ namespace base { namespace trace_event { class ConvertableToTraceFormat; } - -// TODO(ssid): remove these aliases after the tracing clients are moved to the -// new trace_event namespace. See crbug.com/451032. ETA: March 2015 -namespace debug { -using ::base::trace_event::ConvertableToTraceFormat; } -} // namespace base namespace content { @@ -90,7 +84,7 @@ class CONTENT_EXPORT RendererSchedulerImpl : public RendererScheduler { }; // Returns the serialized scheduler state for tracing. - scoped_refptr<base::debug::ConvertableToTraceFormat> AsValueLocked( + scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValueLocked( base::TimeTicks optional_now) const; static const char* TaskQueueIdToString(QueueId queue_id); static const char* PolicyToString(Policy policy); diff --git a/content/renderer/scheduler/renderer_task_queue_selector.cc b/content/renderer/scheduler/renderer_task_queue_selector.cc index cc4a7ce..121c777 100644 --- a/content/renderer/scheduler/renderer_task_queue_selector.cc +++ b/content/renderer/scheduler/renderer_task_queue_selector.cc @@ -153,7 +153,7 @@ const char* RendererTaskQueueSelector::PriorityToString( } void RendererTaskQueueSelector::AsValueInto( - base::debug::TracedValue* state) const { + base::trace_event::TracedValue* state) const { DCHECK(main_thread_checker_.CalledOnValidThread()); state->BeginDictionary("priorities"); for (QueuePriority priority = FIRST_QUEUE_PRIORITY; diff --git a/content/renderer/scheduler/renderer_task_queue_selector.h b/content/renderer/scheduler/renderer_task_queue_selector.h index b2f69ff..cfea89f 100644 --- a/content/renderer/scheduler/renderer_task_queue_selector.h +++ b/content/renderer/scheduler/renderer_task_queue_selector.h @@ -55,7 +55,7 @@ class CONTENT_EXPORT RendererTaskQueueSelector void RegisterWorkQueues( const std::vector<const base::TaskQueue*>& work_queues) override; bool SelectWorkQueueToService(size_t* out_queue_index) override; - void AsValueInto(base::debug::TracedValue* state) const override; + void AsValueInto(base::trace_event::TracedValue* state) const override; private: // Returns true if queueA contains an older task than queueB. diff --git a/content/renderer/scheduler/task_queue_manager.cc b/content/renderer/scheduler/task_queue_manager.cc index 12c4e18..112a37c 100644 --- a/content/renderer/scheduler/task_queue_manager.cc +++ b/content/renderer/scheduler/task_queue_manager.cc @@ -56,7 +56,7 @@ class TaskQueue : public base::SingleThreadTaskRunner { void set_name(const char* name) { name_ = name; } - void AsValueInto(base::debug::TracedValue* state) const; + void AsValueInto(base::trace_event::TracedValue* state) const; private: ~TaskQueue() override; @@ -71,9 +71,9 @@ class TaskQueue : public base::SingleThreadTaskRunner { void TraceWorkQueueSize() const; static void QueueAsValueInto(const base::TaskQueue& queue, - base::debug::TracedValue* state); + base::trace_event::TracedValue* state); static void TaskAsValueInto(const base::PendingTask& task, - base::debug::TracedValue* state); + base::trace_event::TracedValue* state); // This lock protects all members except the work queue. mutable base::Lock lock_; @@ -224,7 +224,7 @@ void TaskQueue::PumpQueue() { PumpQueueLocked(); } -void TaskQueue::AsValueInto(base::debug::TracedValue* state) const { +void TaskQueue::AsValueInto(base::trace_event::TracedValue* state) const { base::AutoLock lock(lock_); state->BeginDictionary(); if (name_) @@ -241,7 +241,7 @@ void TaskQueue::AsValueInto(base::debug::TracedValue* state) const { // static void TaskQueue::QueueAsValueInto(const base::TaskQueue& queue, - base::debug::TracedValue* state) { + base::trace_event::TracedValue* state) { base::TaskQueue queue_copy(queue); while (!queue_copy.empty()) { TaskAsValueInto(queue_copy.front(), state); @@ -251,7 +251,7 @@ void TaskQueue::QueueAsValueInto(const base::TaskQueue& queue, // static void TaskQueue::TaskAsValueInto(const base::PendingTask& task, - base::debug::TracedValue* state) { + base::trace_event::TracedValue* state) { state->BeginDictionary(); state->SetString("posted_from", task.posted_from.ToString()); state->SetInteger("sequence_num", task.sequence_num); @@ -452,12 +452,12 @@ base::TimeTicks TaskQueueManager::Now() const { return UNLIKELY(time_source_) ? time_source_->Now() : base::TimeTicks::Now(); } -scoped_refptr<base::debug::ConvertableToTraceFormat> +scoped_refptr<base::trace_event::ConvertableToTraceFormat> TaskQueueManager::AsValueWithSelectorResult(bool should_run, size_t selected_queue) const { DCHECK(main_thread_checker_.CalledOnValidThread()); - scoped_refptr<base::debug::TracedValue> state = - new base::debug::TracedValue(); + scoped_refptr<base::trace_event::TracedValue> state = + new base::trace_event::TracedValue(); state->BeginArray("queues"); for (auto& queue : queues_) queue->AsValueInto(state.get()); diff --git a/content/renderer/scheduler/task_queue_manager.h b/content/renderer/scheduler/task_queue_manager.h index 3112e69..77bb2bf 100644 --- a/content/renderer/scheduler/task_queue_manager.h +++ b/content/renderer/scheduler/task_queue_manager.h @@ -20,14 +20,7 @@ namespace trace_event { class ConvertableToTraceFormat; class TracedValue; } - -// TODO(ssid): remove these aliases after the tracing clients are moved to the -// new trace_event namespace. See crbug.com/451032. ETA: March 2015 -namespace debug { -using ::base::trace_event::ConvertableToTraceFormat; -using ::base::trace_event::TracedValue; } -} // namespace base namespace cc { class TestNowSource; @@ -141,7 +134,7 @@ class CONTENT_EXPORT TaskQueueManager { base::TimeTicks Now() const; - scoped_refptr<base::debug::ConvertableToTraceFormat> + scoped_refptr<base::trace_event::ConvertableToTraceFormat> AsValueWithSelectorResult(bool should_run, size_t selected_queue) const; std::vector<scoped_refptr<internal::TaskQueue>> queues_; diff --git a/content/renderer/scheduler/task_queue_manager_unittest.cc b/content/renderer/scheduler/task_queue_manager_unittest.cc index 6d4d26b..62e6c34 100644 --- a/content/renderer/scheduler/task_queue_manager_unittest.cc +++ b/content/renderer/scheduler/task_queue_manager_unittest.cc @@ -40,7 +40,7 @@ class SelectorForTest : public TaskQueueSelector { return work_queues_; } - void AsValueInto(base::debug::TracedValue* state) const override { + void AsValueInto(base::trace_event::TracedValue* state) const override { } private: diff --git a/content/renderer/scheduler/task_queue_selector.h b/content/renderer/scheduler/task_queue_selector.h index efe9bcf..ad31580 100644 --- a/content/renderer/scheduler/task_queue_selector.h +++ b/content/renderer/scheduler/task_queue_selector.h @@ -14,12 +14,6 @@ class TaskQueue; namespace trace_event { class TracedValue; } // namespace trace_event - -// TODO(ssid): remove these aliases after the tracing clients are moved to the -// new trace_event namespace. See crbug.com/451032. ETA: March 2015 -namespace debug { -using ::base::trace_event::TracedValue; -} // namespace debug } // namespace base namespace content { @@ -41,7 +35,7 @@ class TaskQueueSelector { virtual bool SelectWorkQueueToService(size_t* out_queue_index) = 0; // Serialize the selector state for tracing. - virtual void AsValueInto(base::debug::TracedValue* state) const = 0; + virtual void AsValueInto(base::trace_event::TracedValue* state) const = 0; }; } // namespace content diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc index 8ac4a61..7e4cee5 100644 --- a/content/zygote/zygote_linux.cc +++ b/content/zygote/zygote_linux.cc @@ -402,7 +402,7 @@ int Zygote::ForkWithRealPid(const std::string& process_type, IPC::Channel::SetGlobalPid(real_pid); // Force the real PID so chrome event data have a PID that corresponds // to system trace event data. - base::debug::TraceLog::GetInstance()->SetProcessID( + base::trace_event::TraceLog::GetInstance()->SetProcessID( static_cast<int>(real_pid)); #endif return 0; |