OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | |
oystein (OOO til 10th of July)
2015/04/21 17:31:44
nit: no (c)
| |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_H_ | |
6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_H_ | |
7 | |
8 #include "base/memory/ref_counted_memory.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "base/trace_event/trace_event_impl.h" | |
12 #include "content/browser/tracing/background_tracing_scenario.h" | |
13 #include "content/common/content_export.h" | |
14 | |
15 template <typename T> | |
16 struct DefaultSingletonTraits; | |
17 | |
18 namespace content { | |
19 class BrowserContext; | |
20 class TraceUploader; | |
21 }; | |
22 | |
23 namespace net { | |
24 class URLRequestContextGetter; | |
25 }; | |
26 | |
27 class BackgroundTracingEndpoint; | |
28 | |
29 class BackgroundTracingManager { | |
30 public: | |
31 BackgroundTracingManager(); | |
32 ~BackgroundTracingManager(); | |
33 | |
34 CONTENT_EXPORT static BackgroundTracingManager* GetInstance(); | |
35 | |
36 CONTENT_EXPORT void SetActiveScenario( | |
37 scoped_refptr<BackgroundTracingScenario>); | |
38 | |
39 typedef base::Callback<void(bool)> StartedFinalizingCallback; | |
40 | |
41 CONTENT_EXPORT void TryFinalizingBackgroundTracing(StartedFinalizingCallback); | |
42 | |
43 bool is_gathering_for_testing() const { return is_gathering_; } | |
44 bool is_recording_for_testing() const { return is_recording_; } | |
45 | |
46 private: | |
47 void EnableRecording(); | |
48 void BeginFinalizingBackgroundTracing(); | |
49 void OnFinalizeComplete(); | |
50 | |
51 scoped_refptr<BackgroundTracingScenario> active_scenario_; | |
52 bool is_gathering_; | |
53 bool is_recording_; | |
54 | |
55 base::WeakPtrFactory<BackgroundTracingManager> weak_ptr_factory_; | |
56 | |
57 friend struct DefaultSingletonTraits<BackgroundTracingManager>; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingManager); | |
60 }; | |
61 | |
62 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_H_ | |
OLD | NEW |