Fix some nits from the two previous plugin power saver CLs.
[chromium-blink-merge.git] / content / child / request_info.h
blob7255244a45be3a86c00f0f859c405ff4c8143563
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/request_context_frame_type.h"
15 #include "content/public/common/request_context_type.h"
16 #include "content/public/common/resource_type.h"
17 #include "net/base/request_priority.h"
18 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
19 #include "third_party/WebKit/public/platform/WebURLRequest.h"
20 #include "url/gurl.h"
22 namespace content {
24 // Structure used when calling BlinkPlatformImpl::CreateResourceLoader().
25 struct CONTENT_EXPORT RequestInfo {
26 RequestInfo();
27 ~RequestInfo();
29 // HTTP-style method name (e.g., "GET" or "POST").
30 std::string method;
32 // Absolute URL encoded in ASCII per the rules of RFC-2396.
33 GURL url;
35 // URL of the document in the top-level window, which may be checked by the
36 // third-party cookie blocking policy.
37 GURL first_party_for_cookies;
39 // Optional parameter, a URL with similar constraints in how it must be
40 // encoded as the url member.
41 GURL referrer;
43 // The referrer policy that applies to the referrer.
44 blink::WebReferrerPolicy referrer_policy;
46 // For HTTP(S) requests, the headers parameter can be a \r\n-delimited and
47 // \r\n-terminated list of MIME headers. They should be ASCII-encoded using
48 // the standard MIME header encoding rules. The headers parameter can also
49 // be null if no extra request headers need to be set.
50 std::string headers;
52 // Composed of the values defined in url_request_load_flags.h.
53 int load_flags;
55 // Process id of the process making the request.
56 int requestor_pid;
58 // Indicates if the current request is the main frame load, a sub-frame
59 // load, or a sub objects load.
60 ResourceType request_type;
61 RequestContextType fetch_request_context_type;
62 RequestContextFrameType fetch_frame_type;
64 // Indicates the priority of this request, as determined by WebKit.
65 net::RequestPriority priority;
67 // Used for plugin to browser requests.
68 uint32_t request_context;
70 // Identifies what appcache host this request is associated with.
71 int appcache_host_id;
73 // Used to associated the bridge with a frame's network context.
74 int routing_id;
76 // If true, then the response body will be downloaded to a file and the
77 // path to that file will be provided in ResponseInfo::download_file_path.
78 bool download_to_file;
80 // True if the request was user initiated.
81 bool has_user_gesture;
83 // True if the request should not be handled by the ServiceWorker.
84 bool skip_service_worker;
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 // Extra data associated with this request. We do not own this pointer.
97 blink::WebURLRequest::ExtraData* extra_data;
99 private:
100 DISALLOW_COPY_AND_ASSIGN(RequestInfo);
103 } // namespace content
105 #endif // CONTENT_CHILD_REQUEST_INFO_H_