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

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: Fixed duplicate URLs in 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..f5b48427190eb8f024788d827bbae782878e8672 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 class SpeculativePreloadType {
+ kNotSpeculative,
+ kInDocument, // The request was discovered in the main document
+ kInserted // The request was discovered in a document.write()
+ };
enum OriginRestriction {
kUseDefaultOriginRestrictionForType,
kRestrictToSameOrigin,
@@ -103,9 +108,14 @@ 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_type_ != SpeculativePreloadType::kNotSpeculative;
+ }
+ SpeculativePreloadType GetSpeculativePreloadType() const {
+ return speculative_preload_type_;
+ }
+ void SetSpeculativePreloadType(SpeculativePreloadType,
+ double discovery_time = 0);
double PreloadDiscoveryTime() { return preload_discovery_time_; }
@@ -162,7 +172,7 @@ class PLATFORM_EXPORT FetchParameters {
ResourceRequest resource_request_;
String charset_;
ResourceLoaderOptions options_;
- bool speculative_preload_;
+ SpeculativePreloadType speculative_preload_type_;
double preload_discovery_time_;
DeferOption defer_;
OriginRestriction origin_restriction_;

Powered by Google App Engine
This is Rietveld 408576698