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

Unified Diff: content/common/throttling_url_loader.cc

Issue 2893233002: Network traffic annotation added to URLLoaderImpl. (Closed)
Patch Set: Changed ParamTraits to StructTraits. Created 3 years, 6 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/common/throttling_url_loader.cc
diff --git a/content/common/throttling_url_loader.cc b/content/common/throttling_url_loader.cc
index 9f258c9d088eb45119684147f6e08bda2be1f69f..b15b12a54d1c60d144b9ae7baf2737711fc7ea39 100644
--- a/content/common/throttling_url_loader.cc
+++ b/content/common/throttling_url_loader.cc
@@ -14,9 +14,10 @@ std::unique_ptr<ThrottlingURLLoader> ThrottlingURLLoader::CreateLoaderAndStart(
int32_t request_id,
uint32_t options,
std::unique_ptr<ResourceRequest> url_request,
- mojom::URLLoaderClient* client) {
- std::unique_ptr<ThrottlingURLLoader> loader(
- new ThrottlingURLLoader(std::move(throttles), client));
+ mojom::URLLoaderClient* client,
+ const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) {
+ std::unique_ptr<ThrottlingURLLoader> loader(new ThrottlingURLLoader(
+ std::move(throttles), client, traffic_annotation));
loader->Start(factory, routing_id, request_id, options,
std::move(url_request));
return loader;
@@ -44,8 +45,11 @@ void ThrottlingURLLoader::SetPriority(net::RequestPriority priority,
ThrottlingURLLoader::ThrottlingURLLoader(
std::vector<std::unique_ptr<URLLoaderThrottle>> throttles,
- mojom::URLLoaderClient* client)
- : forwarding_client_(client), client_binding_(this) {
+ mojom::URLLoaderClient* client,
+ const net::MutableNetworkTrafficAnnotationTag& traffic_annotation)
+ : forwarding_client_(client),
+ client_binding_(this),
+ traffic_annotation_(traffic_annotation) {
if (throttles.size() > 0) {
// TODO(yzshen): Implement a URLLoaderThrottle subclass which handles a list
// of URLLoaderThrottles.
@@ -83,7 +87,8 @@ void ThrottlingURLLoader::Start(mojom::URLLoaderFactory* factory,
factory->CreateLoaderAndStart(mojo::MakeRequest(&url_loader_), routing_id,
request_id, options, *url_request,
- client_binding_.CreateInterfacePtrAndBind());
+ client_binding_.CreateInterfacePtrAndBind(),
+ traffic_annotation_);
}
void ThrottlingURLLoader::OnReceiveResponse(
@@ -214,7 +219,8 @@ void ThrottlingURLLoader::Resume() {
case DEFERRED_START: {
url_loader_factory_->CreateLoaderAndStart(
mojo::MakeRequest(&url_loader_), routing_id_, request_id_, options_,
- *url_request_, client_binding_.CreateInterfacePtrAndBind());
+ *url_request_, client_binding_.CreateInterfacePtrAndBind(),
+ traffic_annotation_);
if (set_priority_cached_) {
set_priority_cached_ = false;

Powered by Google App Engine
This is Rietveld 408576698