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

Unified Diff: content/browser/appcache/appcache_url_loader_factory.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/browser/appcache/appcache_url_loader_factory.cc
diff --git a/content/browser/appcache/appcache_url_loader_factory.cc b/content/browser/appcache/appcache_url_loader_factory.cc
index 37c105abc9091b0170aa1fb9541736d9d434d9ec..ae04d79183ffbc3c80d36a5b97a3e7c04286338c 100644
--- a/content/browser/appcache/appcache_url_loader_factory.cc
+++ b/content/browser/appcache/appcache_url_loader_factory.cc
@@ -20,6 +20,7 @@
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/associated_interface_ptr.h"
#include "mojo/public/cpp/bindings/binding_set.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
namespace content {
@@ -35,14 +36,16 @@ class AppCacheURLLoader : public AppCacheStorage::Delegate,
int32_t request_id,
mojom::URLLoaderClientPtr client_info,
ChromeAppCacheService* appcache_service,
- URLLoaderFactoryGetter* factory_getter)
+ URLLoaderFactoryGetter* factory_getter,
+ const net::NetworkTrafficAnnotationTag& traffic_annotation)
: request_(request),
routing_id_(routing_id),
request_id_(request_id),
client_info_(std::move(client_info)),
appcache_service_(appcache_service),
factory_getter_(factory_getter),
- binding_(this, std::move(url_loader_request)) {
+ binding_(this, std::move(url_loader_request)),
+ traffic_annotation_(traffic_annotation) {
binding_.set_connection_error_handler(base::Bind(
&AppCacheURLLoader::OnConnectionError, base::Unretained(this)));
}
@@ -57,7 +60,8 @@ class AppCacheURLLoader : public AppCacheStorage::Delegate,
appcache_service_->storage()->usage_map()->end()) {
factory_getter_->GetNetworkFactory()->get()->CreateLoaderAndStart(
mojo::MakeRequest(&network_loader_request_), routing_id_, request_id_,
- mojom::kURLLoadOptionSendSSLInfo, request_, std::move(client_info_));
+ mojom::kURLLoadOptionSendSSLInfo, request_, std::move(client_info_),
+ net::MutableNetworkTrafficAnnotationTag(traffic_annotation_));
return;
}
@@ -92,7 +96,8 @@ class AppCacheURLLoader : public AppCacheStorage::Delegate,
cache_id == kAppCacheNoCacheId) {
factory_getter_->GetNetworkFactory()->get()->CreateLoaderAndStart(
mojo::MakeRequest(&network_loader_request_), routing_id_, request_id_,
- mojom::kURLLoadOptionSendSSLInfo, request_, std::move(client_info_));
+ mojom::kURLLoadOptionSendSSLInfo, request_, std::move(client_info_),
+ net::MutableNetworkTrafficAnnotationTag(NO_TRAFFIC_ANNOTATION_YET));
jochen (gone - plz use gerrit) 2017/06/08 17:00:58 why is this not using traffic_annotation_?
Ramin Halavati 2017/06/09 07:08:53 Done.
} else {
DLOG(WARNING) << "AppCache found for url " << url
<< " Returning AppCache factory\n";
@@ -100,7 +105,8 @@ class AppCacheURLLoader : public AppCacheStorage::Delegate,
// Provide the plumbing to initiate AppCache requests here.
factory_getter_->GetNetworkFactory()->get()->CreateLoaderAndStart(
mojo::MakeRequest(&network_loader_request_), routing_id_, request_id_,
- mojom::kURLLoadOptionSendSSLInfo, request_, std::move(client_info_));
+ mojom::kURLLoadOptionSendSSLInfo, request_, std::move(client_info_),
+ net::MutableNetworkTrafficAnnotationTag(NO_TRAFFIC_ANNOTATION_YET));
}
}
@@ -134,6 +140,8 @@ class AppCacheURLLoader : public AppCacheStorage::Delegate,
// Binds the URLLoaderClient with us.
mojo::AssociatedBinding<mojom::URLLoader> binding_;
+ const net::NetworkTrafficAnnotationTag traffic_annotation_;
+
DISALLOW_COPY_AND_ASSIGN(AppCacheURLLoader);
};
@@ -165,13 +173,15 @@ void AppCacheURLLoaderFactory::CreateLoaderAndStart(
int32_t request_id,
uint32_t options,
const ResourceRequest& request,
- mojom::URLLoaderClientPtr client) {
+ mojom::URLLoaderClientPtr client,
+ const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
// This will get deleted when the connection is dropped by the client.
AppCacheURLLoader* loader = new AppCacheURLLoader(
request, std::move(url_loader_request), routing_id, request_id,
- std::move(client), appcache_service_.get(), factory_getter_.get());
+ std::move(client), appcache_service_.get(), factory_getter_.get(),
+ static_cast<net::NetworkTrafficAnnotationTag>(traffic_annotation));
loader->Start();
}

Powered by Google App Engine
This is Rietveld 408576698