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

Unified Diff: net/url_request/url_fetcher.h

Issue 2421333002: Protobuf for Traffic Annotation and first use by a URLFetcher. (Closed)
Patch Set: More comments added. Created 3 years, 10 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 | « net/traffic_annotation/network_traffic_annotation_test_helper.h ('k') | net/url_request/url_fetcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..eb4663db76386afab836aed991c359d8125e4049 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.
+ // This function should not be used in Chromium, please use the version with
+ // NetworkTrafficAnnotationTag below instead.
static std::unique_ptr<URLFetcher> Create(
const GURL& url,
URLFetcher::RequestType request_type,
@@ -113,12 +116,41 @@ 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.
+ // This function should not be used in Chromium, 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. Note that:
+ // - net provides the API for tagging requests with an opaque identifier.
+ // - tools/traffic_annotation/traffic_annotation.proto contains the Chrome
+ // specific .proto describing the verbose annotation format that Chrome's
+ // callsites are expected to follow.
+ // - tools/traffic_annotation/ contains sample and template for annotation and
+ // tools will be added for verification following crbug.com/690323.
+ 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
« no previous file with comments | « net/traffic_annotation/network_traffic_annotation_test_helper.h ('k') | net/url_request/url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698