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

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

Issue 1749153002: CORS-RFC1918: Teach ResourceRequest about "external" requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Jochen's feedback. Created 4 years, 9 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
« no previous file with comments | « third_party/WebKit/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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 enum Priority { 58 enum Priority {
59 PriorityUnresolved = -1, 59 PriorityUnresolved = -1,
60 PriorityVeryLow, 60 PriorityVeryLow,
61 PriorityLow, 61 PriorityLow,
62 PriorityMedium, 62 PriorityMedium,
63 PriorityHigh, 63 PriorityHigh,
64 PriorityVeryHigh, 64 PriorityVeryHigh,
65 }; 65 };
66 66
67 // The ordering is important, as it's used to determine whether preflights a re required,
68 // as per https://mikewest.github.io/cors-rfc1918/#framework
69 enum AddressSpace {
70 AddressSpaceLocal = 0, // loopback, link local
71 AddressSpacePrivate, // Reserved by RFC1918
72 AddressSpacePublic // Everything else
73 };
74
67 // Corresponds to Fetch's "context": http://fetch.spec.whatwg.org/#concept-r equest-context 75 // Corresponds to Fetch's "context": http://fetch.spec.whatwg.org/#concept-r equest-context
68 enum RequestContext { 76 enum RequestContext {
69 RequestContextUnspecified = 0, 77 RequestContextUnspecified = 0,
70 RequestContextAudio, 78 RequestContextAudio,
71 RequestContextBeacon, 79 RequestContextBeacon,
72 RequestContextCSPReport, 80 RequestContextCSPReport,
73 RequestContextDownload, 81 RequestContextDownload,
74 RequestContextEmbed, 82 RequestContextEmbed,
75 RequestContextEventSource, 83 RequestContextEventSource,
76 RequestContextFavicon, 84 RequestContextFavicon,
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 BLINK_PLATFORM_EXPORT void setCheckForBrowserSideNavigation(bool); 308 BLINK_PLATFORM_EXPORT void setCheckForBrowserSideNavigation(bool);
301 309
302 // This is used to report navigation metrics starting from the UI action 310 // This is used to report navigation metrics starting from the UI action
303 // that triggered the navigation (which can be different from the navigation 311 // that triggered the navigation (which can be different from the navigation
304 // start time used in the Navigation Timing API). 312 // start time used in the Navigation Timing API).
305 BLINK_PLATFORM_EXPORT double uiStartTime() const; 313 BLINK_PLATFORM_EXPORT double uiStartTime() const;
306 BLINK_PLATFORM_EXPORT void setUiStartTime(double); 314 BLINK_PLATFORM_EXPORT void setUiStartTime(double);
307 BLINK_PLATFORM_EXPORT WebURLRequest::InputToLoadPerfMetricReportPolicy input PerfMetricReportPolicy() const; 315 BLINK_PLATFORM_EXPORT WebURLRequest::InputToLoadPerfMetricReportPolicy input PerfMetricReportPolicy() const;
308 BLINK_PLATFORM_EXPORT void setInputPerfMetricReportPolicy(WebURLRequest::Inp utToLoadPerfMetricReportPolicy); 316 BLINK_PLATFORM_EXPORT void setInputPerfMetricReportPolicy(WebURLRequest::Inp utToLoadPerfMetricReportPolicy);
309 317
310 // Does the request originate from a SecurityContext hosted in a reserved 318 // https://mikewest.github.io/cors-rfc1918/#external-request
311 // (RFC1918) IP range? 319 BLINK_PLATFORM_EXPORT bool isExternalRequest() const;
312 BLINK_PLATFORM_EXPORT bool originatesFromReservedIPRange() const;
313 BLINK_PLATFORM_EXPORT void setOriginatesFromReservedIPRange(bool);
314 320
315 #if INSIDE_BLINK 321 #if INSIDE_BLINK
316 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest(); 322 BLINK_PLATFORM_EXPORT ResourceRequest& toMutableResourceRequest();
317 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const; 323 BLINK_PLATFORM_EXPORT const ResourceRequest& toResourceRequest() const;
318 #endif 324 #endif
319 325
320 protected: 326 protected:
321 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*); 327 BLINK_PLATFORM_EXPORT void assign(WebURLRequestPrivate*);
322 328
323 private: 329 private:
324 WebURLRequestPrivate* m_private; 330 WebURLRequestPrivate* m_private;
325 }; 331 };
326 332
327 } // namespace blink 333 } // namespace blink
328 334
329 #endif 335 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/network/ResourceRequest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698