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

Unified Diff: content/common/child_trace_message_filter.cc

Issue 6955006: Revert 84486 - Merge gpu_trace_event back into base/debug/trace_event.Initial land attempt at htt... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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
« no previous file with comments | « content/common/child_trace_message_filter.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/child_trace_message_filter.cc
===================================================================
--- content/common/child_trace_message_filter.cc (revision 84493)
+++ content/common/child_trace_message_filter.cc (working copy)
@@ -4,35 +4,28 @@
#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);
}
void ChildTraceMessageFilter::OnFilterAdded(IPC::Channel* channel) {
channel_ = channel;
- base::debug::TraceLog::GetInstance()->SetOutputCallback(
- base::Bind(&ChildTraceMessageFilter::OnTraceDataCollected, this));
- base::debug::TraceLog::GetInstance()->SetBufferFullCallback(
- base::Bind(&ChildTraceMessageFilter::OnTraceBufferFull, this));
+ gpu::TraceLog::GetInstance()->SetOutputCallback(
+ NewCallback(this, &ChildTraceMessageFilter::OnTraceDataCollected));
+ gpu::TraceLog::GetInstance()->SetBufferFullCallback(
+ NewCallback(this, &ChildTraceMessageFilter::OnTraceBufferFull));
}
-void ChildTraceMessageFilter::OnFilterRemoved()
-{
- base::debug::TraceLog::GetInstance()->SetOutputCallback(
- base::debug::TraceLog::OutputCallback());
- base::debug::TraceLog::GetInstance()->SetBufferFullCallback(
- base::debug::TraceLog::BufferFullCallback());
-}
-
bool ChildTraceMessageFilter::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(ChildTraceMessageFilter, message)
@@ -46,7 +39,7 @@
}
void ChildTraceMessageFilter::OnBeginTracing() {
- base::debug::TraceLog::GetInstance()->SetEnabled(true);
+ gpu::TraceLog::GetInstance()->SetEnabled(true);
}
void ChildTraceMessageFilter::OnEndTracing() {
@@ -55,29 +48,26 @@
// EndTracingAck below.
// We are already on the IO thread, so it is guaranteed that
// OnTraceDataCollected is not deferred.
- base::debug::TraceLog::GetInstance()->SetEnabled(false);
+ gpu::TraceLog::GetInstance()->SetEnabled(false);
channel_->Send(new ChildProcessHostMsg_EndTracingAck);
}
void ChildTraceMessageFilter::OnGetTraceBufferPercentFull() {
- float bpf = base::debug::TraceLog::GetInstance()->GetBufferPercentFull();
+ float bpf = gpu::TraceLog::GetInstance()->GetBufferPercentFull();
channel_->Send(new ChildProcessHostMsg_TraceBufferPercentFullReply(bpf));
}
-void ChildTraceMessageFilter::OnTraceDataCollected(
- const scoped_refptr<base::debug::TraceLog::RefCountedString>&
- json_events_str_ptr) {
+void ChildTraceMessageFilter::OnTraceDataCollected(const std::string& data) {
if (MessageLoop::current() != ChildProcess::current()->io_message_loop()) {
ChildProcess::current()->io_message_loop()->PostTask(FROM_HERE,
NewRunnableMethod(this, &ChildTraceMessageFilter::OnTraceDataCollected,
- json_events_str_ptr));
+ data));
return;
}
- channel_->Send(new ChildProcessHostMsg_TraceDataCollected(
- json_events_str_ptr->data));
+ channel_->Send(new ChildProcessHostMsg_TraceDataCollected(data));
}
void ChildTraceMessageFilter::OnTraceBufferFull() {
« no previous file with comments | « content/common/child_trace_message_filter.h ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698