OLD | NEW |
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 #include "base/trace_event/trace_event_impl.h" | 5 #include "base/trace_event/trace_event_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 flags_(0), | 49 flags_(0), |
50 phase_(TRACE_EVENT_PHASE_BEGIN) { | 50 phase_(TRACE_EVENT_PHASE_BEGIN) { |
51 for (int i = 0; i < kTraceMaxNumArgs; ++i) | 51 for (int i = 0; i < kTraceMaxNumArgs; ++i) |
52 arg_names_[i] = NULL; | 52 arg_names_[i] = NULL; |
53 memset(arg_values_, 0, sizeof(arg_values_)); | 53 memset(arg_values_, 0, sizeof(arg_values_)); |
54 } | 54 } |
55 | 55 |
56 TraceEvent::~TraceEvent() { | 56 TraceEvent::~TraceEvent() { |
57 } | 57 } |
58 | 58 |
59 void TraceEvent::MoveFrom(scoped_ptr<TraceEvent> other) { | 59 void TraceEvent::MoveFrom(std::unique_ptr<TraceEvent> other) { |
60 timestamp_ = other->timestamp_; | 60 timestamp_ = other->timestamp_; |
61 thread_timestamp_ = other->thread_timestamp_; | 61 thread_timestamp_ = other->thread_timestamp_; |
62 duration_ = other->duration_; | 62 duration_ = other->duration_; |
63 scope_ = other->scope_; | 63 scope_ = other->scope_; |
64 id_ = other->id_; | 64 id_ = other->id_; |
65 category_group_enabled_ = other->category_group_enabled_; | 65 category_group_enabled_ = other->category_group_enabled_; |
66 name_ = other->name_; | 66 name_ = other->name_; |
67 if (other->flags_ & TRACE_EVENT_FLAG_HAS_PROCESS_ID) | 67 if (other->flags_ & TRACE_EVENT_FLAG_HAS_PROCESS_ID) |
68 process_id_ = other->process_id_; | 68 process_id_ = other->process_id_; |
69 else | 69 else |
(...skipping 17 matching lines...) Expand all Loading... |
87 char phase, | 87 char phase, |
88 const unsigned char* category_group_enabled, | 88 const unsigned char* category_group_enabled, |
89 const char* name, | 89 const char* name, |
90 const char* scope, | 90 const char* scope, |
91 unsigned long long id, | 91 unsigned long long id, |
92 unsigned long long bind_id, | 92 unsigned long long bind_id, |
93 int num_args, | 93 int num_args, |
94 const char** arg_names, | 94 const char** arg_names, |
95 const unsigned char* arg_types, | 95 const unsigned char* arg_types, |
96 const unsigned long long* arg_values, | 96 const unsigned long long* arg_values, |
97 scoped_ptr<ConvertableToTraceFormat>* convertable_values, | 97 std::unique_ptr<ConvertableToTraceFormat>* convertable_values, |
98 unsigned int flags) { | 98 unsigned int flags) { |
99 timestamp_ = timestamp; | 99 timestamp_ = timestamp; |
100 thread_timestamp_ = thread_timestamp; | 100 thread_timestamp_ = thread_timestamp; |
101 duration_ = TimeDelta::FromInternalValue(-1); | 101 duration_ = TimeDelta::FromInternalValue(-1); |
102 scope_ = scope; | 102 scope_ = scope; |
103 id_ = id; | 103 id_ = id; |
104 category_group_enabled_ = category_group_enabled; | 104 category_group_enabled_ = category_group_enabled; |
105 name_ = name; | 105 name_ = name; |
106 thread_id_ = thread_id; | 106 thread_id_ = thread_id; |
107 phase_ = phase; | 107 phase_ = phase; |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); | 417 AppendValueAsJSON(arg_types_[i], arg_values_[i], &value_as_text); |
418 | 418 |
419 *out << value_as_text; | 419 *out << value_as_text; |
420 } | 420 } |
421 *out << "}"; | 421 *out << "}"; |
422 } | 422 } |
423 } | 423 } |
424 | 424 |
425 } // namespace trace_event | 425 } // namespace trace_event |
426 } // namespace base | 426 } // namespace base |
OLD | NEW |