Title: [252656] branches/safari-608-branch/Source/WebCore
Revision
252656
Author
[email protected]
Date
2019-11-19 16:33:09 -0800 (Tue, 19 Nov 2019)

Log Message

Cherry-pick r251678. rdar://problem/57283567

    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:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251678 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (252655 => 252656)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-11-20 00:32:19 UTC (rev 252655)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-11-20 00:33:09 UTC (rev 252656)
@@ -1,3 +1,33 @@
+2019-11-19  Alan Coon  <[email protected]>
+
+        Cherry-pick r251678. rdar://problem/57283567
+
+    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:
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-10-28  Chris Dumez  <[email protected]>
+
+            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-11-18  Alan Coon  <[email protected]>
 
         Apply patch. rdar://problem/57257755

Modified: branches/safari-608-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp (252655 => 252656)


--- branches/safari-608-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2019-11-20 00:32:19 UTC (rev 252655)
+++ branches/safari-608-branch/Source/WebCore/loader/cache/CachedResourceLoader.cpp	2019-11-20 00:33:09 UTC (rev 252656)
@@ -152,16 +152,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)
@@ -171,9 +161,6 @@
     , m_autoLoadImages(true)
     , m_imagesEnabled(true)
     , m_allowStaleResources(false)
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-    , m_isXTempTabletHeaderExperimentOver(isXTempTabletHeaderExperimentOver())
-#endif
 {
 }
 
@@ -803,36 +790,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, DeferOption defer)
 {
     request.setDestinationIfNotSet(destinationForType(type));
@@ -916,12 +873,6 @@
         }
     }
 
-    // FIXME: This is temporary for <rdar://problem/55790994>.
-#if PLATFORM(IOS) && !PLATFORM(IOSMAC)
-    if (deviceHasIPadCapability() && frame() && shouldSendXTempTabletHeader(type, *frame(), request.resourceRequest().url()))
-        request.resourceRequest().setHTTPHeaderField(HTTPHeaderName::XTempTablet, "1"_s);
-#endif
-
     LoadTiming loadTiming;
     loadTiming.markStartTimeAndFetchStart();
     InitiatorContext initiatorContext = request.options().initiatorContext;

Modified: branches/safari-608-branch/Source/WebCore/loader/cache/CachedResourceLoader.h (252655 => 252656)


--- branches/safari-608-branch/Source/WebCore/loader/cache/CachedResourceLoader.h	2019-11-20 00:32:19 UTC (rev 252655)
+++ branches/safari-608-branch/Source/WebCore/loader/cache/CachedResourceLoader.h	2019-11-20 00:33:09 UTC (rev 252656)
@@ -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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to