| 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 "components/feedback/tracing_manager.h" | 5 #include "components/feedback/tracing_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "components/feedback/feedback_util.h" | 12 #include "components/feedback/feedback_util.h" |
| 13 #include "content/public/browser/tracing_controller.h" | 13 #include "content/public/browser/tracing_controller.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 // Only once trace manager can exist at a time. | 17 // Only once trace manager can exist at a time. |
| 18 TracingManager* g_tracing_manager = NULL; | 18 TracingManager* g_tracing_manager = NULL; |
| 19 // Trace IDs start at 1 and increase. | 19 // Trace IDs start at 1 and increase. |
| 20 int g_next_trace_id = 1; | 20 int g_next_trace_id = 1; |
| 21 // Name of the file to store the tracing data as. | 21 // Name of the file to store the tracing data as. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // static | 127 // static |
| 128 std::unique_ptr<TracingManager> TracingManager::Create() { | 128 std::unique_ptr<TracingManager> TracingManager::Create() { |
| 129 if (g_tracing_manager) | 129 if (g_tracing_manager) |
| 130 return std::unique_ptr<TracingManager>(); | 130 return std::unique_ptr<TracingManager>(); |
| 131 return std::unique_ptr<TracingManager>(new TracingManager()); | 131 return std::unique_ptr<TracingManager>(new TracingManager()); |
| 132 } | 132 } |
| 133 | 133 |
| 134 TracingManager* TracingManager::Get() { | 134 TracingManager* TracingManager::Get() { |
| 135 return g_tracing_manager; | 135 return g_tracing_manager; |
| 136 } | 136 } |
| OLD | NEW |