Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / child / request_info.h
blobe610ac8917554029957dc123b36c938033908f7b
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_CHILD_REQUEST_INFO_H_
6 #define CONTENT_CHILD_REQUEST_INFO_H_
8 #include <stdint.h>
10 #include <string>
12 #include "content/common/content_export.h"
13 #include "content/common/service_worker/service_worker_types.h"
14 #include "content/public/common/referrer.h"
15 #include "content/public/common/request_context_frame_type.h"
16 #include "content/public/common/request_context_type.h"
17 #include "content/public/common/resource_type.h"
18 #include "net/base/request_priority.h"
19 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
20 #include "third_party/WebKit/public/platform/WebURLRequest.h"
21 #include "url/gurl.h"
23 namespace content {
25 // Structure used when calling BlinkPlatformImpl::CreateResourceLoader().
26 struct CONTENT_EXPORT RequestInfo {
27 RequestInfo();
28 ~RequestInfo();
30 // HTTP-style method name (e.g., "GET" or "POST").
31 std::string method;
33 // Absolute URL encoded in ASCII per the rules of RFC-2396.
34 GURL url;
36 // URL of the document in the top-level window, which may be checked by the
37 // third-party cookie blocking policy.
38 GURL first_party_for_cookies;
40 // Optional parameter, the referrer to use for the request for the url member.
41 Referrer referrer;
43 // For HTTP(S) requests, the headers parameter can be a \r\n-delimited and
44 // \r\n-terminated list of MIME headers. They should be ASCII-encoded using
45 // the standard MIME header encoding rules. The headers parameter can also
46 // be null if no extra request headers need to be set.
47 std::string headers;
49 // Composed of the values defined in url_request_load_flags.h.
50 int load_flags;
52 // Process id of the process making the request.
53 int requestor_pid;
55 // Indicates if the current request is the main frame load, a sub-frame
56 // load, or a sub objects load.
57 ResourceType request_type;
58 RequestContextType fetch_request_context_type;
59 RequestContextFrameType fetch_frame_type;
61 // Indicates the priority of this request, as determined by WebKit.
62 net::RequestPriority priority;
64 // Used for plugin to browser requests.
65 uint32_t request_context;
67 // Identifies what appcache host this request is associated with.
68 int appcache_host_id;
70 // Used to associated the bridge with a frame's network context.
71 int routing_id;
73 // If true, then the response body will be downloaded to a file and the
74 // path to that file will be provided in ResponseInfo::download_file_path.
75 bool download_to_file;
77 // True if the request was user initiated.
78 bool has_user_gesture;
80 // True if the request should not be handled by the ServiceWorker.
81 bool skip_service_worker;
83 // True if corresponding AppCache group should be resetted.
84 bool should_reset_appcache;
86 // The request mode passed to the ServiceWorker.
87 FetchRequestMode fetch_request_mode;
89 // The credentials mode passed to the ServiceWorker.
90 FetchCredentialsMode fetch_credentials_mode;
92 // The redirect mode used in Fetch API.
93 FetchRedirectMode fetch_redirect_mode;
95 // TODO(mmenke): Investigate if enable_load_timing is safe to remove.
96 // True if load timing data should be collected for the request.
97 bool enable_load_timing;
99 // True if upload progress should be available.
100 bool enable_upload_progress;
102 // True if login prompts for this request should be supressed. Cached
103 // credentials or default credentials may still be used for authentication.
104 bool do_not_prompt_for_login;
106 // True if the actual headers from the network stack should be reported
107 // to the renderer
108 bool report_raw_headers;
110 // Extra data associated with this request. We do not own this pointer.
111 blink::WebURLRequest::ExtraData* extra_data;
113 private:
114 DISALLOW_COPY_AND_ASSIGN(RequestInfo);
117 } // namespace content
119 #endif // CONTENT_CHILD_REQUEST_INFO_H_