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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 std::string GenerateUniqueName() const { | 267 std::string GenerateUniqueName() const { |
268 static int ids = 0; | 268 static int ids = 0; |
269 char work_buffer[256]; | 269 char work_buffer[256]; |
270 base::strings::SafeSNPrintf(work_buffer, sizeof(work_buffer), "%s_%d", | 270 base::strings::SafeSNPrintf(work_buffer, sizeof(work_buffer), "%s_%d", |
271 kTraceAtRandomIntervalsEventName, ids++); | 271 kTraceAtRandomIntervalsEventName, ids++); |
272 return work_buffer; | 272 return work_buffer; |
273 } | 273 } |
274 | 274 |
275 private: | 275 private: |
276 std::string named_event_; | 276 std::string named_event_; |
277 base::OneShotTimer<ReactiveTraceAtRandomIntervalsRule> trigger_timer_; | 277 base::OneShotTimer trigger_timer_; |
278 BackgroundTracingConfigImpl::CategoryPreset category_preset_; | 278 BackgroundTracingConfigImpl::CategoryPreset category_preset_; |
279 BackgroundTracingManagerImpl::TriggerHandle handle_; | 279 BackgroundTracingManagerImpl::TriggerHandle handle_; |
280 int timeout_min_; | 280 int timeout_min_; |
281 int timeout_max_; | 281 int timeout_max_; |
282 }; | 282 }; |
283 | 283 |
284 } // namespace | 284 } // namespace |
285 | 285 |
286 int BackgroundTracingRule::GetReactiveTimeout() const { | 286 int BackgroundTracingRule::GetReactiveTimeout() const { |
287 return -1; | 287 return -1; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 368 |
369 return scoped_ptr<BackgroundTracingRule>( | 369 return scoped_ptr<BackgroundTracingRule>( |
370 new ReactiveTraceAtRandomIntervalsRule(category_preset, timeout_min, | 370 new ReactiveTraceAtRandomIntervalsRule(category_preset, timeout_min, |
371 timeout_max)); | 371 timeout_max)); |
372 } | 372 } |
373 | 373 |
374 return nullptr; | 374 return nullptr; |
375 } | 375 } |
376 | 376 |
377 } // namespace content | 377 } // namespace content |
OLD | NEW |