193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)/*
293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Copyright (C) 2009 Google Inc. All rights reserved.
393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * Redistribution and use in source and binary forms, with or without
593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * modification, are permitted provided that the following conditions are
693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * met:
793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Redistributions of source code must retain the above copyright
993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * notice, this list of conditions and the following disclaimer.
1093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Redistributions in binary form must reproduce the above
1193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * copyright notice, this list of conditions and the following disclaimer
1293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * in the documentation and/or other materials provided with the
1393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * distribution.
1493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *     * Neither the name of Google Inc. nor the names of its
1593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * contributors may be used to endorse or promote products derived from
1693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * this software without specific prior written permission.
1793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) *
1893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
2093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
2193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles) */
3093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#ifndef WebURLRequest_h
3293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#define WebURLRequest_h
3393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "WebCommon.h"
3593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#include "WebHTTPBody.h"
3609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)#include "WebReferrerPolicy.h"
3793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
3851b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
3993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
40e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)class ResourceRequest;
4193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebCString;
4293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebHTTPBody;
4393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebHTTPHeaderVisitor;
4493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebString;
4593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebURL;
4693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebURLRequestPrivate;
4793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
4893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)class WebURLRequest {
4993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)public:
5093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    enum CachePolicy {
5193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        UseProtocolCachePolicy, // normal load
5293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        ReloadIgnoringCacheData, // reload
5393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        ReturnCacheDataElseLoad, // back/forward or encoding change - allow stale data
5493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        ReturnCacheDataDontLoad, // results of a post - allow stale data and only use cache
55f6b7aed3f7ce69aca0d7a032d144cbd088b04393Torne (Richard Coles)        ReloadBypassingCache, // end-to-end reload
5693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    };
5793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
5893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    enum Priority {
5993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        PriorityUnresolved = -1,
6093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        PriorityVeryLow,
6193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        PriorityLow,
6293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        PriorityMedium,
6393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        PriorityHigh,
6493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        PriorityVeryHigh,
6593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    };
6693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
67197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    // Corresponds to Fetch's "context": http://fetch.spec.whatwg.org/#concept-request-context
68197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    enum RequestContext {
69197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextUnspecified = 0,
70197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextAudio,
71197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextBeacon,
72197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextCSPReport,
73197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextDownload,
74197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextEmbed,
75197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextEventSource,
76197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextFavicon,
77197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextFetch,
78197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextFont,
79197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextForm,
80197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextFrame,
81197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextHyperlink,
82197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextIframe,
83197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextImage,
84c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)        RequestContextImageSet,
85c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)        RequestContextImport,
86c1847b1379d12d0e05df27436bf19a9b1bf12deaTorne (Richard Coles)        RequestContextInternal,
87197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextLocation,
88197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextManifest,
89197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextObject,
90197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextPing,
91197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextPlugin,
92197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextPrefetch,
93197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextScript,
94197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextServiceWorker,
95197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextSharedWorker,
96197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextSubresource,
97197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextStyle,
98197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextTrack,
99197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextVideo,
100197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextWorker,
101197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextXMLHttpRequest,
102197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        RequestContextXSLT
103197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    };
104197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
105197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    // Corresponds to Fetch's "context frame type": http://fetch.spec.whatwg.org/#concept-request-context-frame-type
106197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    enum FrameType {
107197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        FrameTypeAuxiliary,
108197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        FrameTypeNested,
109197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        FrameTypeNone,
110197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch        FrameTypeTopLevel
111197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    };
112197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
11393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    class ExtraData {
11493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    public:
11593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        virtual ~ExtraData() { }
11693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    };
11793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
11893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    ~WebURLRequest() { reset(); }
11993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
12093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    WebURLRequest() : m_private(0) { }
12193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); }
12293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    WebURLRequest& operator=(const WebURLRequest& r)
12393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    {
12493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        assign(r);
12593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        return *this;
12693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    }
12793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
12893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    explicit WebURLRequest(const WebURL& url) : m_private(0)
12993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    {
13093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        initialize();
13193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)        setURL(url);
13293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    }
13393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
134bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void initialize();
135bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void reset();
136bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void assign(const WebURLRequest&);
13793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
138bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT bool isNull() const;
13993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
140bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT WebURL url() const;
141bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setURL(const WebURL&);
14293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
14393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // Used to implement third-party cookie blocking.
144bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT WebURL firstPartyForCookies() const;
145bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setFirstPartyForCookies(const WebURL&);
14693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
14793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // Controls whether user name, password, and cookies may be sent with the
14893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // request. (If false, this overrides allowCookies.)
149bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT bool allowStoredCredentials() const;
150bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setAllowStoredCredentials(bool);
15193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
152bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT CachePolicy cachePolicy() const;
153bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setCachePolicy(CachePolicy);
15493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
155bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT WebString httpMethod() const;
156bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setHTTPMethod(const WebString&);
15793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
158bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT WebString httpHeaderField(const WebString& name) const;
15909380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    // It's not possible to set the referrer header using this method. Use setHTTPReferrer instead.
160bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setHTTPHeaderField(const WebString& name, const WebString& value);
16109380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setHTTPReferrer(const WebString& referrer, WebReferrerPolicy);
162bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void addHTTPHeaderField(const WebString& name, const WebString& value);
163bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void clearHTTPHeaderField(const WebString& name);
164bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void visitHTTPHeaderFields(WebHTTPHeaderVisitor*) const;
16593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
166bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT WebHTTPBody httpBody() const;
167bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setHTTPBody(const WebHTTPBody&);
16893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
16993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // Controls whether upload progress events are generated when a request
17093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // has a body.
171bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT bool reportUploadProgress() const;
172bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setReportUploadProgress(bool);
17393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
17493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // Controls whether actual headers sent and received for request are
17593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // collected and reported.
176bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT bool reportRawHeaders() const;
177bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setReportRawHeaders(bool);
17893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
179197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    BLINK_PLATFORM_EXPORT RequestContext requestContext() const;
180197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    BLINK_PLATFORM_EXPORT void setRequestContext(RequestContext);
181197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
182197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    BLINK_PLATFORM_EXPORT FrameType frameType() const;
183197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    BLINK_PLATFORM_EXPORT void setFrameType(FrameType);
184197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
18509380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)    BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const;
18609380295ba73501a205346becac22c6978e4671dTorne (Richard Coles)
187197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    // Adds an HTTP origin header if it is empty and the HTTP method of the
188197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    // request requires it.
189197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch    BLINK_PLATFORM_EXPORT void addHTTPOriginIfNeeded(const WebString& origin);
190197021e6b966cfb06891637935ef33fff06433d1Ben Murdoch
19193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // True if the request was user initiated.
192bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT bool hasUserGesture() const;
193bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setHasUserGesture(bool);
19493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
19593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // A consumer controlled value intended to be used to identify the
19693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // requestor.
197bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT int requestorID() const;
198bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setRequestorID(int);
19993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
20093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // A consumer controlled value intended to be used to identify the
20193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // process of the requestor.
202bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT int requestorProcessID() const;
203bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setRequestorProcessID(int);
20493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
20593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // Allows the request to be matched up with its app cache host.
206bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT int appCacheHostID() const;
207bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setAppCacheHostID(int);
20893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
20993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // If true, the response body will be downloaded to a file managed by the
21093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // WebURLLoader. See WebURLResponse::downloadedFilePath.
211bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT bool downloadToFile() const;
212bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setDownloadToFile(bool);
21393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
2147242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    // True if the request should not be handled by the ServiceWorker.
2157242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT bool skipServiceWorker() const;
2167242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci    BLINK_PLATFORM_EXPORT void setSkipServiceWorker(bool);
2177242dc3dbeb210b5e876a3c42d1ec1a667fc621aPrimiano Tucci
21893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // Extra data associated with the underlying resource request. Resource
21993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // requests can be copied. If non-null, each copy of a resource requests
22093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // holds a pointer to the extra data, and the extra data pointer will be
22193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // deleted when the last resource request is destroyed. Setting the extra
22293ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // data pointer will cause the underlying resource request to be
22393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    // dissociated from any existing non-null extra data pointer.
224bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT ExtraData* extraData() const;
225bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
22693ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
227bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT Priority priority() const;
2285d92fedcae5e801a8b224de090094f2d9df0b54aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void setPriority(Priority);
22993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
230bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)#if INSIDE_BLINK
231e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest();
232e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)    BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const;
23393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#endif
23493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
23593ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)protected:
236bfe3590b1806e3ff18f46ee3af5d4b83078f305aTorne (Richard Coles)    BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*);
23793ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
23893ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)private:
23993ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)    WebURLRequestPrivate* m_private;
24093ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)};
24193ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
24251b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
24393ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)
24493ac45cfc74041c8ae536ce58a9534d46db2024eTorne (Richard Coles)#endif
245