summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/gpu_process_host.cc4
-rw-r--r--content/browser/gpu_process_host_ui_shim.cc2
-rw-r--r--content/browser/renderer_host/render_widget_host.cc4
-rw-r--r--content/browser/trace_controller.cc29
-rw-r--r--content/browser/trace_controller.h5
-rw-r--r--content/browser/trace_message_filter.cc3
6 files changed, 29 insertions, 18 deletions
diff --git a/content/browser/gpu_process_host.cc b/content/browser/gpu_process_host.cc
index df4d9a6..da7b812 100644
--- a/content/browser/gpu_process_host.cc
+++ b/content/browser/gpu_process_host.cc
@@ -5,6 +5,7 @@
#include "content/browser/gpu_process_host.h"
#include "base/command_line.h"
+#include "base/debug/trace_event.h"
#include "base/memory/ref_counted.h"
#include "base/metrics/histogram.h"
#include "base/process_util.h"
@@ -18,7 +19,6 @@
#include "content/browser/renderer_host/render_widget_host.h"
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/common/gpu/gpu_messages.h"
-#include "gpu/common/gpu_trace_event.h"
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_switches.h"
#include "media/base/media_switches.h"
@@ -286,7 +286,7 @@ void GpuProcessHost::EstablishGpuChannel(
int renderer_id,
EstablishChannelCallback *callback) {
DCHECK(CalledOnValidThread());
- GPU_TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel");
+ TRACE_EVENT0("gpu", "GpuProcessHostUIShim::EstablishGpuChannel");
linked_ptr<EstablishChannelCallback> wrapped_callback(callback);
// If GPU features are already blacklisted, no need to establish the channel.
diff --git a/content/browser/gpu_process_host_ui_shim.cc b/content/browser/gpu_process_host_ui_shim.cc
index e2dc11d..f429aa8 100644
--- a/content/browser/gpu_process_host_ui_shim.cc
+++ b/content/browser/gpu_process_host_ui_shim.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/id_map.h"
+#include "base/debug/trace_event.h"
#include "base/process_util.h"
#include "chrome/browser/browser_process.h"
#include "content/browser/browser_thread.h"
@@ -16,7 +17,6 @@
#include "content/browser/renderer_host/render_widget_host_view.h"
#include "content/common/content_switches.h"
#include "content/common/gpu/gpu_messages.h"
-#include "gpu/common/gpu_trace_event.h"
#if defined(OS_LINUX)
// These two #includes need to come after gpu_messages.h.
diff --git a/content/browser/renderer_host/render_widget_host.cc b/content/browser/renderer_host/render_widget_host.cc
index 339b310..7250dde 100644
--- a/content/browser/renderer_host/render_widget_host.cc
+++ b/content/browser/renderer_host/render_widget_host.cc
@@ -6,6 +6,7 @@
#include "base/auto_reset.h"
#include "base/command_line.h"
+#include "base/debug/trace_event.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
#include "chrome/browser/accessibility/browser_accessibility_state.h"
@@ -22,7 +23,6 @@
#include "content/common/notification_service.h"
#include "content/common/result_codes.h"
#include "content/common/view_messages.h"
-#include "gpu/common/gpu_trace_event.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "ui/base/keycodes/keyboard_codes.h"
#include "webkit/glue/webcursor.h"
@@ -837,7 +837,7 @@ void RenderWidgetHost::OnMsgPaintAtSizeAck(int tag, const gfx::Size& size) {
void RenderWidgetHost::OnMsgUpdateRect(
const ViewHostMsg_UpdateRect_Params& params) {
- GPU_TRACE_EVENT0("renderer_host", "RenderWidgetHost::OnMsgUpdateRect");
+ TRACE_EVENT0("renderer_host", "RenderWidgetHost::OnMsgUpdateRect");
TimeTicks paint_start = TimeTicks::Now();
NotificationService::current()->Notify(
diff --git a/content/browser/trace_controller.cc b/content/browser/trace_controller.cc
index 5bf2efa..24e8086 100644
--- a/content/browser/trace_controller.cc
+++ b/content/browser/trace_controller.cc
@@ -4,11 +4,12 @@
#include "content/browser/trace_controller.h"
+#include "base/bind.h"
+#include "base/debug/trace_event.h"
#include "base/task.h"
#include "content/browser/browser_message_filter.h"
#include "content/browser/trace_message_filter.h"
#include "content/common/child_process_messages.h"
-#include "gpu/common/gpu_trace_event.h"
TraceController::TraceController() :
@@ -17,12 +18,14 @@ TraceController::TraceController() :
pending_bpf_ack_count_(0),
maximum_bpf_(0.0f),
is_tracing_(false) {
- gpu::TraceLog::GetInstance()->SetOutputCallback(
- NewCallback(this, &TraceController::OnTraceDataCollected));
+ base::debug::TraceLog::GetInstance()->SetOutputCallback(
+ base::Bind(&TraceController::OnTraceDataCollected,
+ base::Unretained(this)));
}
TraceController::~TraceController() {
- gpu::TraceLog::GetInstance()->SetOutputCallback(NULL);
+ base::debug::TraceLog::GetInstance()->SetOutputCallback(
+ base::debug::TraceLog::OutputCallback());
}
//static
@@ -41,7 +44,7 @@ bool TraceController::BeginTracing(TraceSubscriber* subscriber) {
// Enable tracing
is_tracing_ = true;
- gpu::TraceLog::GetInstance()->SetEnabled(true);
+ base::debug::TraceLog::GetInstance()->SetEnabled(true);
// Notify all child processes.
for (FilterMap::iterator it = filters_.begin(); it != filters_.end(); ++it) {
@@ -92,7 +95,7 @@ bool TraceController::GetTraceBufferPercentFullAsync(
// Handle special case of zero child processes.
if (pending_bpf_ack_count_ == 1) {
// Ack asynchronously now, because we don't have any children to wait for.
- float bpf = gpu::TraceLog::GetInstance()->GetBufferPercentFull();
+ float bpf = base::debug::TraceLog::GetInstance()->GetBufferPercentFull();
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
&TraceController::OnTraceBufferPercentFullReply,
@@ -161,7 +164,7 @@ void TraceController::OnEndTracingAck() {
// called with the last of the local trace data. Since we are on the UI
// thread, the call to OnTraceDataCollected will be synchronous, so we can
// immediately call OnEndTracingComplete below.
- gpu::TraceLog::GetInstance()->SetEnabled(false);
+ base::debug::TraceLog::GetInstance()->SetEnabled(false);
// Trigger callback if one is set.
if (subscriber_) {
@@ -179,17 +182,21 @@ void TraceController::OnEndTracingAck() {
}
}
-void TraceController::OnTraceDataCollected(const std::string& data) {
+void TraceController::OnTraceDataCollected(
+ const scoped_refptr<base::debug::TraceLog::RefCountedString>&
+ json_events_str_ptr) {
// OnTraceDataCollected may be called from any browser thread, either by the
// local event trace system or from child processes via TraceMessageFilter.
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
- NewRunnableMethod(this, &TraceController::OnTraceDataCollected, data));
+ NewRunnableMethod(this,
+ &TraceController::OnTraceDataCollected,
+ json_events_str_ptr));
return;
}
if (subscriber_)
- subscriber_->OnTraceDataCollected(data);
+ subscriber_->OnTraceDataCollected(json_events_str_ptr->data);
}
void TraceController::OnTraceBufferFull() {
@@ -229,7 +236,7 @@ void TraceController::OnTraceBufferPercentFullReply(float percent_full) {
if (pending_bpf_ack_count_ == 1) {
// The last ack represents local trace, so we need to ack it now. Note that
// this code only executes if there were child processes.
- float bpf = gpu::TraceLog::GetInstance()->GetBufferPercentFull();
+ float bpf = base::debug::TraceLog::GetInstance()->GetBufferPercentFull();
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this,
&TraceController::OnTraceBufferPercentFullReply,
diff --git a/content/browser/trace_controller.h b/content/browser/trace_controller.h
index 4308e82..33e14c6 100644
--- a/content/browser/trace_controller.h
+++ b/content/browser/trace_controller.h
@@ -8,6 +8,7 @@
#include <set>
#include <string>
+#include "base/debug/trace_event.h"
#include "base/memory/ref_counted.h"
#include "base/memory/singleton.h"
#include "base/task.h"
@@ -110,7 +111,9 @@ class TraceController {
void AddFilter(TraceMessageFilter* filter);
void RemoveFilter(TraceMessageFilter* filter);
void OnEndTracingAck();
- void OnTraceDataCollected(const std::string& data);
+ void OnTraceDataCollected(
+ const scoped_refptr<base::debug::TraceLog::RefCountedString>&
+ json_events_str_ptr);
void OnTraceBufferFull();
void OnTraceBufferPercentFullReply(float percent_full);
diff --git a/content/browser/trace_message_filter.cc b/content/browser/trace_message_filter.cc
index e23fc26..a1bd1d0 100644
--- a/content/browser/trace_message_filter.cc
+++ b/content/browser/trace_message_filter.cc
@@ -82,7 +82,8 @@ void TraceMessageFilter::OnEndTracingAck() {
}
void TraceMessageFilter::OnTraceDataCollected(const std::string& data) {
- TraceController::GetInstance()->OnTraceDataCollected(data);
+ TraceController::GetInstance()->OnTraceDataCollected(
+ make_scoped_refptr(new base::debug::TraceLog::RefCountedString(data)));
}
void TraceMessageFilter::OnTraceBufferFull() {