| 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_TRACING_TRACED_VALUE_H_ | 5 #ifndef V8_TRACING_TRACED_VALUE_H_ |
| 6 #define V8_TRACING_TRACED_VALUE_H_ | 6 #define V8_TRACING_TRACED_VALUE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "include/v8-platform.h" | 13 #include "include/v8-platform.h" |
| 14 #include "src/base/macros.h" | 14 #include "src/base/macros.h" |
| 15 | 15 |
| 16 namespace v8 { | 16 namespace v8 { |
| 17 namespace tracing { | 17 namespace tracing { |
| 18 | 18 |
| 19 class TracedValue : public ConvertableToTraceFormat { | 19 class TracedValue : public ConvertableToTraceFormat { |
| 20 public: | 20 public: |
| 21 ~TracedValue() override; | 21 ~TracedValue() override; |
| 22 | 22 |
| 23 static std::unique_ptr<TracedValue> Create(); | 23 static std::unique_ptr<TracedValue> Create(); |
| 24 | 24 |
| 25 void EndDictionary(); | 25 void EndDictionary(); |
| 26 void EndArray(); | 26 void EndArray(); |
| 27 | 27 |
| 28 // These methods assume that |name| is a long lived "quoted" string. | 28 // These methods assume that |name| is a long lived "quoted" string. |
| 29 void SetInteger(const char* name, int value); | 29 void SetInteger(const char* name, int value); |
| 30 void SetLongInteger(const char* name, int64_t value); |
| 30 void SetDouble(const char* name, double value); | 31 void SetDouble(const char* name, double value); |
| 31 void SetBoolean(const char* name, bool value); | 32 void SetBoolean(const char* name, bool value); |
| 32 void SetString(const char* name, const std::string& value); | 33 void SetString(const char* name, const std::string& value); |
| 33 void BeginDictionary(const char* name); | 34 void BeginDictionary(const char* name); |
| 34 void BeginArray(const char* name); | 35 void BeginArray(const char* name); |
| 35 | 36 |
| 36 void AppendInteger(int); | 37 void AppendInteger(int); |
| 37 void AppendLongInteger(int64_t); | 38 void AppendLongInteger(int64_t); |
| 38 void AppendDouble(double); | 39 void AppendDouble(double); |
| 39 void AppendBoolean(bool); | 40 void AppendBoolean(bool); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 58 std::string data_; | 59 std::string data_; |
| 59 bool first_item_; | 60 bool first_item_; |
| 60 | 61 |
| 61 DISALLOW_COPY_AND_ASSIGN(TracedValue); | 62 DISALLOW_COPY_AND_ASSIGN(TracedValue); |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace tracing | 65 } // namespace tracing |
| 65 } // namespace v8 | 66 } // namespace v8 |
| 66 | 67 |
| 67 #endif // V8_TRACING_TRACED_VALUE_H_ | 68 #endif // V8_TRACING_TRACED_VALUE_H_ |
| OLD | NEW |