OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 #ifndef V8_LIBPLATFORM_V8_TRACING_H_ | 5 #ifndef V8_LIBPLATFORM_V8_TRACING_H_ |
6 #define V8_LIBPLATFORM_V8_TRACING_H_ | 6 #define V8_LIBPLATFORM_V8_TRACING_H_ |
7 | 7 |
8 #include <fstream> | 8 #include <fstream> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 239 |
240 std::unique_ptr<TraceBuffer> trace_buffer_; | 240 std::unique_ptr<TraceBuffer> trace_buffer_; |
241 std::unique_ptr<TraceConfig> trace_config_; | 241 std::unique_ptr<TraceConfig> trace_config_; |
242 Mode mode_ = DISABLED; | 242 Mode mode_ = DISABLED; |
243 | 243 |
244 // Disallow copy and assign | 244 // Disallow copy and assign |
245 TracingController(const TracingController&) = delete; | 245 TracingController(const TracingController&) = delete; |
246 void operator=(const TracingController&) = delete; | 246 void operator=(const TracingController&) = delete; |
247 }; | 247 }; |
248 | 248 |
| 249 class TraceSerializer { |
| 250 public: |
| 251 explicit TraceSerializer(std::ostream& stream); |
| 252 void WritePrefix(); |
| 253 void AppendTraceEvent(TraceObject* trace_event); |
| 254 void WriteSuffix(); |
| 255 |
| 256 private: |
| 257 void AppendArgValue(uint8_t type, TraceObject::ArgValue value); |
| 258 |
| 259 std::ostream& stream_; |
| 260 bool append_comma_ = false; |
| 261 }; |
| 262 |
249 } // namespace tracing | 263 } // namespace tracing |
250 } // namespace platform | 264 } // namespace platform |
251 } // namespace v8 | 265 } // namespace v8 |
252 | 266 |
253 #endif // V8_LIBPLATFORM_V8_TRACING_H_ | 267 #endif // V8_LIBPLATFORM_V8_TRACING_H_ |
OLD | NEW |