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

Unified Diff: content/common/child_trace_message_filter.cc

Issue 6862002: Merge gpu_trace_event back into base/debug/trace_event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge to 84062 Created 9 years, 8 months 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
Index: content/common/child_trace_message_filter.cc
diff --git a/content/common/child_trace_message_filter.cc b/content/common/child_trace_message_filter.cc
index ccc2b0377167451fcd730b8274871c395927ba3f..ce35ffd80f08dd85d7b30ceea4396e52c7acf4ea 100644
--- a/content/common/child_trace_message_filter.cc
+++ b/content/common/child_trace_message_filter.cc
@@ -4,26 +4,29 @@
#include "content/common/child_trace_message_filter.h"
+#include "base/bind.h"
+#include "base/debug/trace_event.h"
#include "base/message_loop.h"
#include "content/common/child_process.h"
#include "content/common/child_process_messages.h"
-#include "gpu/common/gpu_trace_event.h"
ChildTraceMessageFilter::ChildTraceMessageFilter() : channel_(NULL) {
}
ChildTraceMessageFilter::~ChildTraceMessageFilter() {
- gpu::TraceLog::GetInstance()->SetOutputCallback(NULL);
- gpu::TraceLog::GetInstance()->SetBufferFullCallback(NULL);
+ base::debug::TraceLog::GetInstance()->SetOutputCallback(
+ base::debug::TraceLog::OutputCallback());
Sigurður Ásgeirsson 2011/05/04 18:58:09 indent here and below.
scheib 2011/05/05 00:06:37 Done.
+ base::debug::TraceLog::GetInstance()->SetBufferFullCallback(
+ base::debug::TraceLog::BufferFullCallback());
}
void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
channel_ = channel;
- gpu::TraceLog::GetInstance()->SetOutputCallback(
- NewCallback(this, &ChildTraceMessageFilter::OnTraceDataCollected));
- gpu::TraceLog::GetInstance()->SetBufferFullCallback(
- NewCallback(this, &ChildTraceMessageFilter::OnTraceBufferFull));
+ base::debug::TraceLog::GetInstance()->SetOutputCallback(
+ base::Bind(&ChildTraceMessageFilter::OnTraceDataCollected, this));
+ base::debug::TraceLog::GetInstance()->SetBufferFullCallback(
+ base::Bind(&ChildTraceMessageFilter::OnTraceBufferFull, this));
}
bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) {
@@ -39,7 +42,7 @@ bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) {
}
void ChildTraceMessageFilter::OnBeginTracing() {
- gpu::TraceLog::GetInstance()->SetEnabled(true);
+ base::debug::TraceLog::GetInstance()->SetEnabled(true);
}
void ChildTraceMessageFilter::OnEndTracing() {
@@ -48,26 +51,29 @@ void ChildTraceMessageFilter::OnEndTracing() {
// EndTracingAck below.
// We are already on the IO thread, so it is guaranteed that
// OnTraceDataCollected is not deferred.
- gpu::TraceLog::GetInstance()->SetEnabled(false);
+ base::debug::TraceLog::GetInstance()->SetEnabled(false);
channel_->Send(new ChildProcessHostMsg_EndTracingAck);
}
void ChildTraceMessageFilter::OnGetTraceBufferPercentFull() {
- float bpf = gpu::TraceLog::GetInstance()->GetBufferPercentFull();
+ float bpf = base::debug::TraceLog::GetInstance()->GetBufferPercentFull();
channel_->Send(new ChildProcessHostMsg_TraceBufferPercentFullReply(bpf));
}
-void ChildTraceMessageFilter::OnTraceDataCollected(const std::string& data) {
+void ChildTraceMessageFilter::OnTraceDataCollected(
+ const scoped_refptr<base::debug::TraceLog::RefCountedString>&
+ json_events_str_ptr) {
if (MessageLoop::current() != ChildProcess::current()->io_message_loop()) {
ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE,
NewRunnableMethod(this, &ChildTraceMessageFilter::OnTraceDataCollected,
- data));
+ json_events_str_ptr));
return;
}
- channel_->Send(new ChildProcessHostMsg_TraceDataCollected(data));
+ channel_->Send(new ChildProcessHostMsg_TraceDataCollected(
+ json_events_str_ptr->data));
}
void ChildTraceMessageFilter::OnTraceBufferFull() {

Powered by Google App Engine
This is Rietveld 408576698