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

Unified Diff: net/url_request/url_fetcher.h

Issue 2421333002: Protobuf for Traffic Annotation and first use by a URLFetcher. (Closed)
Patch Set: All comments addressed. Created 3 years, 11 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: net/url_request/url_fetcher.h
diff --git a/net/url_request/url_fetcher.h b/net/url_request/url_fetcher.h
index 7ac195432c74860c36c0abacb493ce7149c1e68f..64bd2a29ed7af50cef17b8e4c0d8477653a73957 100644
--- a/net/url_request/url_fetcher.h
+++ b/net/url_request/url_fetcher.h
@@ -15,6 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/supports_user_data.h"
#include "net/base/net_export.h"
+#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/url_request/url_request.h"
class GURL;
@@ -105,6 +106,8 @@ class NET_EXPORT URLFetcher {
// |url| is the URL to send the request to. It must be valid.
// |request_type| is the type of request to make.
// |d| the object that will receive the callback on fetch completion.
+ // DEPRECATED: Please use the version with NetworkTrafficAnnotationTag
+ // below instead.
static std::unique_ptr<URLFetcher> Create(
const GURL& url,
URLFetcher::RequestType request_type,
@@ -113,12 +116,35 @@ class NET_EXPORT URLFetcher {
// Like above, but if there's a URLFetcherFactory registered with the
// implementation it will be used. |id| may be used during testing to identify
// who is creating the URLFetcher.
+ // DEPRECATED: Please use the version with NetworkTrafficAnnotationTag
+ // below instead.
static std::unique_ptr<URLFetcher> Create(
int id,
const GURL& url,
URLFetcher::RequestType request_type,
URLFetcherDelegate* d);
+ // |url| is the URL to send the request to. It must be valid.
+ // |request_type| is the type of request to make.
+ // |d| the object that will receive the callback on fetch completion.
+ // |traffic_annotation| metadata about the network traffic send via this
+ // URLFetcher. See net::DefineNetworkTrafficAnnotation.
+ static std::unique_ptr<URLFetcher> Create(
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d,
+ NetworkTrafficAnnotationTag traffic_annotation);
+
+ // Like above, but if there's a URLFetcherFactory registered with the
+ // implementation it will be used. |id| may be used during testing to identify
+ // who is creating the URLFetcher.
+ static std::unique_ptr<URLFetcher> Create(
+ int id,
+ const GURL& url,
+ URLFetcher::RequestType request_type,
+ URLFetcherDelegate* d,
+ NetworkTrafficAnnotationTag traffic_annotation);
+
// Cancels all existing URLFetchers. Will notify the URLFetcherDelegates.
// Note that any new URLFetchers created while this is running will not be
// cancelled. Typically, one would call this in the CleanUp() method of an IO

Powered by Google App Engine
This is Rietveld 408576698