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 BASE_DEBUG_TRACE_EVENT_ARGUMENT_H_ | |
6 #define BASE_DEBUG_TRACE_EVENT_ARGUMENT_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 | |
11 #include "base/debug/trace_event.h" | |
12 | |
13 namespace base { | |
14 class DictionaryValue; | |
15 class ListValue; | |
16 class Value; | |
17 | |
18 namespace debug { | |
19 | |
20 class BASE_EXPORT TracedValue : public ConvertableToTraceFormat { | |
21 public: | |
22 TracedValue(); | |
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 std::string& value); | |
31 void SetValue(const char* name, Value* value); | |
32 void BeginDictionary(const char* name); | |
33 void BeginArray(const char* name); | |
34 | |
35 void AppendInteger(int); | |
36 void AppendDouble(double); | |
37 void AppendBoolean(bool); | |
38 void AppendString(const std::string&); | |
39 void BeginArray(); | |
40 void BeginDictionary(); | |
41 | |
42 virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE; | |
43 | |
44 private: | |
45 virtual ~TracedValue(); | |
46 | |
47 DictionaryValue* GetCurrentDictionary(); | |
48 ListValue* GetCurrentArray(); | |
49 | |
50 std::vector<Value*> stack_; | |
51 DISALLOW_COPY_AND_ASSIGN(TracedValue); | |
52 }; | |
53 | |
54 } // namespace debug | |
55 } // namespace base | |
56 | |
57 #endif // BASE_DEBUG_TRACE_EVENT_ARGUMENT_H_ | |
OLD | NEW |