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

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

Issue 380763002: Add builders for tracing event's structural arguments (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed memory leak found by Linux ASAN 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
« no previous file with comments | « base/debug/trace_event_argument_unittest.cc ('k') | cc/base/math_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_ 6 #ifndef BASE_DEBUG_TRACE_EVENT_IMPL_H_
7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_ 7 #define BASE_DEBUG_TRACE_EVENT_IMPL_H_
8 8
9 #include <stack> 9 #include <stack>
10 #include <string> 10 #include <string>
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 namespace base { 58 namespace base {
59 59
60 class WaitableEvent; 60 class WaitableEvent;
61 class MessageLoop; 61 class MessageLoop;
62 62
63 namespace debug { 63 namespace debug {
64 64
65 // For any argument of type TRACE_VALUE_TYPE_CONVERTABLE the provided 65 // For any argument of type TRACE_VALUE_TYPE_CONVERTABLE the provided
66 // class must implement this interface. 66 // class must implement this interface.
67 class ConvertableToTraceFormat : public RefCounted<ConvertableToTraceFormat> { 67 class BASE_EXPORT ConvertableToTraceFormat
68 : public RefCounted<ConvertableToTraceFormat> {
68 public: 69 public:
69 // Append the class info to the provided |out| string. The appended 70 // Append the class info to the provided |out| string. The appended
70 // data must be a valid JSON object. Strings must be properly quoted, and 71 // data must be a valid JSON object. Strings must be properly quoted, and
71 // escaped. There is no processing applied to the content after it is 72 // escaped. There is no processing applied to the content after it is
72 // appended. 73 // appended.
73 virtual void AppendAsTraceFormat(std::string* out) const = 0; 74 virtual void AppendAsTraceFormat(std::string* out) const = 0;
74 75
76 std::string ToString() const {
77 std::string result;
78 AppendAsTraceFormat(&result);
79 return result;
80 }
81
75 protected: 82 protected:
76 virtual ~ConvertableToTraceFormat() {} 83 virtual ~ConvertableToTraceFormat() {}
77 84
78 private: 85 private:
79 friend class RefCounted<ConvertableToTraceFormat>; 86 friend class RefCounted<ConvertableToTraceFormat>;
80 }; 87 };
81 88
82 struct TraceEventHandle { 89 struct TraceEventHandle {
83 uint32 chunk_seq; 90 uint32 chunk_seq;
84 uint16 chunk_index; 91 uint16 chunk_index;
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_; 744 scoped_refptr<MessageLoopProxy> flush_message_loop_proxy_;
738 subtle::AtomicWord generation_; 745 subtle::AtomicWord generation_;
739 746
740 DISALLOW_COPY_AND_ASSIGN(TraceLog); 747 DISALLOW_COPY_AND_ASSIGN(TraceLog);
741 }; 748 };
742 749
743 } // namespace debug 750 } // namespace debug
744 } // namespace base 751 } // namespace base
745 752
746 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_ 753 #endif // BASE_DEBUG_TRACE_EVENT_IMPL_H_
OLDNEW
« no previous file with comments | « base/debug/trace_event_argument_unittest.cc ('k') | cc/base/math_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698