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 #ifndef NET_LOG_NET_LOG_H_ | 5 #ifndef NET_LOG_NET_LOG_H_ |
6 #define NET_LOG_NET_LOG_H_ | 6 #define NET_LOG_NET_LOG_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 class NET_EXPORT Entry { | 125 class NET_EXPORT Entry { |
126 public: | 126 public: |
127 Entry(const EntryData* data, NetLogCaptureMode capture_mode); | 127 Entry(const EntryData* data, NetLogCaptureMode capture_mode); |
128 ~Entry(); | 128 ~Entry(); |
129 | 129 |
130 EventType type() const { return data_->type; } | 130 EventType type() const { return data_->type; } |
131 Source source() const { return data_->source; } | 131 Source source() const { return data_->source; } |
132 EventPhase phase() const { return data_->phase; } | 132 EventPhase phase() const { return data_->phase; } |
133 | 133 |
134 // Serializes the specified event to a Value. The Value also includes the | 134 // Serializes the specified event to a Value. The Value also includes the |
135 // current time. Caller takes ownership of returned Value. Takes in a time | 135 // current time. Takes in a time to allow back-dating entries. |
136 // to allow back-dating entries. | 136 std::unique_ptr<base::Value> ToValue() const; |
137 base::Value* ToValue() const; | |
138 | 137 |
139 // Returns the parameters as a Value. Returns NULL if there are no | 138 // Returns the parameters as a Value. Returns NULL if there are no |
140 // parameters. Caller takes ownership of returned Value. | 139 // parameters. |
141 std::unique_ptr<base::Value> ParametersToValue() const; | 140 std::unique_ptr<base::Value> ParametersToValue() const; |
142 | 141 |
143 private: | 142 private: |
144 const EntryData* const data_; | 143 const EntryData* const data_; |
145 | 144 |
146 // Log capture mode when the event occurred. | 145 // Log capture mode when the event occurred. |
147 const NetLogCaptureMode capture_mode_; | 146 const NetLogCaptureMode capture_mode_; |
148 | 147 |
149 // It is not safe to copy this class, since |parameters_callback_| may | 148 // It is not safe to copy this class, since |parameters_callback_| may |
150 // include pointers that become stale immediately after the event is added, | 149 // include pointers that become stale immediately after the event is added, |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 NetLog::Source source_; | 395 NetLog::Source source_; |
397 NetLog* net_log_; | 396 NetLog* net_log_; |
398 | 397 |
399 // TODO(eroman): Temporary until crbug.com/467797 is solved. | 398 // TODO(eroman): Temporary until crbug.com/467797 is solved. |
400 Liveness liveness_ = ALIVE; | 399 Liveness liveness_ = ALIVE; |
401 }; | 400 }; |
402 | 401 |
403 } // namespace net | 402 } // namespace net |
404 | 403 |
405 #endif // NET_LOG_NET_LOG_H_ | 404 #endif // NET_LOG_NET_LOG_H_ |
OLD | NEW |