Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / content / child / request_info.h
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.
4
5 #ifndef CONTENT_CHILD_REQUEST_INFO_H_
6 #define CONTENT_CHILD_REQUEST_INFO_H_
7
8 #include <stdint.h>
9
10 #include <string>
11
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"
21
22 namespace content {
23
24 // Structure used when calling BlinkPlatformImpl::CreateResourceLoader().
25 struct CONTENT_EXPORT RequestInfo {
26   RequestInfo();
27   ~RequestInfo();
28
29   // HTTP-style method name (e.g., "GET" or "POST").
30   std::string method;
31
32   // Absolute URL encoded in ASCII per the rules of RFC-2396.
33   GURL url;
34
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;
38
39   // Optional parameter, a URL with similar constraints in how it must be
40   // encoded as the url member.
41   GURL referrer;
42
43   // The referrer policy that applies to the referrer.
44   blink::WebReferrerPolicy referrer_policy;
45
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;
51
52   // Composed of the values defined in url_request_load_flags.h.
53   int load_flags;
54
55   // Process id of the process making the request.
56   int requestor_pid;
57
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;
63
64   // Indicates the priority of this request, as determined by WebKit.
65   net::RequestPriority priority;
66
67   // Used for plugin to browser requests.
68   uint32_t request_context;
69
70   // Identifies what appcache host this request is associated with.
71   int appcache_host_id;
72
73   // Used to associated the bridge with a frame's network context.
74   int routing_id;
75
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;
79
80   // True if the request was user initiated.
81   bool has_user_gesture;
82
83   // True if the request should not be handled by the ServiceWorker.
84   bool skip_service_worker;
85
86   // The request mode passed to the ServiceWorker.
87   FetchRequestMode fetch_request_mode;
88
89   // The credentials mode passed to the ServiceWorker.
90   FetchCredentialsMode fetch_credentials_mode;
91
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;
95
96   // True if upload progress should be available.
97   bool enable_upload_progress;
98
99   // Extra data associated with this request.  We do not own this pointer.
100   blink::WebURLRequest::ExtraData* extra_data;
101
102  private:
103   DISALLOW_COPY_AND_ASSIGN(RequestInfo);
104 };
105
106 }  // namespace content
107
108 #endif  // CONTENT_CHILD_REQUEST_INFO_H_