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

Unified Diff: content/browser/tracing/background_tracing_manager_impl.h

Issue 1148393003: Implement Reactive Configuration in Background Tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase files depending on reactive config Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/tracing/background_tracing_manager_impl.h
diff --git a/content/browser/tracing/background_tracing_manager_impl.h b/content/browser/tracing/background_tracing_manager_impl.h
index ddca7ba8eec695111c7405e9fcd9217705c7cc49..979562984a01149ea9bb95f0258590a1c73483fd 100644
--- a/content/browser/tracing/background_tracing_manager_impl.h
+++ b/content/browser/tracing/background_tracing_manager_impl.h
@@ -30,11 +30,13 @@ class BackgroundTracingManagerImpl : public content::BackgroundTracingManager {
void InvalidateTriggerHandlesForTesting() override;
+ void FireTimerForTesting() override;
+
private:
BackgroundTracingManagerImpl();
~BackgroundTracingManagerImpl() override;
- void EnableRecording(std::string category_filter_str);
+ void EnableRecording(std::string, base::trace_event::TraceRecordMode);
void EnableRecordingIfConfigNeedsIt();
void OnFinalizeStarted(scoped_refptr<base::RefCountedString>);
void OnFinalizeComplete();
@@ -63,9 +65,27 @@ class BackgroundTracingManagerImpl : public content::BackgroundTracingManager {
base::Callback<void(scoped_refptr<base::RefCountedString>)> done_callback_;
};
+ class TracingTimer {
+ public:
+ explicit TracingTimer(StartedFinalizingCallback);
+ ~TracingTimer();
+
+ void StartTimer();
+ void CancelTimer();
+
+ void FireTimerForTesting();
+
+ private:
+ void TracingTimerFired();
+
+ base::OneShotTimer<TracingTimer> tracing_timer_;
+ StartedFinalizingCallback callback_;
+ };
+
scoped_ptr<content::BackgroundTracingConfig> config_;
scoped_refptr<TraceDataEndpointWrapper> data_endpoint_wrapper_;
std::map<TriggerHandle, std::string> trigger_handles_;
+ scoped_ptr<TracingTimer> tracing_timer_;
ReceiveCallback receive_callback_;
bool is_gathering_;

Powered by Google App Engine
This is Rietveld 408576698