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