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

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

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 ~TracingTimer(); 71 ~TracingTimer();
72 72
73 void StartTimer(int seconds); 73 void StartTimer(int seconds);
74 void CancelTimer(); 74 void CancelTimer();
75 75
76 void FireTimerForTesting(); 76 void FireTimerForTesting();
77 77
78 private: 78 private:
79 void TracingTimerFired(); 79 void TracingTimerFired();
80 80
81 base::OneShotTimer<TracingTimer> tracing_timer_; 81 base::OneShotTimer tracing_timer_;
82 StartedFinalizingCallback callback_; 82 StartedFinalizingCallback callback_;
83 }; 83 };
84 84
85 scoped_ptr<TracingDelegate> delegate_; 85 scoped_ptr<TracingDelegate> delegate_;
86 scoped_ptr<const content::BackgroundTracingConfigImpl> config_; 86 scoped_ptr<const content::BackgroundTracingConfigImpl> config_;
87 std::map<TriggerHandle, std::string> trigger_handles_; 87 std::map<TriggerHandle, std::string> trigger_handles_;
88 scoped_ptr<TracingTimer> tracing_timer_; 88 scoped_ptr<TracingTimer> tracing_timer_;
89 ReceiveCallback receive_callback_; 89 ReceiveCallback receive_callback_;
90 90
91 bool is_gathering_; 91 bool is_gathering_;
92 bool is_tracing_; 92 bool is_tracing_;
93 bool requires_anonymized_data_; 93 bool requires_anonymized_data_;
94 int trigger_handle_ids_; 94 int trigger_handle_ids_;
95 95
96 TriggerHandle reactive_triggered_handle_; 96 TriggerHandle reactive_triggered_handle_;
97 97
98 IdleCallback idle_callback_; 98 IdleCallback idle_callback_;
99 base::Closure tracing_enabled_callback_for_testing_; 99 base::Closure tracing_enabled_callback_for_testing_;
100 100
101 friend struct base::DefaultLazyInstanceTraits<BackgroundTracingManagerImpl>; 101 friend struct base::DefaultLazyInstanceTraits<BackgroundTracingManagerImpl>;
102 102
103 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingManagerImpl); 103 DISALLOW_COPY_AND_ASSIGN(BackgroundTracingManagerImpl);
104 }; 104 };
105 105
106 } // namespace content 106 } // namespace content
107 107
108 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_ 108 #endif // CONTENT_BROWSER_TRACING_BACKGROUND_TRACING_MANAGER_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_version.h ('k') | content/browser/tracing/background_tracing_rule.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698