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

Unified Diff: net/proxy/init_proxy_resolver.cc

Issue 848006: Generalize the net module's LoadLog facility from a passive container, to an event stream (NetLog). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Split up RequestTracker into ConnectJobTracker+RequestTracker+RequestTrackerBase, address comments Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/init_proxy_resolver.h ('k') | net/proxy/init_proxy_resolver_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/init_proxy_resolver.cc
===================================================================
--- net/proxy/init_proxy_resolver.cc (revision 41560)
+++ net/proxy/init_proxy_resolver.cc (working copy)
@@ -8,7 +8,7 @@
#include "base/format_macros.h"
#include "base/logging.h"
#include "base/string_util.h"
-#include "net/base/load_log.h"
+#include "net/base/net_log.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_resolver.h"
@@ -34,15 +34,15 @@
int InitProxyResolver::Init(const ProxyConfig& config,
CompletionCallback* callback,
- LoadLog* load_log) {
+ const BoundNetLog& net_log) {
DCHECK_EQ(STATE_NONE, next_state_);
DCHECK(callback);
DCHECK(config.MayRequirePACResolver());
- DCHECK(!load_log_);
+ DCHECK(!net_log_.net_log());
- load_log_ = load_log;
+ net_log_ = net_log;
- LoadLog::BeginEvent(load_log_, LoadLog::TYPE_INIT_PROXY_RESOLVER);
+ net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER);
pac_urls_ = BuildPacUrlsFallbackList(config);
DCHECK(!pac_urls_.empty());
@@ -122,17 +122,16 @@
int InitProxyResolver::DoFetchPacScript() {
DCHECK(resolver_->expects_pac_bytes());
- LoadLog::BeginEvent(load_log_,
- LoadLog::TYPE_INIT_PROXY_RESOLVER_FETCH_PAC_SCRIPT);
+ net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER_FETCH_PAC_SCRIPT);
next_state_ = STATE_FETCH_PAC_SCRIPT_COMPLETE;
const GURL& pac_url = current_pac_url();
- LoadLog::AddString(load_log_, pac_url.spec());
+ net_log_.AddString(pac_url.spec());
if (!proxy_script_fetcher_) {
- LoadLog::AddStringLiteral(load_log_,
+ net_log_.AddStringLiteral(
"Can't download PAC script, because no fetcher was specified");
return ERR_UNEXPECTED;
}
@@ -143,14 +142,12 @@
int InitProxyResolver::DoFetchPacScriptComplete(int result) {
DCHECK(resolver_->expects_pac_bytes());
- LoadLog::AddString(load_log_,
- StringPrintf(
+ net_log_.AddString(StringPrintf(
"Completed fetch with result %s. Received %" PRIuS " bytes",
ErrorToString(result),
pac_bytes_.size()));
- LoadLog::EndEvent(load_log_,
- LoadLog::TYPE_INIT_PROXY_RESOLVER_FETCH_PAC_SCRIPT);
+ net_log_.EndEvent(NetLog::TYPE_INIT_PROXY_RESOLVER_FETCH_PAC_SCRIPT);
if (result != OK)
return TryToFallbackPacUrl(result);
@@ -160,8 +157,7 @@
}
int InitProxyResolver::DoSetPacScript() {
- LoadLog::BeginEvent(load_log_,
- LoadLog::TYPE_INIT_PROXY_RESOLVER_SET_PAC_SCRIPT);
+ net_log_.BeginEvent(NetLog::TYPE_INIT_PROXY_RESOLVER_SET_PAC_SCRIPT);
const GURL& pac_url = current_pac_url();
@@ -174,18 +170,16 @@
int InitProxyResolver::DoSetPacScriptComplete(int result) {
if (result != OK) {
- LoadLog::AddString(load_log_,
+ net_log_.AddString(
StringPrintf("Failed initializing the PAC script with error: %s",
ErrorToString(result)));
- LoadLog::EndEvent(load_log_,
- LoadLog::TYPE_INIT_PROXY_RESOLVER_SET_PAC_SCRIPT);
+ net_log_.EndEvent(NetLog::TYPE_INIT_PROXY_RESOLVER_SET_PAC_SCRIPT);
return TryToFallbackPacUrl(result);
}
- LoadLog::AddStringLiteral(load_log_, "Successfully initialized PAC script.");
+ net_log_.AddStringLiteral("Successfully initialized PAC script.");
- LoadLog::EndEvent(load_log_,
- LoadLog::TYPE_INIT_PROXY_RESOLVER_SET_PAC_SCRIPT);
+ net_log_.EndEvent(NetLog::TYPE_INIT_PROXY_RESOLVER_SET_PAC_SCRIPT);
return result;
}
@@ -200,7 +194,7 @@
// Advance to next URL in our list.
++current_pac_url_index_;
- LoadLog::AddStringLiteral(load_log_, "Falling back to next PAC URL...");
+ net_log_.AddStringLiteral("Falling back to next PAC URL...");
next_state_ = GetStartState();
@@ -218,13 +212,13 @@
}
void InitProxyResolver::DidCompleteInit() {
- LoadLog::EndEvent(load_log_, LoadLog::TYPE_INIT_PROXY_RESOLVER);
+ net_log_.EndEvent(NetLog::TYPE_INIT_PROXY_RESOLVER);
}
void InitProxyResolver::Cancel() {
DCHECK_NE(STATE_NONE, next_state_);
- LoadLog::AddEvent(load_log_, LoadLog::TYPE_CANCELLED);
+ net_log_.AddEvent(NetLog::TYPE_CANCELLED);
switch (next_state_) {
case STATE_FETCH_PAC_SCRIPT_COMPLETE:
« no previous file with comments | « net/proxy/init_proxy_resolver.h ('k') | net/proxy/init_proxy_resolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698