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

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

Issue 360233005: Replace 'ResourceRequest::TargetType' with 'ResourceRequest::RequestContext'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Uninitialized === crash. :( 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/web/WebSharedWorkerImpl.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 // FIXME: Drop the TargetType enum once embedders are updated upstream.
92 enum RequestContext {
93 RequestContextUnspecified = 0,
94 RequestContextAudio,
95 RequestContextChildDocument,
96 RequestContextConnect,
97 RequestContextDocument,
98 RequestContextDownload,
99 RequestContextFavicon,
100 RequestContextFont,
101 RequestContextForm,
102 RequestContextImage,
103 RequestContextManifest,
104 RequestContextObject,
105 RequestContextObjectRequest,
106 RequestContextPing,
107 RequestContextPrefetch,
108 RequestContextScript,
109 RequestContextServiceWorker,
110 RequestContextSharedWorker,
111 RequestContextStyle,
112 RequestContextSubresource,
113 RequestContextTextTrack,
114 RequestContextVideo,
115 RequestContextWorker
116 };
117
91 class ExtraData { 118 class ExtraData {
92 public: 119 public:
93 virtual ~ExtraData() { } 120 virtual ~ExtraData() { }
94 }; 121 };
95 122
96 ~WebURLRequest() { reset(); } 123 ~WebURLRequest() { reset(); }
97 124
98 WebURLRequest() : m_private(0) { } 125 WebURLRequest() : m_private(0) { }
99 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); } 126 WebURLRequest(const WebURLRequest& r) : m_private(0) { assign(r); }
100 WebURLRequest& operator=(const WebURLRequest& r) 127 WebURLRequest& operator=(const WebURLRequest& r)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 // Controls whether upload progress events are generated when a request 174 // Controls whether upload progress events are generated when a request
148 // has a body. 175 // has a body.
149 BLINK_PLATFORM_EXPORT bool reportUploadProgress() const; 176 BLINK_PLATFORM_EXPORT bool reportUploadProgress() const;
150 BLINK_PLATFORM_EXPORT void setReportUploadProgress(bool); 177 BLINK_PLATFORM_EXPORT void setReportUploadProgress(bool);
151 178
152 // Controls whether actual headers sent and received for request are 179 // Controls whether actual headers sent and received for request are
153 // collected and reported. 180 // collected and reported.
154 BLINK_PLATFORM_EXPORT bool reportRawHeaders() const; 181 BLINK_PLATFORM_EXPORT bool reportRawHeaders() const;
155 BLINK_PLATFORM_EXPORT void setReportRawHeaders(bool); 182 BLINK_PLATFORM_EXPORT void setReportRawHeaders(bool);
156 183
184 // FIXME: Remove these once content/ and net/ are updated.
157 BLINK_PLATFORM_EXPORT TargetType targetType() const; 185 BLINK_PLATFORM_EXPORT TargetType targetType() const;
158 BLINK_PLATFORM_EXPORT void setTargetType(TargetType); 186 BLINK_PLATFORM_EXPORT void setTargetType(TargetType);
159 187
188 BLINK_PLATFORM_EXPORT RequestContext requestContext() const;
189 BLINK_PLATFORM_EXPORT void setRequestContext(RequestContext);
190
160 BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const; 191 BLINK_PLATFORM_EXPORT WebReferrerPolicy referrerPolicy() const;
161 192
162 // Adds an HTTP origin header if it is empty and the HTTP method of the 193 // Adds an HTTP origin header if it is empty and the HTTP method of the
163 // request requires it. 194 // request requires it.
164 BLINK_PLATFORM_EXPORT void addHTTPOriginIfNeeded(const WebString& origin); 195 BLINK_PLATFORM_EXPORT void addHTTPOriginIfNeeded(const WebString& origin);
165 196
166 // True if the request was user initiated. 197 // True if the request was user initiated.
167 BLINK_PLATFORM_EXPORT bool hasUserGesture() const; 198 BLINK_PLATFORM_EXPORT bool hasUserGesture() const;
168 BLINK_PLATFORM_EXPORT void setHasUserGesture(bool); 199 BLINK_PLATFORM_EXPORT void setHasUserGesture(bool);
169 200
(...skipping 26 matching lines...) Expand all
196 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); 227 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
197 228
198 BLINK_PLATFORM_EXPORT Priority priority() const; 229 BLINK_PLATFORM_EXPORT Priority priority() const;
199 BLINK_PLATFORM_EXPORT void setPriority(Priority); 230 BLINK_PLATFORM_EXPORT void setPriority(Priority);
200 231
201 #if INSIDE_BLINK 232 #if INSIDE_BLINK
202 BLINK_PLATFORM_EXPORT WebCore::ResourceRequest& toMutableResourceRequest(); 233 BLINK_PLATFORM_EXPORT WebCore::ResourceRequest& toMutableResourceRequest();
203 BLINK_PLATFORM_EXPORT const WebCore::ResourceRequest& toResourceRequest() co nst; 234 BLINK_PLATFORM_EXPORT const WebCore::ResourceRequest& toResourceRequest() co nst;
204 #endif 235 #endif
205 236
237 // FIXME: Drop these once we replace TargetType upstream.
238 static RequestContext requestContextFromTargetType(TargetType);
239 static TargetType targetTypeFromRequestContext(RequestContext);
206 protected: 240 protected:
207 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); 241 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*);
208 242
209 private: 243 private:
210 WebURLRequestPrivate* m_private; 244 WebURLRequestPrivate* m_private;
211 }; 245 };
212 246
213 } // namespace blink 247 } // namespace blink
214 248
215 #endif 249 #endif
OLDNEW
« no previous file with comments | « Source/web/WebSharedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698