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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h

Issue 2826213003: Don't lower priority for scripts inserted by doc.write (Closed)
Patch Set: Added layout test Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
diff --git a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
index a736299b24f9ad833dd5f04d4099e720086f60a9..3213c995ac6f8bf2bccea6b1fc5fe8d26b793501 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/FetchParameters.h
@@ -47,6 +47,11 @@ class PLATFORM_EXPORT FetchParameters {
public:
enum DeferOption { kNoDefer, kLazyLoad, kIdleLoad };
+ enum SpeculativePreload {
kinuko 2017/04/21 06:22:25 SpeculativePreloadType ?
Pat Meenan 2017/04/21 16:11:02 Done.
+ kNotSpeculative = 0,
+ kSpeculativeInDocument, // The request was discovered in the main document
+ kSpeculativeInserted // The request was discovered in a document.write()
+ };
kinuko 2017/04/21 06:22:25 ditto for new enums (though it makes things less c
Pat Meenan 2017/04/21 16:11:02 Changed it to a class with shorter enums (is that
enum OriginRestriction {
kUseDefaultOriginRestrictionForType,
kRestrictToSameOrigin,
@@ -103,9 +108,13 @@ class PLATFORM_EXPORT FetchParameters {
return client_hint_preferences_;
}
- bool IsSpeculativePreload() const { return speculative_preload_; }
- void SetSpeculativePreload(bool speculative_preload,
- double discovery_time = 0);
+ bool IsSpeculativePreload() const {
+ return speculative_preload_ != kNotSpeculative;
+ }
+ bool IsSpeculativeDocumentPreload() const {
+ return speculative_preload_ == kSpeculativeInDocument;
+ }
+ void SetSpeculativePreload(SpeculativePreload, double discovery_time = 0);
double PreloadDiscoveryTime() { return preload_discovery_time_; }
@@ -162,7 +171,7 @@ class PLATFORM_EXPORT FetchParameters {
ResourceRequest resource_request_;
String charset_;
ResourceLoaderOptions options_;
- bool speculative_preload_;
+ SpeculativePreload speculative_preload_;
double preload_discovery_time_;
DeferOption defer_;
OriginRestriction origin_restriction_;

Powered by Google App Engine
This is Rietveld 408576698