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

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

Issue 2484633004: Change Lo-Fi bool to bitmask to support multiple Previews types (Closed)
Patch Set: use PreviewsState everywhere Created 4 years 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
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 129
130 // Used to report performance metrics timed from the UI action that 130 // Used to report performance metrics timed from the UI action that
131 // triggered them (as opposed to navigation start time used in the 131 // triggered them (as opposed to navigation start time used in the
132 // Navigation Timing API). 132 // Navigation Timing API).
133 enum InputToLoadPerfMetricReportPolicy { 133 enum InputToLoadPerfMetricReportPolicy {
134 NoReport, // Don't report metrics for this WebURLRequest. 134 NoReport, // Don't report metrics for this WebURLRequest.
135 ReportLink, // Report metrics with UI action link clicked. 135 ReportLink, // Report metrics with UI action link clicked.
136 ReportIntent, // Report metrics with UI action displayed intent. 136 ReportIntent, // Report metrics with UI action displayed intent.
137 }; 137 };
138 138
139 // The LoFi state which determines whether to request a Lo-Fi version of the 139 // The Previews state which determines whether to request a Preview version of
140 // resource. 140 // the resource.
141 enum LoFiState { 141 enum PreviewsState {
142 LoFiUnspecified, // Let the browser process decide whether or not to 142 PreviewsUnspecified = 0, // Let the browser process decide whether or
143 // request the Lo-Fi version. 143 // not to request Preview types.
144 LoFiOff, // Request a normal (non-Lo-Fi) version of the resource. 144 ServerLoFiOn = 1 << 0, // Request a Lo-Fi version of the resource
145 LoFiOn, // Request a Lo-Fi version of the resource. 145 // from the server.
146 ClientLoFiOn = 1 << 1, // Request a Lo-Fi version of the resource
147 // from the client.
148 PreviewsOff = 1 << 2 // Request a normal (non-Preview) version of
nasko 2016/12/12 23:05:41 Can we add static checks to ensure the two enums d
megjablon 2016/12/13 03:03:14 Excellent idea. I added this to render_frame_impl.
149 // the resource.
146 }; 150 };
147 151
148 // Indicates which types of ServiceWorkers should skip handling this request. 152 // Indicates which types of ServiceWorkers should skip handling this request.
149 enum class SkipServiceWorker { 153 enum class SkipServiceWorker {
150 // Request can be handled both by a controlling same-origin worker and 154 // Request can be handled both by a controlling same-origin worker and
151 // a cross-origin foreign fetch service worker. 155 // a cross-origin foreign fetch service worker.
152 None, 156 None,
153 // Request should not be handled by a same-origin controlling worker, 157 // Request should not be handled by a same-origin controlling worker,
154 // but can be intercepted by a foreign fetch service worker. 158 // but can be intercepted by a foreign fetch service worker.
155 Controlling, 159 Controlling,
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 BLINK_PLATFORM_EXPORT void setFetchRequestMode(FetchRequestMode); 282 BLINK_PLATFORM_EXPORT void setFetchRequestMode(FetchRequestMode);
279 283
280 // The credentials mode which will be passed to the ServiceWorker. 284 // The credentials mode which will be passed to the ServiceWorker.
281 BLINK_PLATFORM_EXPORT FetchCredentialsMode getFetchCredentialsMode() const; 285 BLINK_PLATFORM_EXPORT FetchCredentialsMode getFetchCredentialsMode() const;
282 BLINK_PLATFORM_EXPORT void setFetchCredentialsMode(FetchCredentialsMode); 286 BLINK_PLATFORM_EXPORT void setFetchCredentialsMode(FetchCredentialsMode);
283 287
284 // The redirect mode which is used in Fetch API. 288 // The redirect mode which is used in Fetch API.
285 BLINK_PLATFORM_EXPORT FetchRedirectMode getFetchRedirectMode() const; 289 BLINK_PLATFORM_EXPORT FetchRedirectMode getFetchRedirectMode() const;
286 BLINK_PLATFORM_EXPORT void setFetchRedirectMode(FetchRedirectMode); 290 BLINK_PLATFORM_EXPORT void setFetchRedirectMode(FetchRedirectMode);
287 291
288 // The LoFi state which determines whether to request a Lo-Fi version of the 292 // The Previews state which determines whether to request a Preview version of
289 // resource. 293 // the resource.
290 BLINK_PLATFORM_EXPORT LoFiState getLoFiState() const; 294 BLINK_PLATFORM_EXPORT PreviewsState getPreviewsState() const;
291 BLINK_PLATFORM_EXPORT void setLoFiState(LoFiState); 295 BLINK_PLATFORM_EXPORT void setPreviewsState(PreviewsState);
292 296
293 // Extra data associated with the underlying resource request. Resource 297 // Extra data associated with the underlying resource request. Resource
294 // requests can be copied. If non-null, each copy of a resource requests 298 // requests can be copied. If non-null, each copy of a resource requests
295 // holds a pointer to the extra data, and the extra data pointer will be 299 // holds a pointer to the extra data, and the extra data pointer will be
296 // deleted when the last resource request is destroyed. Setting the extra 300 // deleted when the last resource request is destroyed. Setting the extra
297 // data pointer will cause the underlying resource request to be 301 // data pointer will cause the underlying resource request to be
298 // dissociated from any existing non-null extra data pointer. 302 // dissociated from any existing non-null extra data pointer.
299 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const; 303 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const;
300 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); 304 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
301 305
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // instance it contains. 348 // instance it contains.
345 std::unique_ptr<ResourceRequestContainer> m_ownedResourceRequest; 349 std::unique_ptr<ResourceRequestContainer> m_ownedResourceRequest;
346 350
347 // Should never be null. 351 // Should never be null.
348 ResourceRequest* m_resourceRequest; 352 ResourceRequest* m_resourceRequest;
349 }; 353 };
350 354
351 } // namespace blink 355 } // namespace blink
352 356
353 #endif 357 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698