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

Unified Diff: content/common/throttling_url_loader.cc

Issue 2893233002: Network traffic annotation added to URLLoaderImpl. (Closed)
Patch Set: Comment addressed, Merged. 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
« no previous file with comments | « content/common/throttling_url_loader.h ('k') | content/common/throttling_url_loader_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/throttling_url_loader.cc
diff --git a/content/common/throttling_url_loader.cc b/content/common/throttling_url_loader.cc
index beec7cc68e0503ade0f6c6461a9390423e9e1539..52614ef57d159f8ac942e8356d5a9f258b95c30b 100644
--- a/content/common/throttling_url_loader.cc
+++ b/content/common/throttling_url_loader.cc
@@ -57,9 +57,10 @@ std::unique_ptr<ThrottlingURLLoader> ThrottlingURLLoader::CreateLoaderAndStart(
uint32_t options,
std::unique_ptr<ResourceRequest> url_request,
mojom::URLLoaderClient* client,
+ const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
- std::unique_ptr<ThrottlingURLLoader> loader(
- new ThrottlingURLLoader(std::move(throttles), client));
+ 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), std::move(task_runner));
return loader;
@@ -86,8 +87,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.
@@ -127,7 +131,7 @@ void ThrottlingURLLoader::Start(
client_binding_.Bind(mojo::MakeRequest(&client), std::move(task_runner));
factory->CreateLoaderAndStart(mojo::MakeRequest(&url_loader_), routing_id,
request_id, options, *url_request,
- std::move(client));
+ std::move(client), traffic_annotation_);
}
void ThrottlingURLLoader::OnReceiveResponse(
@@ -261,7 +265,7 @@ void ThrottlingURLLoader::Resume() {
start_info_->url_loader_factory->CreateLoaderAndStart(
mojo::MakeRequest(&url_loader_), start_info_->routing_id,
start_info_->request_id, start_info_->options,
- *start_info_->url_request, std::move(client));
+ *start_info_->url_request, std::move(client), traffic_annotation_);
if (priority_info_) {
auto priority_info = std::move(priority_info_);
« no previous file with comments | « content/common/throttling_url_loader.h ('k') | content/common/throttling_url_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698