OLD | NEW |
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_TRACING_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_TRACING_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_TRACING_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_TRACING_DELEGATE_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class DictionaryValue; | 15 class DictionaryValue; |
16 class Time; | 16 class Time; |
17 } | 17 } |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 class URLRequestContextGetter; | 20 class URLRequestContextGetter; |
21 } | 21 } |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 class BackgroundTracingConfig; | 24 class BackgroundTracingConfig; |
25 class TraceUploader; | 25 class TraceUploader; |
26 | 26 |
27 typedef base::Callback<bool(const std::string& metadata_name)> | 27 typedef base::Callback<bool(const std::string& metadata_name)> |
28 MetadataFilterPredicate; | 28 MetadataFilterPredicate; |
29 | 29 |
30 // This can be implemented by the embedder to provide functionality for the | 30 // This can be implemented by the embedder to provide functionality for the |
31 // about://tracing WebUI. | 31 // about://tracing WebUI. |
32 class CONTENT_EXPORT TracingDelegate { | 32 class CONTENT_EXPORT TracingDelegate { |
33 public: | 33 public: |
34 virtual ~TracingDelegate() {} | 34 virtual ~TracingDelegate() {} |
35 | 35 |
36 // Provide trace uploading functionality; see trace_uploader.h. | 36 // Provide trace uploading functionality; see trace_uploader.h. |
37 virtual scoped_ptr<TraceUploader> GetTraceUploader( | 37 virtual std::unique_ptr<TraceUploader> GetTraceUploader( |
38 net::URLRequestContextGetter* request_context) = 0; | 38 net::URLRequestContextGetter* request_context) = 0; |
39 | 39 |
40 // This can be used to veto a particular background tracing scenario. | 40 // This can be used to veto a particular background tracing scenario. |
41 virtual bool IsAllowedToBeginBackgroundScenario( | 41 virtual bool IsAllowedToBeginBackgroundScenario( |
42 const BackgroundTracingConfig& config, | 42 const BackgroundTracingConfig& config, |
43 bool requires_anonymized_data); | 43 bool requires_anonymized_data); |
44 | 44 |
45 virtual bool IsAllowedToEndBackgroundScenario( | 45 virtual bool IsAllowedToEndBackgroundScenario( |
46 const content::BackgroundTracingConfig& config, | 46 const content::BackgroundTracingConfig& config, |
47 bool requires_anonymized_data); | 47 bool requires_anonymized_data); |
48 | 48 |
49 // Used to add any additional metadata to traces. | 49 // Used to add any additional metadata to traces. |
50 virtual void GenerateMetadataDict(base::DictionaryValue* metadata_dict) {} | 50 virtual void GenerateMetadataDict(base::DictionaryValue* metadata_dict) {} |
51 | 51 |
52 virtual MetadataFilterPredicate GetMetadataFilterPredicate(); | 52 virtual MetadataFilterPredicate GetMetadataFilterPredicate(); |
53 }; | 53 }; |
54 | 54 |
55 } // namespace content | 55 } // namespace content |
56 | 56 |
57 #endif // CONTENT_PUBLIC_BROWSER_TRACING_DELEGATE_H_ | 57 #endif // CONTENT_PUBLIC_BROWSER_TRACING_DELEGATE_H_ |
OLD | NEW |