Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: base/debug/trace_event_argument.h

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #include "base/memory/scoped_ptr.h"
13
14 namespace base {
15 class DictionaryValue;
16 class ListValue;
17 class StringValue;
18 class Value;
19
20 namespace debug {
21
22 class BASE_EXPORT TracedValue : public base::debug::ConvertableToTraceFormat {
willchan no longer on Chromium 2014/07/30 15:56:16 Nit: I think it's unnecessary to use base:: and ba
yurys 2014/07/31 12:06:09 Done. Overlooked that. Thanks.
23 public:
24 TracedValue();
25
26 void EndDictionary();
27 void EndArray();
28
29 void SetInteger(const char* name, int value);
30 void SetDouble(const char* name, double);
31 void SetBoolean(const char* name, bool value);
32 void SetString(const char* name, const std::string& value);
33 void SetValue(const char* name, base::Value* value);
34 void BeginDictionary(const char* name);
35 void BeginArray(const char* name);
36
37 void AppendInteger(int);
38 void AppendDouble(double);
39 void AppendBoolean(bool);
40 void AppendString(const std::string&);
41 void BeginArray();
42 void BeginDictionary();
43
44 virtual void AppendAsTraceFormat(std::string* out) const OVERRIDE;
45
46 private:
47 virtual ~TracedValue();
48
49 base::DictionaryValue* GetCurrentDictionary();
50 base::ListValue* GetCurrentArray();
51
52 std::vector<base::Value*> stack_;
53 DISALLOW_COPY_AND_ASSIGN(TracedValue);
54 };
55
56 } // namespace debug
57 } // namespace base
58
59 #endif // BASE_DEBUG_TRACE_EVENT_ARGUMENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698