| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "content/browser/tracing/background_tracing_rule.h" | 4 #include "content/browser/tracing/background_tracing_rule.h" |
| 5 | 5 |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
| 10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 std::string GenerateUniqueName() const { | 256 std::string GenerateUniqueName() const { |
| 257 static int ids = 0; | 257 static int ids = 0; |
| 258 char work_buffer[256]; | 258 char work_buffer[256]; |
| 259 base::strings::SafeSNPrintf(work_buffer, sizeof(work_buffer), "%s_%d", | 259 base::strings::SafeSNPrintf(work_buffer, sizeof(work_buffer), "%s_%d", |
| 260 kTraceAtRandomIntervalsEventName, ids++); | 260 kTraceAtRandomIntervalsEventName, ids++); |
| 261 return work_buffer; | 261 return work_buffer; |
| 262 } | 262 } |
| 263 | 263 |
| 264 private: | 264 private: |
| 265 std::string named_event_; | 265 std::string named_event_; |
| 266 base::OneShotTimer<ReactiveTraceAtRandomIntervalsRule> trigger_timer_; | 266 base::OneShotTimer trigger_timer_; |
| 267 BackgroundTracingConfigImpl::CategoryPreset category_preset_; | 267 BackgroundTracingConfigImpl::CategoryPreset category_preset_; |
| 268 BackgroundTracingManagerImpl::TriggerHandle handle_; | 268 BackgroundTracingManagerImpl::TriggerHandle handle_; |
| 269 int timeout_min_; | 269 int timeout_min_; |
| 270 int timeout_max_; | 270 int timeout_max_; |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 } // namespace | 273 } // namespace |
| 274 | 274 |
| 275 int BackgroundTracingRule::GetReactiveTimeout() const { | 275 int BackgroundTracingRule::GetReactiveTimeout() const { |
| 276 return -1; | 276 return -1; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 | 342 |
| 343 return scoped_ptr<BackgroundTracingRule>( | 343 return scoped_ptr<BackgroundTracingRule>( |
| 344 new ReactiveTraceAtRandomIntervalsRule(category_preset, timeout_min, | 344 new ReactiveTraceAtRandomIntervalsRule(category_preset, timeout_min, |
| 345 timeout_max)); | 345 timeout_max)); |
| 346 } | 346 } |
| 347 | 347 |
| 348 return nullptr; | 348 return nullptr; |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace content | 351 } // namespace content |
| OLD | NEW |