Title: [251678] trunk/Source/WebCore
Revision
251678
Author
cdu...@apple.com
Date
2019-10-28 15:10:19 -0700 (Mon, 28 Oct 2019)

Log Message

Drop code for X-Temp-Tablet HTTP header experiment
https://bugs.webkit.org/show_bug.cgi?id=203524
<rdar://problem/55791195>

Reviewed by Ryosuke Niwa.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::CachedResourceLoader):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (251677 => 251678)


--- trunk/Source/WebCore/ChangeLog	2019-10-28 22:07:55 UTC (rev 251677)
+++ trunk/Source/WebCore/ChangeLog	2019-10-28 22:10:19 UTC (rev 251678)
@@ -1,3 +1,16 @@
+2019-10-28  Chris Dumez  <cdu...@apple.com>
+
+        Drop code for X-Temp-Tablet HTTP header experiment
+        https://bugs.webkit.org/show_bug.cgi?id=203524
+        <rdar://problem/55791195>
+
+        Reviewed by Ryosuke Niwa.
+
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::CachedResourceLoader):
+        (WebCore::CachedResourceLoader::requestResource):
+        * loader/cache/CachedResourceLoader.h:
+
 2019-10-28  Simon Fraser  <simon.fra...@apple.com>
 
         Properties that take <position> should not accept 3 values

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (251677 => 251678)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2019-10-28 22:07:55 UTC (rev 251677)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2019-10-28 22:10:19 UTC (rev 251678)
@@ -153,16 +153,6 @@
     return nullptr;
 }
 
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-static bool isXTempTabletHeaderExperimentOver()
-{
-    DateComponents date;
-    date.setMillisecondsSinceEpochForMonth(WallTime::now().secondsSinceEpoch().milliseconds());
-    // End of experiment is 02-01-2020.
-    return date.fullYear() > 2020 || (date.fullYear() == 2020 && date.month() >= 1);
-}
-#endif
-
 CachedResourceLoader::CachedResourceLoader(DocumentLoader* documentLoader)
     : m_document(nullptr)
     , m_documentLoader(documentLoader)
@@ -172,9 +162,6 @@
     , m_autoLoadImages(true)
     , m_imagesEnabled(true)
     , m_allowStaleResources(false)
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-    , m_isXTempTabletHeaderExperimentOver(isXTempTabletHeaderExperimentOver())
-#endif
 {
 }
 
@@ -795,36 +782,6 @@
     return FetchOptions::Destination::EmptyString;
 }
 
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-static bool isGoogleSearch(const URL& url)
-{
-    if (!url.protocolIs("https"))
-        return false;
-
-    RegistrableDomain registrableDomain(url);
-    if (!registrableDomain.string().startsWith("google."))
-        return false;
-
-    auto host = url.host();
-    return host.startsWithIgnoringASCIICase("google.") || host.startsWithIgnoringASCIICase("www.google.") || host.startsWithIgnoringASCIICase("images.google.");
-}
-
-bool CachedResourceLoader::shouldSendXTempTabletHeader(CachedResource::Type type, Frame& frame, const URL& url) const
-{
-    if (m_isXTempTabletHeaderExperimentOver || !IOSApplication::isMobileSafari())
-        return false;
-
-    if (!isGoogleSearch(url))
-        return false;
-
-    if (type == CachedResource::Type::MainResource && frame.isMainFrame())
-        return true;
-
-    auto* topDocument = frame.mainFrame().document();
-    return topDocument && isGoogleSearch(topDocument->url());
-}
-#endif
-
 ResourceErrorOr<CachedResourceHandle<CachedResource>> CachedResourceLoader::requestResource(CachedResource::Type type, CachedResourceRequest&& request, ForPreload forPreload, ImageLoading imageLoading)
 {
     if (!frame() || !frame()->page()) {
@@ -917,12 +874,6 @@
         }
     }
 
-    // FIXME: This is temporary for <rdar://problem/55790994>.
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-    if (deviceHasIPadCapability() && shouldSendXTempTabletHeader(type, frame, request.resourceRequest().url()))
-        request.resourceRequest().setHTTPHeaderField(HTTPHeaderName::XTempTablet, "1"_s);
-#endif
-
     LoadTiming loadTiming;
     loadTiming.markStartTimeAndFetchStart();
     InitiatorContext initiatorContext = request.options().initiatorContext;

Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.h (251677 => 251678)


--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h	2019-10-28 22:07:55 UTC (rev 251677)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h	2019-10-28 22:10:19 UTC (rev 251678)
@@ -192,10 +192,6 @@
     bool canRequestAfterRedirection(CachedResource::Type, const URL&, const ResourceLoaderOptions&) const;
     bool canRequestInContentDispositionAttachmentSandbox(CachedResource::Type, const URL&) const;
 
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-    bool shouldSendXTempTabletHeader(CachedResource::Type, Frame&, const URL&) const;
-#endif
-
     HashSet<String> m_validatedURLs;
     mutable DocumentResourceMap m_documentResources;
     WeakPtr<Document> m_document;
@@ -215,9 +211,6 @@
     bool m_autoLoadImages : 1;
     bool m_imagesEnabled : 1;
     bool m_allowStaleResources : 1;
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-    bool m_isXTempTabletHeaderExperimentOver : 1;
-#endif
 };
 
 class ResourceCacheValidationSuppressor {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to