| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/protocol/tracing_handler.h" | 5 #include "content/browser/devtools/protocol/tracing_handler.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 client_->TracingComplete( | 160 client_->TracingComplete( |
| 161 TracingCompleteParams::Create()->set_stream(stream_handle)); | 161 TracingCompleteParams::Create()->set_stream(stream_handle)); |
| 162 } | 162 } |
| 163 | 163 |
| 164 Response TracingHandler::Start( | 164 Response TracingHandler::Start( |
| 165 DevToolsCommandId command_id, | 165 DevToolsCommandId command_id, |
| 166 const std::string* categories, | 166 const std::string* categories, |
| 167 const std::string* options, | 167 const std::string* options, |
| 168 const double* buffer_usage_reporting_interval, | 168 const double* buffer_usage_reporting_interval, |
| 169 const std::string* transfer_mode, | 169 const std::string* transfer_mode, |
| 170 const std::unique_ptr<base::DictionaryValue>& config) { | 170 const std::unique_ptr<base::DictionaryValue>& config, |
| 171 const std::string* reloadingBannerMessage) { |
| 171 if (IsTracing()) { | 172 if (IsTracing()) { |
| 172 if (!did_initiate_recording_ && IsStartupTracingActive()) { | 173 if (!did_initiate_recording_ && IsStartupTracingActive()) { |
| 173 // If tracing is already running because it was initiated by startup | 174 // If tracing is already running because it was initiated by startup |
| 174 // tracing, honor the transfer mode update, as that's the only way | 175 // tracing, honor the transfer mode update, as that's the only way |
| 175 // for the client to communicate it. | 176 // for the client to communicate it. |
| 176 return_as_stream_ = | 177 return_as_stream_ = |
| 177 transfer_mode && *transfer_mode == start::kTransferModeReturnAsStream; | 178 transfer_mode && *transfer_mode == start::kTransferModeReturnAsStream; |
| 178 } | 179 } |
| 179 return Response::InternalError("Tracing is already started"); | 180 return Response::InternalError("Tracing is already started"); |
| 180 } | 181 } |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 std::string mode; | 346 std::string mode; |
| 346 if (tracing_dict->GetString(kRecordModeParam, &mode)) | 347 if (tracing_dict->GetString(kRecordModeParam, &mode)) |
| 347 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); | 348 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); |
| 348 | 349 |
| 349 return base::trace_event::TraceConfig(*tracing_dict); | 350 return base::trace_event::TraceConfig(*tracing_dict); |
| 350 } | 351 } |
| 351 | 352 |
| 352 } // namespace tracing | 353 } // namespace tracing |
| 353 } // namespace devtools | 354 } // namespace devtools |
| 354 } // namespace content | 355 } // namespace content |
| OLD | NEW |