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 | |
94 options_ok &= options->GetBoolean("useSystemTracing", | 89 options_ok &= options->GetBoolean("useSystemTracing", |
95 &tracing_options->enable_systrace); | 90 &tracing_options->enable_systrace); |
96 options_ok &= | 91 options_ok &= |
97 options->GetBoolean("useSampling", &tracing_options->enable_sampling); | 92 options->GetBoolean("useSampling", &tracing_options->enable_sampling); |
98 | 93 |
| 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 |
99 if (!options_ok) { | 103 if (!options_ok) { |
100 LOG(ERROR) << "Malformed options"; | 104 LOG(ERROR) << "Malformed options"; |
101 return false; | 105 return false; |
102 } | 106 } |
103 return true; | 107 return true; |
104 } | 108 } |
105 | 109 |
106 void OnRecordingEnabledAck(const WebUIDataSource::GotDataCallback& callback); | 110 void OnRecordingEnabledAck(const WebUIDataSource::GotDataCallback& callback); |
107 | 111 |
108 bool BeginRecording(const std::string& data64, | 112 bool BeginRecording(const std::string& data64, |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 web_ui()->CallJavascriptFunction("onUploadComplete", | 357 web_ui()->CallJavascriptFunction("onUploadComplete", |
354 base::StringValue(feedback)); | 358 base::StringValue(feedback)); |
355 } else { | 359 } else { |
356 web_ui()->CallJavascriptFunction("onUploadError", | 360 web_ui()->CallJavascriptFunction("onUploadError", |
357 base::StringValue(feedback)); | 361 base::StringValue(feedback)); |
358 } | 362 } |
359 trace_uploader_.reset(); | 363 trace_uploader_.reset(); |
360 } | 364 } |
361 | 365 |
362 } // namespace content | 366 } // namespace content |
OLD | NEW |