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

Unified Diff: content/browser/loader/netlog_observer.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 | « content/browser/download/download_manager_impl.cc ('k') | content/browser/media/media_internals_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/netlog_observer.cc
diff --git a/content/browser/loader/netlog_observer.cc b/content/browser/loader/netlog_observer.cc
index c8d95d21c976f4ddaf254b61cf48ef79fbcebc0e..9424bc3c2ffea9c8737281c2a551f73b41543d03 100644
--- a/content/browser/loader/netlog_observer.cc
+++ b/content/browser/loader/netlog_observer.cc
@@ -13,6 +13,8 @@
#include "net/base/load_flags.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_util.h"
+#include "net/log/net_log_event_type.h"
+#include "net/log/net_log_source_type.h"
#include "net/spdy/spdy_header_block.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_netlog_params.h"
@@ -45,15 +47,15 @@ void NetLogObserver::OnAddEntry(const net::NetLog::Entry& entry) {
if (!io_thread_checker_.Get()->CalledOnValidThread())
return;
- if (entry.source().type == net::NetLog::SOURCE_URL_REQUEST)
+ if (entry.source().type == net::NetLogSourceType::URL_REQUEST)
OnAddURLRequestEntry(entry);
}
void NetLogObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) {
- bool is_begin = entry.phase() == net::NetLog::PHASE_BEGIN;
- bool is_end = entry.phase() == net::NetLog::PHASE_END;
+ bool is_begin = entry.phase() == net::NetLogEventPhase::BEGIN;
+ bool is_end = entry.phase() == net::NetLogEventPhase::END;
- if (entry.type() == net::NetLog::TYPE_URL_REQUEST_START_JOB) {
+ if (entry.type() == net::NetLogEventType::URL_REQUEST_START_JOB) {
if (is_begin) {
if (request_to_info_.size() > kMaxNumEntries) {
LOG(WARNING) << "The raw headers observer url request count has grown "
@@ -64,7 +66,7 @@ void NetLogObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) {
request_to_info_[entry.source().id] = new ResourceInfo();
}
return;
- } else if (entry.type() == net::NetLog::TYPE_REQUEST_ALIVE) {
+ } else if (entry.type() == net::NetLogEventType::REQUEST_ALIVE) {
// Cleanup records based on the TYPE_REQUEST_ALIVE entry.
if (is_end)
request_to_info_.erase(entry.source().id);
@@ -76,7 +78,7 @@ void NetLogObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) {
return;
switch (entry.type()) {
- case net::NetLog::TYPE_HTTP_TRANSACTION_SEND_REQUEST_HEADERS: {
+ case net::NetLogEventType::HTTP_TRANSACTION_SEND_REQUEST_HEADERS: {
std::unique_ptr<base::Value> event_params(entry.ParametersToValue());
std::string request_line;
net::HttpRequestHeaders request_headers;
@@ -97,7 +99,7 @@ void NetLogObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) {
info->request_headers_text = request_line + request_headers.ToString();
break;
}
- case net::NetLog::TYPE_HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS: {
+ case net::NetLogEventType::HTTP_TRANSACTION_HTTP2_SEND_REQUEST_HEADERS: {
std::unique_ptr<base::Value> event_params(entry.ParametersToValue());
net::SpdyHeaderBlock request_headers;
@@ -118,7 +120,7 @@ void NetLogObserver::OnAddURLRequestEntry(const net::NetLog::Entry& entry) {
info->request_headers_text = "";
break;
}
- case net::NetLog::TYPE_HTTP_TRANSACTION_READ_RESPONSE_HEADERS: {
+ case net::NetLogEventType::HTTP_TRANSACTION_READ_RESPONSE_HEADERS: {
std::unique_ptr<base::Value> event_params(entry.ParametersToValue());
scoped_refptr<net::HttpResponseHeaders> response_headers;
« no previous file with comments | « content/browser/download/download_manager_impl.cc ('k') | content/browser/media/media_internals_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698