| 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 "net/base/net_log.h" | 5 #include "net/base/net_log.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 observer->log_level_ = LOG_NONE; | 269 observer->log_level_ = LOG_NONE; |
| 270 UpdateLogLevel(); | 270 UpdateLogLevel(); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void NetLog::UpdateLogLevel() { | 273 void NetLog::UpdateLogLevel() { |
| 274 lock_.AssertAcquired(); | 274 lock_.AssertAcquired(); |
| 275 | 275 |
| 276 // Look through all the observers and find the finest granularity | 276 // Look through all the observers and find the finest granularity |
| 277 // log level (higher values of the enum imply *lower* log levels). | 277 // log level (higher values of the enum imply *lower* log levels). |
| 278 LogLevel new_effective_log_level = LOG_NONE; | 278 LogLevel new_effective_log_level = LOG_NONE; |
| 279 ObserverListBase<ThreadSafeObserver>::Iterator it(observers_); | 279 ObserverListBase<ThreadSafeObserver>::Iterator it(&observers_); |
| 280 ThreadSafeObserver* observer; | 280 ThreadSafeObserver* observer; |
| 281 while ((observer = it.GetNext()) != NULL) { | 281 while ((observer = it.GetNext()) != NULL) { |
| 282 new_effective_log_level = | 282 new_effective_log_level = |
| 283 std::min(new_effective_log_level, observer->log_level()); | 283 std::min(new_effective_log_level, observer->log_level()); |
| 284 } | 284 } |
| 285 base::subtle::NoBarrier_Store(&effective_log_level_, | 285 base::subtle::NoBarrier_Store(&effective_log_level_, |
| 286 new_effective_log_level); | 286 new_effective_log_level); |
| 287 } | 287 } |
| 288 | 288 |
| 289 // static | 289 // static |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 BoundNetLog BoundNetLog::Make(NetLog* net_log, | 488 BoundNetLog BoundNetLog::Make(NetLog* net_log, |
| 489 NetLog::SourceType source_type) { | 489 NetLog::SourceType source_type) { |
| 490 if (!net_log) | 490 if (!net_log) |
| 491 return BoundNetLog(); | 491 return BoundNetLog(); |
| 492 | 492 |
| 493 NetLog::Source source(source_type, net_log->NextID()); | 493 NetLog::Source source(source_type, net_log->NextID()); |
| 494 return BoundNetLog(source, net_log); | 494 return BoundNetLog(source, net_log); |
| 495 } | 495 } |
| 496 | 496 |
| 497 } // namespace net | 497 } // namespace net |
| OLD | NEW |