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

Side by Side Diff: content/public/browser/background_tracing_manager.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: Changed bool param to enum 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_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_
6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_ 6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_
7 7
8 #include "base/trace_event/trace_event_impl.h" 8 #include "base/trace_event/trace_event_impl.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 21 matching lines...) Expand all
32 // void Upload(const base::RefCountedString* data, 32 // void Upload(const base::RefCountedString* data,
33 // base::Closure done_callback) { 33 // base::Closure done_callback) {
34 // BrowserThread::PostTaskAndReply( 34 // BrowserThread::PostTaskAndReply(
35 // BrowserThread::FILE, 35 // BrowserThread::FILE,
36 // FROM_HERE, 36 // FROM_HERE,
37 // base::Bind(&DoUploadOnFileThread, data), 37 // base::Bind(&DoUploadOnFileThread, data),
38 // done_callback 38 // done_callback
39 // ); 39 // );
40 // } 40 // }
41 // 41 //
42 typedef base::Callback<void(const base::RefCountedString*, base::Closure)> 42 typedef base::Callback<void(const scoped_refptr<base::RefCountedString>&,
43 ReceiveCallback; 43 base::Closure)> ReceiveCallback;
44 44
45 // Set the triggering rules for when to start recording. 45 // Set the triggering rules for when to start recording.
46 // 46 //
47 // In preemptive mode, recording begins immediately and any calls to 47 // In preemptive mode, recording begins immediately and any calls to
48 // TriggerNamedEvent() will potentially trigger the trace to finalize and get 48 // TriggerNamedEvent() will potentially trigger the trace to finalize and get
49 // uploaded to the specified upload_sink. Once the trace has been uploaded, 49 // uploaded to the specified upload_sink. Once the trace has been uploaded,
50 // tracing will be enabled again. 50 // tracing will be enabled again.
51 // 51 //
52 // In reactive mode, recording begins when TriggerNamedEvent() is called, and 52 // In reactive mode, recording begins when TriggerNamedEvent() is called, and
53 // continues until either the next call to TriggerNamedEvent, or a timeout 53 // continues until either the next call to TriggerNamedEvent, or a timeout
54 // occurs. Tracing will not be re-enabled after the trace is finalized and 54 // occurs. Tracing will not be re-enabled after the trace is finalized and
55 // uploaded to the upload_sink. 55 // uploaded to the upload_sink.
56 // 56 //
57 // Calls to SetActiveScenario() with a config will fail if tracing is 57 // Calls to SetActiveScenario() with a config will fail if tracing is
58 // currently on. Use WhenIdle to register a callback to get notified when 58 // currently on. Use WhenIdle to register a callback to get notified when
59 // the manager is idle and a config can be set again. 59 // the manager is idle and a config can be set again.
60 enum DataFiltering {
61 NO_DATA_FILTERING,
62 ANONYMIZE_DATA,
63 };
60 virtual bool SetActiveScenario(scoped_ptr<BackgroundTracingConfig> config, 64 virtual bool SetActiveScenario(scoped_ptr<BackgroundTracingConfig> config,
61 const ReceiveCallback& receive_callback, 65 const ReceiveCallback& receive_callback,
62 bool requires_anonymized_data) = 0; 66 const base::Closure& enabled_callback,
67 DataFiltering data_filtering) = 0;
63 68
64 // Notifies the caller when the manager is idle (not recording or uploading), 69 // Notifies the caller when the manager is idle (not recording or uploading),
65 // so that a call to SetActiveScenario() is likely to succeed. 70 // so that a call to SetActiveScenario() is likely to succeed.
66 typedef base::Callback<void()> IdleCallback; 71 typedef base::Callback<void()> IdleCallback;
67 virtual void WhenIdle(IdleCallback idle_callback) = 0; 72 virtual void WhenIdle(IdleCallback idle_callback) = 0;
68 73
69 typedef base::Callback<void(bool)> StartedFinalizingCallback; 74 typedef base::Callback<void(bool)> StartedFinalizingCallback;
70 typedef int TriggerHandle; 75 typedef int TriggerHandle;
71 76
72 // Notifies that a manual trigger event has occurred, and we may need to 77 // Notifies that a manual trigger event has occurred, and we may need to
(...skipping 12 matching lines...) Expand all
85 90
86 virtual void InvalidateTriggerHandlesForTesting() = 0; 91 virtual void InvalidateTriggerHandlesForTesting() = 0;
87 92
88 protected: 93 protected:
89 virtual ~BackgroundTracingManager() {} 94 virtual ~BackgroundTracingManager() {}
90 }; 95 };
91 96
92 } // namespace content 97 } // namespace content
93 98
94 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_ 99 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698