summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 23:31:51 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-21 23:31:51 +0000
commit027fc03bee0791e0895a80cd528cd19b16d3d415 (patch)
tree20be477b007b3ce104d1c4aac56029d7e107e60e /chrome
parent66699597a5420264d0ec7c8c61f8a2f1ff35ed22 (diff)
downloadchromium_src-027fc03bee0791e0895a80cd528cd19b16d3d415.zip
chromium_src-027fc03bee0791e0895a80cd528cd19b16d3d415.tar.gz
chromium_src-027fc03bee0791e0895a80cd528cd19b16d3d415.tar.bz2
Internalize JSON chunk merging to trace_event.h API.
BUG=100291 TEST=base_unittests, content_unittests Review URL: http://codereview.chromium.org/8355024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/ui/webui/tracing_ui.cc17
1 files changed, 12 insertions, 5 deletions
diff --git a/chrome/browser/ui/webui/tracing_ui.cc b/chrome/browser/ui/webui/tracing_ui.cc
index f13f15e..efd1562 100644
--- a/chrome/browser/ui/webui/tracing_ui.cc
+++ b/chrome/browser/ui/webui/tracing_ui.cc
@@ -63,7 +63,7 @@ class TracingMessageHandler
// TraceSubscriber implementation.
virtual void OnEndTracingComplete();
- virtual void OnTraceDataCollected(const std::string& json_events);
+ virtual void OnTraceDataCollected(const std::string& trace_fragment);
virtual void OnTraceBufferPercentFullReply(float percent_full);
// Messages.
@@ -419,13 +419,20 @@ void TracingMessageHandler::OnEndTracingComplete() {
}
void TracingMessageHandler::OnTraceDataCollected(
- const std::string& json_events) {
+ const std::string& trace_fragment) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- std::string javascript = "tracingController.onTraceDataCollected("
- + json_events + ");";
+
+ base::debug::TraceResultBuffer::SimpleOutput output;
+ base::debug::TraceResultBuffer trace_buffer;
+ trace_buffer.SetOutputCallback(output.GetCallback());
+ output.Append("tracingController.onTraceDataCollected(");
+ trace_buffer.Start();
+ trace_buffer.AddFragment(trace_fragment);
+ trace_buffer.Finish();
+ output.Append(");");
web_ui_->tab_contents()->render_view_host()->
- ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(javascript));
+ ExecuteJavascriptInWebFrame(string16(), UTF8ToUTF16(output.json_output));
}
void TracingMessageHandler::OnTraceBufferPercentFullReply(float percent_full) {