Changeset 251678 in webkit
- Timestamp:
- Oct 28, 2019 3:10:19 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r251668 r251678 1 2019-10-28 Chris Dumez <cdumez@apple.com> 2 3 Drop code for X-Temp-Tablet HTTP header experiment 4 https://bugs.webkit.org/show_bug.cgi?id=203524 5 <rdar://problem/55791195> 6 7 Reviewed by Ryosuke Niwa. 8 9 * loader/cache/CachedResourceLoader.cpp: 10 (WebCore::CachedResourceLoader::CachedResourceLoader): 11 (WebCore::CachedResourceLoader::requestResource): 12 * loader/cache/CachedResourceLoader.h: 13 1 14 2019-10-28 Simon Fraser <simon.fraser@apple.com> 2 15 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r251637 r251678 154 154 } 155 155 156 #if PLATFORM(IOS) && !PLATFORM(IOSMAC)157 static bool isXTempTabletHeaderExperimentOver()158 {159 DateComponents date;160 date.setMillisecondsSinceEpochForMonth(WallTime::now().secondsSinceEpoch().milliseconds());161 // End of experiment is 02-01-2020.162 return date.fullYear() > 2020 || (date.fullYear() == 2020 && date.month() >= 1);163 }164 #endif165 166 156 CachedResourceLoader::CachedResourceLoader(DocumentLoader* documentLoader) 167 157 : m_document(nullptr) … … 173 163 , m_imagesEnabled(true) 174 164 , m_allowStaleResources(false) 175 #if PLATFORM(IOS) && !PLATFORM(IOSMAC)176 , m_isXTempTabletHeaderExperimentOver(isXTempTabletHeaderExperimentOver())177 #endif178 165 { 179 166 } … … 795 782 return FetchOptions::Destination::EmptyString; 796 783 } 797 798 #if PLATFORM(IOS) && !PLATFORM(IOSMAC)799 static bool isGoogleSearch(const URL& url)800 {801 if (!url.protocolIs("https"))802 return false;803 804 RegistrableDomain registrableDomain(url);805 if (!registrableDomain.string().startsWith("google."))806 return false;807 808 auto host = url.host();809 return host.startsWithIgnoringASCIICase("google.") || host.startsWithIgnoringASCIICase("www.google.") || host.startsWithIgnoringASCIICase("images.google.");810 }811 812 bool CachedResourceLoader::shouldSendXTempTabletHeader(CachedResource::Type type, Frame& frame, const URL& url) const813 {814 if (m_isXTempTabletHeaderExperimentOver || !IOSApplication::isMobileSafari())815 return false;816 817 if (!isGoogleSearch(url))818 return false;819 820 if (type == CachedResource::Type::MainResource && frame.isMainFrame())821 return true;822 823 auto* topDocument = frame.mainFrame().document();824 return topDocument && isGoogleSearch(topDocument->url());825 }826 #endif827 784 828 785 ResourceErrorOr<CachedResourceHandle<CachedResource>> CachedResourceLoader::requestResource(CachedResource::Type type, CachedResourceRequest&& request, ForPreload forPreload, ImageLoading imageLoading) … … 918 875 } 919 876 920 // FIXME: This is temporary for <rdar://problem/55790994>.921 #if PLATFORM(IOS) && !PLATFORM(IOSMAC)922 if (deviceHasIPadCapability() && shouldSendXTempTabletHeader(type, frame, request.resourceRequest().url()))923 request.resourceRequest().setHTTPHeaderField(HTTPHeaderName::XTempTablet, "1"_s);924 #endif925 926 877 LoadTiming loadTiming; 927 878 loadTiming.markStartTimeAndFetchStart(); -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.h
r251637 r251678 193 193 bool canRequestInContentDispositionAttachmentSandbox(CachedResource::Type, const URL&) const; 194 194 195 #if PLATFORM(IOS) && !PLATFORM(IOSMAC)196 bool shouldSendXTempTabletHeader(CachedResource::Type, Frame&, const URL&) const;197 #endif198 199 195 HashSet<String> m_validatedURLs; 200 196 mutable DocumentResourceMap m_documentResources; … … 216 212 bool m_imagesEnabled : 1; 217 213 bool m_allowStaleResources : 1; 218 #if PLATFORM(IOS) && !PLATFORM(IOSMAC)219 bool m_isXTempTabletHeaderExperimentOver : 1;220 #endif221 214 }; 222 215
Note: See TracChangeset
for help on using the changeset viewer.