Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(875)

Side by Side Diff: net/base/net_log.cc

Issue 982413002: base: Stop passing a non-const ref to ObserverListBase::Iterator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: observerref: fixwindowsbuild Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ipc/ipc_test_sink.cc ('k') | ppapi/proxy/ppapi_proxy_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ipc/ipc_test_sink.cc ('k') | ppapi/proxy/ppapi_proxy_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698