| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 | 305 |
| 306 // Last assigned source ID. Incremented to get the next one. | 306 // Last assigned source ID. Incremented to get the next one. |
| 307 base::subtle::Atomic32 last_id_; | 307 base::subtle::Atomic32 last_id_; |
| 308 | 308 |
| 309 // |is_capturing_| will be 0 when there are no observers watching the NetLog, | 309 // |is_capturing_| will be 0 when there are no observers watching the NetLog, |
| 310 // 1 otherwise. Note that this is stored as an Atomic32 rather than a boolean | 310 // 1 otherwise. Note that this is stored as an Atomic32 rather than a boolean |
| 311 // so it can be accessed without needing a lock. | 311 // so it can be accessed without needing a lock. |
| 312 base::subtle::Atomic32 is_capturing_; | 312 base::subtle::Atomic32 is_capturing_; |
| 313 | 313 |
| 314 // |lock_| must be acquired whenever reading or writing to this. | 314 // |lock_| must be acquired whenever reading or writing to this. |
| 315 ObserverList<ThreadSafeObserver, true> observers_; | 315 base::ObserverList<ThreadSafeObserver, true> observers_; |
| 316 | 316 |
| 317 DISALLOW_COPY_AND_ASSIGN(NetLog); | 317 DISALLOW_COPY_AND_ASSIGN(NetLog); |
| 318 }; | 318 }; |
| 319 | 319 |
| 320 // Helper that binds a Source to a NetLog, and exposes convenience methods to | 320 // Helper that binds a Source to a NetLog, and exposes convenience methods to |
| 321 // output log messages without needing to pass in the source. | 321 // output log messages without needing to pass in the source. |
| 322 class NET_EXPORT BoundNetLog { | 322 class NET_EXPORT BoundNetLog { |
| 323 public: | 323 public: |
| 324 BoundNetLog() : net_log_(NULL) {} | 324 BoundNetLog() : net_log_(NULL) {} |
| 325 ~BoundNetLog(); | 325 ~BoundNetLog(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 NetLog::Source source_; | 389 NetLog::Source source_; |
| 390 NetLog* net_log_; | 390 NetLog* net_log_; |
| 391 | 391 |
| 392 // TODO(eroman): Temporary until crbug.com/467797 is solved. | 392 // TODO(eroman): Temporary until crbug.com/467797 is solved. |
| 393 Liveness liveness_ = ALIVE; | 393 Liveness liveness_ = ALIVE; |
| 394 }; | 394 }; |
| 395 | 395 |
| 396 } // namespace net | 396 } // namespace net |
| 397 | 397 |
| 398 #endif // NET_LOG_NET_LOG_H_ | 398 #endif // NET_LOG_NET_LOG_H_ |
| OLD | NEW |