Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: content/browser/tracing/background_tracing_manager_impl.h

Issue 1148633007: Hooked the trace event argument whitelist up to the background_trace_manager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Buildfix Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 4
5 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_
6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_ 6 #define CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_
7 7
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/memory/ref_counted_memory.h" 9 #include "base/memory/ref_counted_memory.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "content/browser/tracing/tracing_controller_impl.h" 12 #include "content/browser/tracing/tracing_controller_impl.h"
13 #include "content/public/browser/background_tracing_config.h" 13 #include "content/public/browser/background_tracing_config.h"
14 #include "content/public/browser/background_tracing_manager.h" 14 #include "content/public/browser/background_tracing_manager.h"
15 15
16 namespace content { 16 namespace content {
17 17
18 class BackgroundTracingManagerImpl : public content::BackgroundTracingManager { 18 class BackgroundTracingManagerImpl : public content::BackgroundTracingManager {
19 public: 19 public:
20 static BackgroundTracingManagerImpl* GetInstance(); 20 static BackgroundTracingManagerImpl* GetInstance();
21 21
22 bool SetActiveScenario(scoped_ptr<BackgroundTracingConfig>, 22 bool SetActiveScenario(scoped_ptr<BackgroundTracingConfig>,
23 const ReceiveCallback&, 23 const ReceiveCallback&,
24 bool) override; 24 DataFiltering data_filtering) override;
25 void WhenIdle(IdleCallback idle_callback) override; 25 void WhenIdle(IdleCallback idle_callback) override;
26 26
27 void TriggerNamedEvent(TriggerHandle, StartedFinalizingCallback) override; 27 void TriggerNamedEvent(TriggerHandle, StartedFinalizingCallback) override;
28 TriggerHandle RegisterTriggerType(const char* trigger_name) override; 28 TriggerHandle RegisterTriggerType(const char* trigger_name) override;
29 void GetTriggerNameList(std::vector<std::string>* trigger_names) override; 29 void GetTriggerNameList(std::vector<std::string>* trigger_names) override;
30 30
31 void InvalidateTriggerHandlesForTesting() override; 31 void InvalidateTriggerHandlesForTesting() override;
32 32 void SetTracingEnabledCallbackForTesting(
33 const base::Closure& callback) override;
33 void FireTimerForTesting() override; 34 void FireTimerForTesting() override;
34 35
35 private: 36 private:
36 BackgroundTracingManagerImpl(); 37 BackgroundTracingManagerImpl();
37 ~BackgroundTracingManagerImpl() override; 38 ~BackgroundTracingManagerImpl() override;
38 39
39 void EnableRecording(std::string, base::trace_event::TraceRecordMode); 40 void EnableRecording(std::string, base::trace_event::TraceRecordMode);
40 void EnableRecordingIfConfigNeedsIt(); 41 void EnableRecordingIfConfigNeedsIt();
41 void OnFinalizeStarted(scoped_refptr<base::RefCountedString>); 42 void OnFinalizeStarted(scoped_refptr<base::RefCountedString>);
42 void OnFinalizeComplete(); 43 void OnFinalizeComplete();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 std::map<TriggerHandle, std::string> trigger_handles_; 88 std::map<TriggerHandle, std::string> trigger_handles_;
88 scoped_ptr<TracingTimer> tracing_timer_; 89 scoped_ptr<TracingTimer> tracing_timer_;
89 ReceiveCallback receive_callback_; 90 ReceiveCallback receive_callback_;
90 91
91 bool is_gathering_; 92 bool is_gathering_;
92 bool is_tracing_; 93 bool is_tracing_;
93 bool requires_anonymized_data_; 94 bool requires_anonymized_data_;
94 int trigger_handle_ids_; 95 int trigger_handle_ids_;
95 96
96 IdleCallback idle_callback_; 97 IdleCallback idle_callback_;
98 base::Closure tracing_enabled_callback_for_testing_;
97 99
98 friend struct base::DefaultLazyInstanceTraits<BackgroundTracingManagerImpl>; 100 friend struct base::DefaultLazyInstanceTraits<BackgroundTracingManagerImpl>;
99 101
100 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingManagerImpl); 102 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingManagerImpl);
101 }; 103 };
102 104
103 } // namespace content 105 } // namespace content
104 106
105 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_ 107 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698