Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(407)

Side by Side Diff: public/platform/WebURLRequest.h

Issue 389993002: Teach WebURLRequest about Fetch's "frame type" concept. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Missed one. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/network/ResourceRequest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 TargetIsSharedWorker = 10, 81 TargetIsSharedWorker = 10,
82 TargetIsPrefetch = 11, 82 TargetIsPrefetch = 11,
83 TargetIsFavicon = 12, 83 TargetIsFavicon = 12,
84 TargetIsXHR = 13, 84 TargetIsXHR = 13,
85 TargetIsTextTrack = 14, 85 TargetIsTextTrack = 14,
86 TargetIsPing = 15, 86 TargetIsPing = 15,
87 TargetIsServiceWorker = 16, 87 TargetIsServiceWorker = 16,
88 TargetIsUnspecified = 17, 88 TargetIsUnspecified = 17,
89 }; 89 };
90 90
91 // Corresponds to Fetch's "context": http://fetch.spec.whatwg.org/#concept-r equest-context
92 //
91 // FIXME: Drop the TargetType enum once embedders are updated upstream. 93 // FIXME: Drop the TargetType enum once embedders are updated upstream.
92 enum RequestContext { 94 enum RequestContext {
93 RequestContextUnspecified = 0, 95 RequestContextUnspecified = 0,
94 RequestContextInternal, // FIXME: This isn't part of Fetch. It should be . 96 RequestContextInternal, // FIXME: This isn't part of Fetch. It should be .
95 RequestContextAudio, 97 RequestContextAudio,
96 RequestContextBeacon, 98 RequestContextBeacon,
97 RequestContextCSPReport, 99 RequestContextCSPReport,
98 RequestContextDownload, 100 RequestContextDownload,
99 RequestContextEmbed, 101 RequestContextEmbed,
100 RequestContextEventSource, 102 RequestContextEventSource,
(...skipping 16 matching lines...) Expand all
117 RequestContextSharedWorker, 119 RequestContextSharedWorker,
118 RequestContextSubresource, 120 RequestContextSubresource,
119 RequestContextStyle, 121 RequestContextStyle,
120 RequestContextTrack, 122 RequestContextTrack,
121 RequestContextVideo, 123 RequestContextVideo,
122 RequestContextWorker, 124 RequestContextWorker,
123 RequestContextXMLHttpRequest, 125 RequestContextXMLHttpRequest,
124 RequestContextXSLT 126 RequestContextXSLT
125 }; 127 };
126 128
129 // Corresponds to Fetch's "context frame type": http://fetch.spec.whatwg.org /#concept-request-context-frame-type
130 enum FrameType {
131 FrameTypeAuxiliary,
132 FrameTypeNested,
133 FrameTypeNone,
134 FrameTypeTopLevel
135 };
136
127 class ExtraData { 137 class ExtraData {
128 public: 138 public:
129 virtual ~ExtraData() { } 139 virtual ~ExtraData() { }
130 }; 140 };
131 141
132 ~WebURLRequest() { reset(); } 142 ~WebURLRequest() { reset(); }
133 143
134 WebURLRequest() : m_private(0) { } 144 WebURLRequest() : m_private(0) { }
135 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } 145 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); }
136 WebURLRequest& operator=(const WebURLRequest& r) 146 WebURLRequest& operator=(const WebURLRequest& r)
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 BLINK_PLATFORM_EXPORT bool reportRawHeaders() const; 200 BLINK_PLATFORM_EXPORT bool reportRawHeaders() const;
191 BLINK_PLATFORM_EXPORT void setReportRawHeaders(bool); 201 BLINK_PLATFORM_EXPORT void setReportRawHeaders(bool);
192 202
193 // FIXME: Remove these once content/ and net/ are updated. 203 // FIXME: Remove these once content/ and net/ are updated.
194 BLINK_PLATFORM_EXPORT TargetType targetType() const; 204 BLINK_PLATFORM_EXPORT TargetType targetType() const;
195 BLINK_PLATFORM_EXPORT void setTargetType(TargetType); 205 BLINK_PLATFORM_EXPORT void setTargetType(TargetType);
196 206
197 BLINK_PLATFORM_EXPORT RequestContext requestContext() const; 207 BLINK_PLATFORM_EXPORT RequestContext requestContext() const;
198 BLINK_PLATFORM_EXPORT void setRequestContext(RequestContext); 208 BLINK_PLATFORM_EXPORT void setRequestContext(RequestContext);
199 209
210 BLINK_PLATFORM_EXPORT FrameType frameType() const;
211 BLINK_PLATFORM_EXPORT void setFrameType(FrameType);
212
200 BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const; 213 BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const;
201 214
202 // Adds an HTTP origin header if it is empty and the HTTP method of the 215 // Adds an HTTP origin header if it is empty and the HTTP method of the
203 // request requires it. 216 // request requires it.
204 BLINK_PLATFORM_EXPORT void addHTTPOriginIfNeeded(const WebString& origin); 217 BLINK_PLATFORM_EXPORT void addHTTPOriginIfNeeded(const WebString& origin);
205 218
206 // True if the request was user initiated. 219 // True if the request was user initiated.
207 BLINK_PLATFORM_EXPORT bool hasUserGesture() const; 220 BLINK_PLATFORM_EXPORT bool hasUserGesture() const;
208 BLINK_PLATFORM_EXPORT void setHasUserGesture(bool); 221 BLINK_PLATFORM_EXPORT void setHasUserGesture(bool);
209 222
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 protected: 262 protected:
250 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); 263 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*);
251 264
252 private: 265 private:
253 WebURLRequestPrivate* m_private; 266 WebURLRequestPrivate* m_private;
254 }; 267 };
255 268
256 } // namespace blink 269 } // namespace blink
257 270
258 #endif 271 #endif
OLDNEW
« no previous file with comments | « Source/platform/network/ResourceRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698