Verify HTML was AppCache fetched before delaying subresource requests

Currently we delay subresource requests until the document element is
initialized, in order to be sure AppCache was initialized as well.
That is entirely unnecessary for pages which don't use AppCache, which
is most of them.

This CL changes that behavior to only apply that delay in cases where
the HTML was actually fetched from AppCache.

Bug: 788757
Change-Id: I2177c05ba7f3b59c43b70a5cf9c17a75c4bd6996
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1676645
Commit-Queue: Yoav Weiss <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Reviewed-by: Charlie Harrison <[email protected]>
Reviewed-by: Kouhei Ueno <[email protected]>
Reviewed-by: Ben Kelly <[email protected]>
Cr-Commit-Position: refs/heads/master@{#677526}
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
index a7c9bc3..43e79fe 100644
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -354,5 +354,11 @@
 const base::FeatureParam<int> kBufferingBytesConsumerDelayMilliseconds{
     &kBufferingBytesConsumerDelay, "milliseconds", 50};
 
+// Enables removing AppCache delays when triggering requests when the HTML was
+// not fetched from AppCache.
+const base::Feature kVerifyHTMLFetchedFromAppCacheBeforeDelay{
+    "VerifyHTMLFetchedFromAppCacheBeforeDelay",
+    base::FEATURE_DISABLED_BY_DEFAULT};
+
 }  // namespace features
 }  // namespace blink