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

Side by Side Diff: content/browser/service_worker/service_worker_fetch_dispatcher.cc

Issue 2351513002: net: rename BoundNetLog to NetLogWithSource (Closed)
Patch Set: one more fix, content bound_net_log_ 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" 5 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 ServiceWorkerStatusCode status, 50 ServiceWorkerStatusCode status,
51 ServiceWorkerFetchEventResult result, 51 ServiceWorkerFetchEventResult result,
52 net::NetLogCaptureMode) { 52 net::NetLogCaptureMode) {
53 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue); 53 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue);
54 dict->SetString("status", ServiceWorkerStatusToString(status)); 54 dict->SetString("status", ServiceWorkerStatusToString(status));
55 dict->SetBoolean("has_response", 55 dict->SetBoolean("has_response",
56 result == SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE); 56 result == SERVICE_WORKER_FETCH_EVENT_RESULT_RESPONSE);
57 return std::move(dict); 57 return std::move(dict);
58 } 58 }
59 59
60 void EndNetLogEventWithServiceWorkerStatus(const net::BoundNetLog& net_log, 60 void EndNetLogEventWithServiceWorkerStatus(const net::NetLogWithSource& net_log,
61 net::NetLogEventType type, 61 net::NetLogEventType type,
62 ServiceWorkerStatusCode status) { 62 ServiceWorkerStatusCode status) {
63 net_log.EndEvent(type, 63 net_log.EndEvent(type,
64 base::Bind(&NetLogServiceWorkerStatusCallback, status)); 64 base::Bind(&NetLogServiceWorkerStatusCallback, status));
65 } 65 }
66 66
67 ServiceWorkerMetrics::EventType FetchTypeToWaitUntilEventType( 67 ServiceWorkerMetrics::EventType FetchTypeToWaitUntilEventType(
68 ServiceWorkerFetchType type) { 68 ServiceWorkerFetchType type) {
69 if (type == ServiceWorkerFetchType::FOREIGN_FETCH) 69 if (type == ServiceWorkerFetchType::FOREIGN_FETCH)
70 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH_WAITUNTIL; 70 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH_WAITUNTIL;
(...skipping 29 matching lines...) Expand all
100 // Owns |this|. 100 // Owns |this|.
101 ServiceWorkerVersion* version_; 101 ServiceWorkerVersion* version_;
102 102
103 DISALLOW_COPY_AND_ASSIGN(ResponseCallback); 103 DISALLOW_COPY_AND_ASSIGN(ResponseCallback);
104 }; 104 };
105 105
106 ServiceWorkerFetchDispatcher::ServiceWorkerFetchDispatcher( 106 ServiceWorkerFetchDispatcher::ServiceWorkerFetchDispatcher(
107 std::unique_ptr<ServiceWorkerFetchRequest> request, 107 std::unique_ptr<ServiceWorkerFetchRequest> request,
108 ServiceWorkerVersion* version, 108 ServiceWorkerVersion* version,
109 ResourceType resource_type, 109 ResourceType resource_type,
110 const net::BoundNetLog& net_log, 110 const net::NetLogWithSource& net_log,
111 const base::Closure& prepare_callback, 111 const base::Closure& prepare_callback,
112 const FetchCallback& fetch_callback) 112 const FetchCallback& fetch_callback)
113 : version_(version), 113 : version_(version),
114 net_log_(net_log), 114 net_log_(net_log),
115 prepare_callback_(prepare_callback), 115 prepare_callback_(prepare_callback),
116 fetch_callback_(fetch_callback), 116 fetch_callback_(fetch_callback),
117 request_(std::move(request)), 117 request_(std::move(request)),
118 resource_type_(resource_type), 118 resource_type_(resource_type),
119 did_complete_(false), 119 did_complete_(false),
120 weak_factory_(this) { 120 weak_factory_(this) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 254
255 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType() 255 ServiceWorkerMetrics::EventType ServiceWorkerFetchDispatcher::GetEventType()
256 const { 256 const {
257 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH) 257 if (request_->fetch_type == ServiceWorkerFetchType::FOREIGN_FETCH)
258 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH; 258 return ServiceWorkerMetrics::EventType::FOREIGN_FETCH;
259 return ResourceTypeToEventType(resource_type_); 259 return ResourceTypeToEventType(resource_type_);
260 } 260 }
261 261
262 } // namespace content 262 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698