Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: chrome/test/base/tracing.cc

Issue 105893004: Sampling profiling thread should be joined in a FILE thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/tracing.cc
diff --git a/chrome/test/base/tracing.cc b/chrome/test/base/tracing.cc
index 5aa07e7e4d6f287e8de7564f6a258e09dd087e63..cba039b6663de958095f728b6f0d7f8967691a91 100644
--- a/chrome/test/base/tracing.cc
+++ b/chrome/test/base/tracing.cc
@@ -34,7 +34,6 @@ class InProcessTraceController {
return content::TracingController::GetInstance()->EnableRecording(
category_patterns, content::TracingController::DEFAULT_OPTIONS,
content::TracingController::EnableRecordingDoneCallback());
- return true;
}
bool BeginTracingWithWatch(const std::string& category_patterns,
@@ -44,11 +43,20 @@ class InProcessTraceController {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK(num_occurrences > 0);
watch_notification_count_ = num_occurrences;
- return content::TracingController::GetInstance()->SetWatchEvent(
+ if (!content::TracingController::GetInstance()->SetWatchEvent(
category_name, event_name,
base::Bind(&InProcessTraceController::OnWatchEventMatched,
- base::Unretained(this))) &&
- BeginTracing(category_patterns);
+ base::Unretained(this))))
Paweł Hajdan Jr. 2014/01/02 12:27:23 nit: This should have braces {} because condition
+ return false;
+ if (!content::TracingController::GetInstance()->EnableRecording(
+ category_patterns, content::TracingController::DEFAULT_OPTIONS,
Paweł Hajdan Jr. 2014/01/02 12:27:23 nit: Please indent this +4 and add braces {}.
+ base::Bind(&InProcessTraceController::OnEnableTracingComplete,
+ base::Unretained(this))))
+ return false;
+
+ message_loop_runner_ = new content::MessageLoopRunner;
+ message_loop_runner_->Run();
+ return true;
}
bool WaitForWatchEvent(base::TimeDelta timeout) {
@@ -93,6 +101,10 @@ class InProcessTraceController {
private:
friend struct DefaultSingletonTraits<InProcessTraceController>;
+ void OnEnableTracingComplete() {
+ message_loop_runner_->Quit();
+ }
+
void OnEndTracingComplete() {
message_loop_runner_->Quit();
}
« no previous file with comments | « no previous file | content/browser/tracing/tracing_controller_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698