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

Unified Diff: net/proxy/proxy_service.cc

Issue 2315613002: Extracted NetLog class's inner enum types into their own enum classes and (Closed)
Patch Set: Ran "git cl format" on code. Much formatting ensued. Created 4 years, 3 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/proxy_script_decider_unittest.cc ('k') | net/proxy/proxy_service_mojo_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_service.cc
diff --git a/net/proxy/proxy_service.cc b/net/proxy/proxy_service.cc
index 9f7484c8f5169b481949e772ab080f2d80222acd..5ed56d1fec306ef09de4666d43f47288f9be08f8 100644
--- a/net/proxy/proxy_service.cc
+++ b/net/proxy/proxy_service.cc
@@ -28,6 +28,7 @@
#include "net/base/proxy_delegate.h"
#include "net/base/url_util.h"
#include "net/log/net_log.h"
+#include "net/log/net_log_event_type.h"
#include "net/proxy/dhcp_proxy_script_fetcher.h"
#include "net/proxy/multi_threaded_proxy_resolver.h"
#include "net/proxy/proxy_config_service_fixed.h"
@@ -845,7 +846,7 @@ class ProxyService::PacRequest
}
void Cancel() {
- net_log_.AddEvent(NetLog::TYPE_CANCELLED);
+ net_log_.AddEvent(NetLogEventType::CANCELLED);
if (is_started())
CancelResolveJob();
@@ -855,7 +856,7 @@ class ProxyService::PacRequest
user_callback_.Reset();
results_ = NULL;
- net_log_.EndEvent(NetLog::TYPE_PROXY_SERVICE);
+ net_log_.EndEvent(NetLogEventType::PROXY_SERVICE);
}
// Returns true if Cancel() has been called.
@@ -1054,7 +1055,7 @@ int ProxyService::ResolveProxyHelper(const GURL& raw_url,
const BoundNetLog& net_log) {
DCHECK(CalledOnValidThread());
- net_log.BeginEvent(NetLog::TYPE_PROXY_SERVICE);
+ net_log.BeginEvent(NetLogEventType::PROXY_SERVICE);
// Notify our polling-based dependencies that a resolve is taking place.
// This way they can schedule their polls in response to network activity.
@@ -1093,7 +1094,8 @@ int ProxyService::ResolveProxyHelper(const GURL& raw_url,
if (rv != ERR_IO_PENDING)
return req->QueryDidComplete(rv);
} else {
- req->net_log()->BeginEvent(NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC);
+ req->net_log()->BeginEvent(
+ NetLogEventType::PROXY_SERVICE_WAITING_FOR_INIT_PAC);
}
DCHECK_EQ(ERR_IO_PENDING, rv);
@@ -1166,7 +1168,7 @@ void ProxyService::SuspendAllPendingRequests() {
req->CancelResolveJob();
req->net_log()->BeginEvent(
- NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC);
+ NetLogEventType::PROXY_SERVICE_WAITING_FOR_INIT_PAC);
}
}
}
@@ -1185,7 +1187,8 @@ void ProxyService::SetReady() {
++it) {
PacRequest* req = it->get();
if (!req->is_started() && !req->was_cancelled()) {
- req->net_log()->EndEvent(NetLog::TYPE_PROXY_SERVICE_WAITING_FOR_INIT_PAC);
+ req->net_log()->EndEvent(
+ NetLogEventType::PROXY_SERVICE_WAITING_FOR_INIT_PAC);
// Note that we re-check for synchronous completion, in case we are
// no longer using a ProxyResolver (can happen if we fell-back to manual).
@@ -1344,7 +1347,7 @@ void ProxyService::ReportSuccess(const ProxyInfo& result,
}
if (net_log_) {
net_log_->AddGlobalEntry(
- NetLog::TYPE_BAD_PROXY_LIST_REPORTED,
+ NetLogEventType::BAD_PROXY_LIST_REPORTED,
base::Bind(&NetLogBadProxyListCallback, &new_retry_info));
}
}
@@ -1410,7 +1413,7 @@ int ProxyService::DidFinishResolvingProxy(const GURL& url,
if (proxy_delegate)
proxy_delegate->OnResolveProxy(url, method, *this, result);
- net_log.AddEvent(NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST,
+ net_log.AddEvent(NetLogEventType::PROXY_SERVICE_RESOLVED_PROXY_LIST,
base::Bind(&NetLogFinishedResolvingProxyCallback, result));
// This check is done to only log the NetLog event when necessary, it's
@@ -1418,12 +1421,12 @@ int ProxyService::DidFinishResolvingProxy(const GURL& url,
if (!proxy_retry_info_.empty()) {
result->DeprioritizeBadProxies(proxy_retry_info_);
net_log.AddEvent(
- NetLog::TYPE_PROXY_SERVICE_DEPRIORITIZED_BAD_PROXIES,
+ NetLogEventType::PROXY_SERVICE_DEPRIORITIZED_BAD_PROXIES,
base::Bind(&NetLogFinishedResolvingProxyCallback, result));
}
} else {
net_log.AddEventWithNetErrorCode(
- NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST, result_code);
+ NetLogEventType::PROXY_SERVICE_RESOLVED_PROXY_LIST, result_code);
bool reset_config = result_code == ERR_PAC_SCRIPT_TERMINATED;
if (!config_.pac_mandatory()) {
@@ -1454,7 +1457,7 @@ int ProxyService::DidFinishResolvingProxy(const GURL& url,
}
}
- net_log.EndEvent(NetLog::TYPE_PROXY_SERVICE);
+ net_log.EndEvent(NetLogEventType::PROXY_SERVICE);
return result_code;
}
@@ -1593,7 +1596,7 @@ void ProxyService::OnProxyConfigChanged(
// Emit the proxy settings change to the NetLog stream.
if (net_log_) {
- net_log_->AddGlobalEntry(NetLog::TYPE_PROXY_CONFIG_CHANGED,
+ net_log_->AddGlobalEntry(NetLogEventType::PROXY_CONFIG_CHANGED,
base::Bind(&NetLogProxyConfigChangedCallback,
&fetched_config_, &effective_config));
}
« no previous file with comments | « net/proxy/proxy_script_decider_unittest.cc ('k') | net/proxy/proxy_service_mojo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698