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_
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"
25 // Structure used when calling BlinkPlatformImpl::CreateResourceLoader().
26 struct CONTENT_EXPORT RequestInfo
{
30 // HTTP-style method name (e.g., "GET" or "POST").
33 // Absolute URL encoded in ASCII per the rules of RFC-2396.
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.
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.
49 // Composed of the values defined in url_request_load_flags.h.
52 // Process id of the process making the request.
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.
70 // Used to associated the bridge with a frame's network context.
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 // TODO(mmenke): Investigate if enable_load_timing is safe to remove.
93 // True if load timing data should be collected for the request.
94 bool enable_load_timing
;
96 // True if upload progress should be available.
97 bool enable_upload_progress
;
99 // Extra data associated with this request. We do not own this pointer.
100 blink::WebURLRequest::ExtraData
* extra_data
;
103 DISALLOW_COPY_AND_ASSIGN(RequestInfo
);
106 } // namespace content
108 #endif // CONTENT_CHILD_REQUEST_INFO_H_