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 "platform/EventTracer.h" 9 10 #include "wtf/PassRefPtr.h" 11 #include "wtf/text/WTFString.h" 12 13 namespace WebCore { 14 class JSONValue; 15 16 class PLATFORM_EXPORT TracedValue : public TraceEvent::ConvertableToTraceFormat { 17 WTF_MAKE_NONCOPYABLE(TracedValue); 18 public: 19 static PassRefPtr<TraceEvent::ConvertableToTraceFormat> fromJSONValue(PassRefPtr<JSONValue> value) 20 { 21 return adoptRef(new TracedValue(value)); 22 } 23 24 String asTraceFormat() const OVERRIDE; 25 26 private: 27 explicit TracedValue(PassRefPtr<JSONValue>); 28 virtual ~TracedValue(); 29 30 RefPtr<JSONValue> m_value; 31 }; 32 33 } // namespace WebCore 34 35 #endif // TracedValue_h 36