| 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 <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 | 13 |
| 14 #include "base/atomicops.h" | 14 #include "base/atomicops.h" |
| 15 #include "base/callback_forward.h" | 15 #include "base/callback_forward.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/observer_list.h" | 19 #include "base/observer_list.h" |
| 19 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 20 #include "base/synchronization/lock.h" | 21 #include "base/synchronization/lock.h" |
| 21 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 22 #include "net/base/net_export.h" | 23 #include "net/base/net_export.h" |
| 23 #include "net/log/net_log_capture_mode.h" | 24 #include "net/log/net_log_capture_mode.h" |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class DictionaryValue; | 27 class DictionaryValue; |
| 27 class Value; | 28 class Value; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 Source source() const { return data_->source; } | 132 Source source() const { return data_->source; } |
| 132 EventPhase phase() const { return data_->phase; } | 133 EventPhase phase() const { return data_->phase; } |
| 133 | 134 |
| 134 // Serializes the specified event to a Value. The Value also includes the | 135 // 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 | 136 // current time. Caller takes ownership of returned Value. Takes in a time |
| 136 // to allow back-dating entries. | 137 // to allow back-dating entries. |
| 137 base::Value* ToValue() const; | 138 base::Value* ToValue() const; |
| 138 | 139 |
| 139 // Returns the parameters as a Value. Returns NULL if there are no | 140 // Returns the parameters as a Value. Returns NULL if there are no |
| 140 // parameters. Caller takes ownership of returned Value. | 141 // parameters. Caller takes ownership of returned Value. |
| 141 base::Value* ParametersToValue() const; | 142 scoped_ptr<base::Value> ParametersToValue() const; |
| 142 | 143 |
| 143 private: | 144 private: |
| 144 const EntryData* const data_; | 145 const EntryData* const data_; |
| 145 | 146 |
| 146 // Log capture mode when the event occurred. | 147 // Log capture mode when the event occurred. |
| 147 const NetLogCaptureMode capture_mode_; | 148 const NetLogCaptureMode capture_mode_; |
| 148 | 149 |
| 149 // It is not safe to copy this class, since |parameters_callback_| may | 150 // It is not safe to copy this class, since |parameters_callback_| may |
| 150 // include pointers that become stale immediately after the event is added, | 151 // include pointers that become stale immediately after the event is added, |
| 151 // even if the code were modified to keep its own copy of the callback. | 152 // even if the code were modified to keep its own copy of the callback. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 NetLog::Source source_; | 391 NetLog::Source source_; |
| 391 NetLog* net_log_; | 392 NetLog* net_log_; |
| 392 | 393 |
| 393 // TODO(eroman): Temporary until crbug.com/467797 is solved. | 394 // TODO(eroman): Temporary until crbug.com/467797 is solved. |
| 394 Liveness liveness_ = ALIVE; | 395 Liveness liveness_ = ALIVE; |
| 395 }; | 396 }; |
| 396 | 397 |
| 397 } // namespace net | 398 } // namespace net |
| 398 | 399 |
| 399 #endif // NET_LOG_NET_LOG_H_ | 400 #endif // NET_LOG_NET_LOG_H_ |
| OLD | NEW |