| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef TracedValue_h | |
| 6 #define TracedValue_h | |
| 7 | |
| 8 #include "base/trace_event/trace_event_argument.h" | |
| 9 #include "platform/PlatformExport.h" | |
| 10 #include "wtf/text/WTFString.h" | |
| 11 | |
| 12 namespace blink { | |
| 13 | |
| 14 // TracedValue copies all passed names and values and doesn't retain references. | |
| 15 class PLATFORM_EXPORT TracedValue final | |
| 16 : public base::trace_event::ConvertableToTraceFormat { | |
| 17 WTF_MAKE_NONCOPYABLE(TracedValue); | |
| 18 | |
| 19 public: | |
| 20 ~TracedValue(); | |
| 21 | |
| 22 static std::unique_ptr<TracedValue> create(); | |
| 23 | |
| 24 void endDictionary(); | |
| 25 void endArray(); | |
| 26 | |
| 27 void setInteger(const char* name, int value); | |
| 28 void setDouble(const char* name, double); | |
| 29 void setBoolean(const char* name, bool value); | |
| 30 void setString(const char* name, const String& value); | |
| 31 void beginArray(const char* name); | |
| 32 void beginDictionary(const char* name); | |
| 33 | |
| 34 void pushInteger(int); | |
| 35 void pushDouble(double); | |
| 36 void pushBoolean(bool); | |
| 37 void pushString(const String&); | |
| 38 void beginArray(); | |
| 39 void beginDictionary(); | |
| 40 | |
| 41 String toString() const; | |
| 42 | |
| 43 private: | |
| 44 TracedValue(); | |
| 45 | |
| 46 // ConvertableToTraceFormat | |
| 47 | |
| 48 // Hide this method from blink code. | |
| 49 using base::trace_event::ConvertableToTraceFormat::ToString; | |
| 50 void AppendAsTraceFormat(std::string*) const final; | |
| 51 void EstimateTraceMemoryOverhead( | |
| 52 base::trace_event::TraceEventMemoryOverhead*) final; | |
| 53 | |
| 54 base::trace_event::TracedValue m_tracedValue; | |
| 55 }; | |
| 56 | |
| 57 } // namespace blink | |
| 58 | |
| 59 #endif // TracedValue_h | |
| OLD | NEW |