| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "platform/TracedValue.h" | 5 #include "platform/TracedValue.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event_argument.h" | 7 #include "base/trace_event/trace_event_argument.h" |
| 8 #include "wtf/PtrUtil.h" | |
| 9 #include "wtf/text/StringUTF8Adaptor.h" | 8 #include "wtf/text/StringUTF8Adaptor.h" |
| 10 #include <memory> | |
| 11 | 9 |
| 12 namespace blink { | 10 namespace blink { |
| 13 | 11 |
| 14 std::unique_ptr<TracedValue> TracedValue::create() | 12 PassOwnPtr<TracedValue> TracedValue::create() |
| 15 { | 13 { |
| 16 return wrapUnique(new TracedValue()); | 14 return adoptPtr(new TracedValue()); |
| 17 } | 15 } |
| 18 | 16 |
| 19 TracedValue::TracedValue() | 17 TracedValue::TracedValue() |
| 20 : m_tracedValue(new base::trace_event::TracedValue) | 18 : m_tracedValue(new base::trace_event::TracedValue) |
| 21 { | 19 { |
| 22 } | 20 } |
| 23 | 21 |
| 24 TracedValue::~TracedValue() | 22 TracedValue::~TracedValue() |
| 25 { | 23 { |
| 26 } | 24 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 111 |
| 114 String TracedValue::toString() const | 112 String TracedValue::toString() const |
| 115 { | 113 { |
| 116 ASSERT(m_tracedValue.get()); | 114 ASSERT(m_tracedValue.get()); |
| 117 std::string out; | 115 std::string out; |
| 118 m_tracedValue->AppendAsTraceFormat(&out); | 116 m_tracedValue->AppendAsTraceFormat(&out); |
| 119 return String::fromUTF8(out.c_str()); | 117 return String::fromUTF8(out.c_str()); |
| 120 } | 118 } |
| 121 | 119 |
| 122 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |