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

Unified Diff: net/base/capturing_net_log.cc

Issue 11885009: Improve performance of proxy resolver by tracing DNS dependencies. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: re-upload due to failure last time Created 7 years, 11 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/mock_host_resolver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/capturing_net_log.cc
diff --git a/net/base/capturing_net_log.cc b/net/base/capturing_net_log.cc
index eb7f9e52370e30111b46cccd54d32f2ca35eef76..0ffdfb7c58f418708ac87c489242d377e6b1bfc1 100644
--- a/net/base/capturing_net_log.cc
+++ b/net/base/capturing_net_log.cc
@@ -4,6 +4,7 @@
#include "net/base/capturing_net_log.h"
+#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/values.h"
@@ -34,14 +35,14 @@ CapturingNetLog::CapturedEntry::operator=(const CapturedEntry& entry) {
time = entry.time;
source = entry.source;
phase = entry.phase;
- params.reset(entry.params.get() ? entry.params->DeepCopy() : NULL);
+ params.reset(entry.params ? entry.params->DeepCopy() : NULL);
return *this;
}
bool CapturingNetLog::CapturedEntry::GetStringValue(
const std::string& name,
std::string* value) const {
- if (!params.get())
+ if (!params)
return false;
return params->GetString(name, value);
}
@@ -49,7 +50,7 @@ bool CapturingNetLog::CapturedEntry::GetStringValue(
bool CapturingNetLog::CapturedEntry::GetIntegerValue(
const std::string& name,
int* value) const {
- if (!params.get())
+ if (!params)
return false;
return params->GetInteger(name, value);
}
@@ -58,6 +59,14 @@ bool CapturingNetLog::CapturedEntry::GetNetErrorCode(int* value) const {
return GetIntegerValue("net_error", value);
}
+std::string CapturingNetLog::CapturedEntry::GetParamsJson() const {
+ if (!params)
+ return std::string();
+ std::string json;
+ base::JSONWriter::Write(params.get(), &json);
+ return json;
+}
+
CapturingNetLog::CapturingNetLog()
: last_id_(0),
log_level_(LOG_ALL_BUT_BYTES) {
« no previous file with comments | « net/base/capturing_net_log.h ('k') | net/base/mock_host_resolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698