| 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 <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if (!tracing_options) { | 79 if (!tracing_options) { |
| 80 LOG(ERROR) << "tracing_options can't be passed as NULL"; | 80 LOG(ERROR) << "tracing_options can't be passed as NULL"; |
| 81 return false; | 81 return false; |
| 82 } | 82 } |
| 83 | 83 |
| 84 bool options_ok = true; | 84 bool options_ok = true; |
| 85 std::string category_filter_string; | 85 std::string category_filter_string; |
| 86 options_ok &= options->GetString("categoryFilter", &category_filter_string); | 86 options_ok &= options->GetString("categoryFilter", &category_filter_string); |
| 87 *category_filter = base::trace_event::CategoryFilter(category_filter_string); | 87 *category_filter = base::trace_event::CategoryFilter(category_filter_string); |
| 88 | 88 |
| 89 std::string record_mode; |
| 90 options_ok &= |
| 91 options->GetString("tracingRecordMode", &record_mode); |
| 92 options_ok &= tracing_options->SetFromString(record_mode); |
| 93 |
| 89 options_ok &= options->GetBoolean("useSystemTracing", | 94 options_ok &= options->GetBoolean("useSystemTracing", |
| 90 &tracing_options->enable_systrace); | 95 &tracing_options->enable_systrace); |
| 91 options_ok &= | 96 options_ok &= |
| 92 options->GetBoolean("useSampling", &tracing_options->enable_sampling); | 97 options->GetBoolean("useSampling", &tracing_options->enable_sampling); |
| 93 | 98 |
| 94 bool use_continuous_tracing; | |
| 95 options_ok &= | |
| 96 options->GetBoolean("useContinuousTracing", &use_continuous_tracing); | |
| 97 | |
| 98 if (use_continuous_tracing) | |
| 99 tracing_options->record_mode = base::trace_event::RECORD_CONTINUOUSLY; | |
| 100 else | |
| 101 tracing_options->record_mode = base::trace_event::RECORD_UNTIL_FULL; | |
| 102 | |
| 103 if (!options_ok) { | 99 if (!options_ok) { |
| 104 LOG(ERROR) << "Malformed options"; | 100 LOG(ERROR) << "Malformed options"; |
| 105 return false; | 101 return false; |
| 106 } | 102 } |
| 107 return true; | 103 return true; |
| 108 } | 104 } |
| 109 | 105 |
| 110 void OnRecordingEnabledAck(const WebUIDataSource::GotDataCallback& callback); | 106 void OnRecordingEnabledAck(const WebUIDataSource::GotDataCallback& callback); |
| 111 | 107 |
| 112 bool BeginRecording(const std::string& data64, | 108 bool BeginRecording(const std::string& data64, |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 web_ui()->CallJavascriptFunction("onUploadComplete", | 353 web_ui()->CallJavascriptFunction("onUploadComplete", |
| 358 base::StringValue(feedback)); | 354 base::StringValue(feedback)); |
| 359 } else { | 355 } else { |
| 360 web_ui()->CallJavascriptFunction("onUploadError", | 356 web_ui()->CallJavascriptFunction("onUploadError", |
| 361 base::StringValue(feedback)); | 357 base::StringValue(feedback)); |
| 362 } | 358 } |
| 363 trace_uploader_.reset(); | 359 trace_uploader_.reset(); |
| 364 } | 360 } |
| 365 | 361 |
| 366 } // namespace content | 362 } // namespace content |
| OLD | NEW |