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

Side by Side Diff: chrome/browser/net/chrome_net_log.cc

Issue 9585026: Add a source id to global NetLog entries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Missed one Created 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/chrome_net_log.h ('k') | chrome/browser/net/chrome_net_log_unittest.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 "chrome/browser/net/chrome_net_log.h" 5 #include "chrome/browser/net/chrome_net_log.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 } 43 }
44 44
45 ChromeNetLog::~ChromeNetLog() { 45 ChromeNetLog::~ChromeNetLog() {
46 // Remove the observers we own before we're destroyed. 46 // Remove the observers we own before we're destroyed.
47 RemoveThreadSafeObserver(load_timing_observer_.get()); 47 RemoveThreadSafeObserver(load_timing_observer_.get());
48 if (net_log_logger_.get()) 48 if (net_log_logger_.get())
49 RemoveThreadSafeObserver(net_log_logger_.get()); 49 RemoveThreadSafeObserver(net_log_logger_.get());
50 } 50 }
51 51
52 void ChromeNetLog::AddEntry(EventType type, 52 void ChromeNetLog::AddEntry(
53 const base::TimeTicks& time, 53 EventType type,
54 const Source& source, 54 const Source& source,
55 EventPhase phase, 55 EventPhase phase,
56 EventParameters* params) { 56 const scoped_refptr<EventParameters>& params) {
57 base::TimeTicks time(base::TimeTicks::Now());
58
57 base::AutoLock lock(lock_); 59 base::AutoLock lock(lock_);
58 60
59 // Notify all of the log observers. 61 // Notify all of the log observers.
60 FOR_EACH_OBSERVER(ThreadSafeObserver, observers_, 62 FOR_EACH_OBSERVER(ThreadSafeObserver, observers_,
61 OnAddEntry(type, time, source, phase, params)); 63 OnAddEntry(type, time, source, phase, params));
62 } 64 }
63 65
64 uint32 ChromeNetLog::NextID() { 66 uint32 ChromeNetLog::NextID() {
65 return base::subtle::NoBarrier_AtomicIncrement(&last_id_, 1); 67 return base::subtle::NoBarrier_AtomicIncrement(&last_id_, 1);
66 } 68 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 LogLevel new_effective_log_level = base_log_level_; 111 LogLevel new_effective_log_level = base_log_level_;
110 ObserverListBase<ThreadSafeObserver>::Iterator it(observers_); 112 ObserverListBase<ThreadSafeObserver>::Iterator it(observers_);
111 ThreadSafeObserver* observer; 113 ThreadSafeObserver* observer;
112 while ((observer = it.GetNext()) != NULL) { 114 while ((observer = it.GetNext()) != NULL) {
113 new_effective_log_level = 115 new_effective_log_level =
114 std::min(new_effective_log_level, observer->log_level()); 116 std::min(new_effective_log_level, observer->log_level());
115 } 117 }
116 base::subtle::NoBarrier_Store(&effective_log_level_, 118 base::subtle::NoBarrier_Store(&effective_log_level_,
117 new_effective_log_level); 119 new_effective_log_level);
118 } 120 }
OLDNEW
« no previous file with comments | « chrome/browser/net/chrome_net_log.h ('k') | chrome/browser/net/chrome_net_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698