OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/tracing/tracing_ui.h" | 5 #include "content/browser/tracing/tracing_ui.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <set> | 10 #include <set> |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 if (path == "json/get_buffer_percent_full") { | 179 if (path == "json/get_buffer_percent_full") { |
180 return TracingController::GetInstance()->GetTraceBufferUsage( | 180 return TracingController::GetInstance()->GetTraceBufferUsage( |
181 base::Bind(OnTraceBufferUsageResult, callback)); | 181 base::Bind(OnTraceBufferUsageResult, callback)); |
182 } | 182 } |
183 if (path == "json/get_buffer_status") { | 183 if (path == "json/get_buffer_status") { |
184 return TracingController::GetInstance()->GetTraceBufferUsage( | 184 return TracingController::GetInstance()->GetTraceBufferUsage( |
185 base::Bind(OnTraceBufferStatusResult, callback)); | 185 base::Bind(OnTraceBufferStatusResult, callback)); |
186 } | 186 } |
187 if (path == "json/end_recording_compressed") { | 187 if (path == "json/end_recording_compressed") { |
188 scoped_refptr<TracingControllerImpl::TraceDataSink> data_sink = | 188 scoped_refptr<TracingControllerImpl::TraceDataSink> data_sink = |
189 TracingController::CreateCompressedStringSink( | 189 TracingControllerImpl::CreateCompressedStringSink( |
190 TracingController::CreateCallbackEndpoint( | 190 TracingControllerImpl::CreateCallbackEndpoint( |
191 base::Bind(TracingCallbackWrapperBase64, callback))); | 191 base::Bind(TracingCallbackWrapperBase64, callback))); |
192 AddCustomMetadata(data_sink.get()); | 192 AddCustomMetadata(data_sink.get()); |
193 return TracingController::GetInstance()->StopTracing(data_sink); | 193 return TracingController::GetInstance()->StopTracing(data_sink); |
194 } | 194 } |
195 | 195 |
196 LOG(ERROR) << "Unhandled request to " << path; | 196 LOG(ERROR) << "Unhandled request to " << path; |
197 return false; | 197 return false; |
198 } | 198 } |
199 | 199 |
200 bool OnTracingRequest(const std::string& path, | 200 bool OnTracingRequest(const std::string& path, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete", | 319 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete", |
320 base::StringValue(feedback)); | 320 base::StringValue(feedback)); |
321 } else { | 321 } else { |
322 web_ui()->CallJavascriptFunctionUnsafe("onUploadError", | 322 web_ui()->CallJavascriptFunctionUnsafe("onUploadError", |
323 base::StringValue(feedback)); | 323 base::StringValue(feedback)); |
324 } | 324 } |
325 trace_uploader_.reset(); | 325 trace_uploader_.reset(); |
326 } | 326 } |
327 | 327 |
328 } // namespace content | 328 } // namespace content |
OLD | NEW |