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

Unified Diff: net/base/capturing_net_log.cc

Issue 10399083: Make NetLog take in callbacks that return Values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix merge error 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/file_stream_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 141317)
+++ net/base/capturing_net_log.cc (working copy)
@@ -80,30 +80,24 @@
log_level_ = log_level;
}
-void CapturingNetLog::AddEntry(
- EventType type,
- const Source& source,
- EventPhase phase,
- const scoped_refptr<EventParameters>& extra_parameters) {
+void CapturingNetLog::OnAddEntry(const net::NetLog::Entry& entry) {
// Only BoundNetLogs without a NetLog should have an invalid source.
- DCHECK(source.is_valid());
+ DCHECK(entry.source().is_valid());
// Using Dictionaries instead of Values makes checking values a little
// simpler.
DictionaryValue* param_dict = NULL;
- if (extra_parameters) {
- Value* param_value = extra_parameters->ToValue();
- if (param_value && !param_value->GetAsDictionary(&param_dict))
- delete param_value;
- }
+ Value* param_value = entry.ParametersToValue();
+ 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,
+ CapturedEntry(entry.type(),
base::TimeTicks::Now(),
- source,
- phase,
+ entry.source(),
+ entry.phase(),
scoped_ptr<DictionaryValue>(param_dict)));
}
« no previous file with comments | « net/base/capturing_net_log.h ('k') | net/base/file_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698