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

Unified Diff: content/browser/service_worker/service_worker_fetch_dispatcher.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
Index: content/browser/service_worker/service_worker_fetch_dispatcher.cc
diff --git a/content/browser/service_worker/service_worker_fetch_dispatcher.cc b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
index 4e5329846dab76906d6c26df860526206309182b..9b36652770af2deee45b575e83301e7d91e0c60f 100644
--- a/content/browser/service_worker/service_worker_fetch_dispatcher.cc
+++ b/content/browser/service_worker/service_worker_fetch_dispatcher.cc
@@ -14,6 +14,7 @@
#include "content/browser/service_worker/service_worker_version.h"
#include "content/common/service_worker/service_worker_messages.h"
#include "content/common/service_worker/service_worker_utils.h"
+#include "net/log/net_log_event_type.h"
namespace content {
@@ -57,7 +58,7 @@ std::unique_ptr<base::Value> NetLogFetchEventCallback(
}
void EndNetLogEventWithServiceWorkerStatus(const net::BoundNetLog& net_log,
- net::NetLog::EventType type,
+ net::NetLogEventType type,
ServiceWorkerStatusCode status) {
net_log.EndEvent(type,
base::Bind(&NetLogServiceWorkerStatusCallback, status));
@@ -117,7 +118,7 @@ ServiceWorkerFetchDispatcher::ServiceWorkerFetchDispatcher(
resource_type_(resource_type),
did_complete_(false),
weak_factory_(this) {
- net_log_.BeginEvent(net::NetLog::TYPE_SERVICE_WORKER_DISPATCH_FETCH_EVENT,
+ net_log_.BeginEvent(net::NetLogEventType::SERVICE_WORKER_DISPATCH_FETCH_EVENT,
net::NetLog::StringCallback(
"event_type", ServiceWorkerMetrics::EventTypeToString(
GetEventType())));
@@ -125,7 +126,8 @@ ServiceWorkerFetchDispatcher::ServiceWorkerFetchDispatcher(
ServiceWorkerFetchDispatcher::~ServiceWorkerFetchDispatcher() {
if (!did_complete_)
- net_log_.EndEvent(net::NetLog::TYPE_SERVICE_WORKER_DISPATCH_FETCH_EVENT);
+ net_log_.EndEvent(
+ net::NetLogEventType::SERVICE_WORKER_DISPATCH_FETCH_EVENT);
}
void ServiceWorkerFetchDispatcher::Run() {
@@ -134,7 +136,8 @@ void ServiceWorkerFetchDispatcher::Run() {
<< version_->status();
if (version_->status() == ServiceWorkerVersion::ACTIVATING) {
- net_log_.BeginEvent(net::NetLog::TYPE_SERVICE_WORKER_WAIT_FOR_ACTIVATION);
+ net_log_.BeginEvent(
+ net::NetLogEventType::SERVICE_WORKER_WAIT_FOR_ACTIVATION);
version_->RegisterStatusChangeCallback(
base::Bind(&ServiceWorkerFetchDispatcher::DidWaitForActivation,
weak_factory_.GetWeakPtr()));
@@ -144,7 +147,7 @@ void ServiceWorkerFetchDispatcher::Run() {
}
void ServiceWorkerFetchDispatcher::DidWaitForActivation() {
- net_log_.EndEvent(net::NetLog::TYPE_SERVICE_WORKER_WAIT_FOR_ACTIVATION);
+ net_log_.EndEvent(net::NetLogEventType::SERVICE_WORKER_WAIT_FOR_ACTIVATION);
StartWorker();
}
@@ -162,7 +165,7 @@ void ServiceWorkerFetchDispatcher::StartWorker() {
return;
}
- net_log_.BeginEvent(net::NetLog::TYPE_SERVICE_WORKER_START_WORKER);
+ net_log_.BeginEvent(net::NetLogEventType::SERVICE_WORKER_START_WORKER);
version_->RunAfterStartWorker(
GetEventType(), base::Bind(&ServiceWorkerFetchDispatcher::DidStartWorker,
weak_factory_.GetWeakPtr()),
@@ -171,14 +174,14 @@ void ServiceWorkerFetchDispatcher::StartWorker() {
}
void ServiceWorkerFetchDispatcher::DidStartWorker() {
- net_log_.EndEvent(net::NetLog::TYPE_SERVICE_WORKER_START_WORKER);
+ net_log_.EndEvent(net::NetLogEventType::SERVICE_WORKER_START_WORKER);
DispatchFetchEvent();
}
void ServiceWorkerFetchDispatcher::DidFailToStartWorker(
ServiceWorkerStatusCode status) {
EndNetLogEventWithServiceWorkerStatus(
- net_log_, net::NetLog::TYPE_SERVICE_WORKER_START_WORKER, status);
+ net_log_, net::NetLogEventType::SERVICE_WORKER_START_WORKER, status);
DidFail(status);
}
@@ -190,7 +193,7 @@ void ServiceWorkerFetchDispatcher::DispatchFetchEvent() {
base::Closure prepare_callback = prepare_callback_;
prepare_callback.Run();
- net_log_.BeginEvent(net::NetLog::TYPE_SERVICE_WORKER_FETCH_EVENT);
+ net_log_.BeginEvent(net::NetLogEventType::SERVICE_WORKER_FETCH_EVENT);
int response_id = version_->StartRequest(
GetEventType(),
base::Bind(&ServiceWorkerFetchDispatcher::DidFailToDispatch,
@@ -215,7 +218,7 @@ void ServiceWorkerFetchDispatcher::DispatchFetchEvent() {
void ServiceWorkerFetchDispatcher::DidFailToDispatch(
ServiceWorkerStatusCode status) {
EndNetLogEventWithServiceWorkerStatus(
- net_log_, net::NetLog::TYPE_SERVICE_WORKER_FETCH_EVENT, status);
+ net_log_, net::NetLogEventType::SERVICE_WORKER_FETCH_EVENT, status);
DidFail(status);
}
@@ -229,7 +232,7 @@ void ServiceWorkerFetchDispatcher::DidFinish(
int request_id,
ServiceWorkerFetchEventResult fetch_result,
const ServiceWorkerResponse& response) {
- net_log_.EndEvent(net::NetLog::TYPE_SERVICE_WORKER_FETCH_EVENT);
+ net_log_.EndEvent(net::NetLogEventType::SERVICE_WORKER_FETCH_EVENT);
Complete(SERVICE_WORKER_OK, fetch_result, response);
}
@@ -241,7 +244,7 @@ void ServiceWorkerFetchDispatcher::Complete(
did_complete_ = true;
net_log_.EndEvent(
- net::NetLog::TYPE_SERVICE_WORKER_DISPATCH_FETCH_EVENT,
+ net::NetLogEventType::SERVICE_WORKER_DISPATCH_FETCH_EVENT,
base::Bind(&NetLogFetchEventCallback, status, fetch_result));
FetchCallback fetch_callback = fetch_callback_;
« no previous file with comments | « content/browser/media/media_internals_proxy.cc ('k') | content/browser/service_worker/service_worker_url_request_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698