| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 did_initiate_recording_ = true; | 188 did_initiate_recording_ = true; |
| 189 return_as_stream_ = return_as_stream; | 189 return_as_stream_ = return_as_stream; |
| 190 if (buffer_usage_reporting_interval.isJust()) | 190 if (buffer_usage_reporting_interval.isJust()) |
| 191 SetupTimer(buffer_usage_reporting_interval.fromJust()); | 191 SetupTimer(buffer_usage_reporting_interval.fromJust()); |
| 192 | 192 |
| 193 base::trace_event::TraceConfig trace_config; | 193 base::trace_event::TraceConfig trace_config; |
| 194 if (config.isJust()) { | 194 if (config.isJust()) { |
| 195 std::unique_ptr<base::Value> value = | 195 std::unique_ptr<base::Value> value = |
| 196 protocol::toBaseValue(config.fromJust()->serialize().get(), 1000); | 196 protocol::toBaseValue(config.fromJust()->serializeValue().get(), 1000); |
| 197 if (value && value->IsType(base::Value::TYPE_DICTIONARY)) { | 197 if (value && value->IsType(base::Value::TYPE_DICTIONARY)) { |
| 198 trace_config = GetTraceConfigFromDevToolsConfig( | 198 trace_config = GetTraceConfigFromDevToolsConfig( |
| 199 *static_cast<base::DictionaryValue*>(value.get())); | 199 *static_cast<base::DictionaryValue*>(value.get())); |
| 200 } | 200 } |
| 201 } else if (categories.isJust() || options.isJust()) { | 201 } else if (categories.isJust() || options.isJust()) { |
| 202 trace_config = base::trace_event::TraceConfig( | 202 trace_config = base::trace_event::TraceConfig( |
| 203 categories.fromMaybe(""), options.fromMaybe("")); | 203 categories.fromMaybe(""), options.fromMaybe("")); |
| 204 } | 204 } |
| 205 | 205 |
| 206 // If inspected target is a render process Tracing.start will be handled by | 206 // If inspected target is a render process Tracing.start will be handled by |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 351 |
| 352 std::string mode; | 352 std::string mode; |
| 353 if (tracing_dict->GetString(kRecordModeParam, &mode)) | 353 if (tracing_dict->GetString(kRecordModeParam, &mode)) |
| 354 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); | 354 tracing_dict->SetString(kRecordModeParam, ConvertFromCamelCase(mode, '-')); |
| 355 | 355 |
| 356 return base::trace_event::TraceConfig(*tracing_dict); | 356 return base::trace_event::TraceConfig(*tracing_dict); |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace tracing | 359 } // namespace tracing |
| 360 } // namespace protocol | 360 } // namespace protocol |
| OLD | NEW |