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

Unified Diff: net/base/capturing_net_log.cc

Issue 10546071: CapturingNetLog - remove maximum entries constructor argument. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/base/capturing_net_log.h ('k') | net/base/net_log_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/capturing_net_log.cc
===================================================================
--- net/base/capturing_net_log.cc (revision 141266)
+++ net/base/capturing_net_log.cc (working copy)
@@ -58,9 +58,8 @@
return GetIntegerValue("net_error", value);
}
-CapturingNetLog::CapturingNetLog(size_t max_num_entries)
+CapturingNetLog::CapturingNetLog()
: last_id_(0),
- max_num_entries_(max_num_entries),
log_level_(LOG_ALL_BUT_BYTES) {
}
@@ -86,10 +85,9 @@
const Source& source,
EventPhase phase,
const scoped_refptr<EventParameters>& extra_parameters) {
+ // Only BoundNetLogs without a NetLog should have an invalid source.
DCHECK(source.is_valid());
- base::AutoLock lock(lock_);
- if (captured_entries_.size() >= max_num_entries_)
- return;
+
// Using Dictionaries instead of Values makes checking values a little
// simpler.
DictionaryValue* param_dict = NULL;
@@ -98,6 +96,9 @@
if (param_value && !param_value->GetAsDictionary(&param_dict))
delete param_value;
}
+
+ // Only need to acquire the lock when accessing class variables.
+ base::AutoLock lock(lock_);
captured_entries_.push_back(
CapturedEntry(type,
base::TimeTicks::Now(),
@@ -131,9 +132,8 @@
NOTIMPLEMENTED() << "Not currently used by net unit tests.";
}
-CapturingBoundNetLog::CapturingBoundNetLog(size_t max_num_entries)
- : capturing_net_log_(max_num_entries),
- net_log_(BoundNetLog::Make(&capturing_net_log_,
+CapturingBoundNetLog::CapturingBoundNetLog()
+ : net_log_(BoundNetLog::Make(&capturing_net_log_,
net::NetLog::SOURCE_NONE)) {
}
« no previous file with comments | « net/base/capturing_net_log.h ('k') | net/base/net_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698