| 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_BACKGROUND_TRACING_CONFIG_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_CONFIG_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_CONFIG_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_CONFIG_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include <memory> |
| 9 |
| 9 #include "base/trace_event/trace_event_impl.h" | 10 #include "base/trace_event/trace_event_impl.h" |
| 10 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 11 | 12 |
| 12 namespace base { | 13 namespace base { |
| 13 class DictionaryValue; | 14 class DictionaryValue; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 | 18 |
| 18 // BackgroundTracingConfig is passed to the BackgroundTracingManager to | 19 // BackgroundTracingConfig is passed to the BackgroundTracingManager to |
| 19 // setup the trigger rules used to enable/disable background tracing. | 20 // setup the trigger rules used to enable/disable background tracing. |
| 20 class CONTENT_EXPORT BackgroundTracingConfig { | 21 class CONTENT_EXPORT BackgroundTracingConfig { |
| 21 public: | 22 public: |
| 22 virtual ~BackgroundTracingConfig(); | 23 virtual ~BackgroundTracingConfig(); |
| 23 | 24 |
| 24 enum TracingMode { | 25 enum TracingMode { |
| 25 PREEMPTIVE, | 26 PREEMPTIVE, |
| 26 REACTIVE, | 27 REACTIVE, |
| 27 }; | 28 }; |
| 28 TracingMode tracing_mode() const { return tracing_mode_; } | 29 TracingMode tracing_mode() const { return tracing_mode_; } |
| 29 | 30 |
| 30 static scoped_ptr<BackgroundTracingConfig> FromDict( | 31 static std::unique_ptr<BackgroundTracingConfig> FromDict( |
| 31 const base::DictionaryValue* dict); | 32 const base::DictionaryValue* dict); |
| 32 | 33 |
| 33 virtual void IntoDict(base::DictionaryValue* dict) const = 0; | 34 virtual void IntoDict(base::DictionaryValue* dict) const = 0; |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 friend class BackgroundTracingConfigImpl; | 37 friend class BackgroundTracingConfigImpl; |
| 37 explicit BackgroundTracingConfig(TracingMode tracing_mode); | 38 explicit BackgroundTracingConfig(TracingMode tracing_mode); |
| 38 | 39 |
| 39 const TracingMode tracing_mode_; | 40 const TracingMode tracing_mode_; |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 } // namespace content | 43 } // namespace content |
| 43 | 44 |
| 44 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_CONFIG_H_ | 45 #endif // CONTENT_PUBLIC_BROWSER_BACKGROUND_TRACING_CONFIG_H_ |
| OLD | NEW |