Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / platform / TracedValue.h
blob79b877bc4e654c0d378ecba1c6c8a6c2498c0526
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.
5 #ifndef TracedValue_h
6 #define TracedValue_h
8 #include "platform/EventTracer.h"
10 #include "wtf/PassRefPtr.h"
11 #include "wtf/text/WTFString.h"
13 namespace blink {
14 class TracedArrayValue;
15 class TracedDictionaryValue;
16 class InternalValue;
18 // TODO(bashi): Use Allocator which counts allocation size as tracing overhead.
19 typedef Vector<RefPtr<InternalValue>> TracedValueVector;
20 typedef HashMap<String, RefPtr<InternalValue>> TracedValueHashMap;
22 class PLATFORM_EXPORT TracedValue : public TraceEvent::ConvertableToTraceFormat {
23 WTF_MAKE_NONCOPYABLE(TracedValue);
25 public:
26 static PassRefPtr<TracedValue> create();
28 void endDictionary();
29 void endArray();
31 void setInteger(const char* name, int value);
32 void setDouble(const char* name, double);
33 void setBoolean(const char* name, bool value);
34 void setString(const char* name, const String& value);
35 void beginArray(const char* name);
36 void beginDictionary(const char* name);
38 void pushInteger(int);
39 void pushDouble(double);
40 void pushBoolean(bool);
41 void pushString(const String&);
42 void beginArray();
43 void beginDictionary();
45 String asTraceFormat() const override;
47 private:
48 TracedValue();
49 ~TracedValue() override;
51 TracedDictionaryValue* currentDictionary() const;
52 TracedArrayValue* currentArray() const;
54 TracedValueVector m_stack;
57 } // namespace blink
59 #endif // TracedValue_h