Make castv2 performance test work.
[chromium-blink-merge.git] / base / trace_event / trace_event_argument.h
blob78d37d4122947ce9eecccc7afc016eeafa9aceff
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 BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_
6 #define BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_
8 #include <string>
9 #include <vector>
11 #include "base/memory/scoped_ptr.h"
12 #include "base/trace_event/trace_event.h"
14 namespace base {
15 class DictionaryValue;
16 class ListValue;
17 class Value;
19 namespace trace_event {
21 class BASE_EXPORT TracedValue : public ConvertableToTraceFormat {
22 public:
23 TracedValue();
25 void EndDictionary();
26 void EndArray();
28 void SetInteger(const char* name, int value);
29 void SetDouble(const char* name, double);
30 void SetBoolean(const char* name, bool value);
31 void SetString(const char* name, const std::string& value);
32 void SetValue(const char* name, Value* value);
33 void BeginDictionary(const char* name);
34 void BeginArray(const char* name);
36 void AppendInteger(int);
37 void AppendDouble(double);
38 void AppendBoolean(bool);
39 void AppendString(const std::string&);
40 void BeginArray();
41 void BeginDictionary();
43 void AppendAsTraceFormat(std::string* out) const override;
45 private:
46 ~TracedValue() override;
48 DictionaryValue* GetCurrentDictionary();
49 ListValue* GetCurrentArray();
51 scoped_ptr<base::Value> root_;
52 std::vector<Value*> stack_;
53 DISALLOW_COPY_AND_ASSIGN(TracedValue);
56 } // namespace trace_event
57 } // namespace base
59 #endif // BASE_TRACE_EVENT_TRACE_EVENT_ARGUMENT_H_