Changeset 163121 in webkit
- Timestamp:
- Jan 30, 2014 3:02:39 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163118 r163121 1 2014-01-27 Jeffrey Pfau <jpfau@apple.com> 2 3 Add a method for schemes to be registered as supporting cache partitioning 4 https://bugs.webkit.org/show_bug.cgi?id=127739 5 6 Reviewed by Darin Adler. 7 8 Currently, this assumes that schemes supporting cache partitioning 9 also support (scheme, host) doubles for the scheme. Furthermore, 10 the scheme is currently discarded when partitioning and is only 11 checked to ensure that partitioning is supported for that scheme: it 12 is assumed that all origins with the same host double should be binned 13 together, regardless of scheme. 14 15 * WebCore.exp.in: 16 * page/SecurityOrigin.cpp: 17 (WebCore::SecurityOrigin::cachePartition): 18 * platform/SchemeRegistry.cpp: 19 (WebCore::CachePartitioningSchemes): 20 (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned): 21 (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme): 22 * platform/SchemeRegistry.h: 23 1 24 2014-01-30 Jer Noble <jer.noble@apple.com> 2 25 -
trunk/Source/WebCore/WebCore.exp.in
r163113 r163121 387 387 __ZN7WebCore14SchemeRegistry34registerURLSchemeAsDisplayIsolatedERKN3WTF6StringE 388 388 __ZN7WebCore14SchemeRegistry34shouldLoadURLSchemeAsEmptyDocumentERKN3WTF6StringE 389 __ZN7WebCore14SchemeRegistry35registerURLSchemeAsCachePartitionedERKN3WTF6StringE 389 390 __ZN7WebCore14SchemeRegistry40setDomainRelaxationForbiddenForURLSchemeEbRKN3WTF6StringE 390 391 __ZN7WebCore14SchemeRegistry41allowsLocalStorageAccessInPrivateBrowsingERKN3WTF6StringE -
trunk/Source/WebCore/page/SecurityOrigin.cpp
r156692 r163121 445 445 return String(); 446 446 447 if (m_protocol != "http" && m_protocol != "https") 448 return String(); 449 450 return host(); 447 if (isHTTPFamily()) 448 return host(); 449 450 if (SchemeRegistry::shouldPartitionCacheForURLScheme(m_protocol)) 451 return host(); 452 453 return String(); 451 454 } 452 455 #endif -
trunk/Source/WebCore/page/SecurityOrigin.h
r156550 r163121 216 216 bool passesFileCheck(const SecurityOrigin*) const; 217 217 bool isThirdParty(const SecurityOrigin*) const; 218 219 // This method checks that the scheme for this origin is an HTTP-family 220 // scheme, e.g. HTTP and HTTPS. 221 bool isHTTPFamily() const { return m_protocol == "http" || m_protocol == "https"; } 218 222 219 223 enum ShouldAllowFromThirdParty { AlwaysAllowFromThirdParty, MaybeAllowFromThirdParty }; -
trunk/Source/WebCore/platform/SchemeRegistry.cpp
r156795 r163121 27 27 #include "SchemeRegistry.h" 28 28 #include <wtf/MainThread.h> 29 #include <wtf/NeverDestroyed.h> 29 30 30 31 namespace WebCore { … … 165 166 } 166 167 168 #if ENABLE(CACHE_PARTITIONING) 169 static URLSchemesMap& cachePartitioningSchemes() 170 { 171 static NeverDestroyed<URLSchemesMap> schemes; 172 return schemes; 173 } 174 #endif 175 167 176 bool SchemeRegistry::shouldTreatURLSchemeAsLocal(const String& scheme) 168 177 { … … 324 333 } 325 334 335 #if ENABLE(CACHE_PARTITIONING) 336 void SchemeRegistry::registerURLSchemeAsCachePartitioned(const String& scheme) 337 { 338 cachePartitioningSchemes().add(scheme); 339 } 340 341 bool SchemeRegistry::shouldPartitionCacheForURLScheme(const String& scheme) 342 { 343 if (scheme.isEmpty()) 344 return false; 345 return cachePartitioningSchemes().contains(scheme); 346 } 347 #endif 348 326 349 } // namespace WebCore -
trunk/Source/WebCore/platform/SchemeRegistry.h
r150169 r163121 92 92 // Schemes whose responses can be cached indefinitely. 93 93 static bool shouldCacheResponsesFromURLSchemeIndefinitely(const String& scheme); 94 95 #if ENABLE(CACHE_PARTITIONING) 96 // Schemes whose requests should be partitioned in the cache 97 static void registerURLSchemeAsCachePartitioned(const String& scheme); 98 static bool shouldPartitionCacheForURLScheme(const String& scheme); 99 #endif 94 100 }; 95 101 -
trunk/Source/WebKit2/ChangeLog
r163116 r163121 1 2014-01-27 Jeffrey Pfau <jpfau@apple.com> 2 3 Add a method for schemes to be registered as supporting cache partitioning 4 https://bugs.webkit.org/show_bug.cgi?id=127739 5 6 Reviewed by Darin Adler. 7 8 Pipe information about cache partitioned scheme through WebKit2. 9 10 * Shared/WebProcessCreationParameters.cpp: 11 (WebKit::WebProcessCreationParameters::encode): 12 (WebKit::WebProcessCreationParameters::decode): 13 * Shared/WebProcessCreationParameters.h: 14 * UIProcess/API/C/WKContext.cpp: 15 (WKContextRegisterURLSchemeAsCachePartitioned): 16 * UIProcess/API/C/WKContextPrivate.h: 17 * UIProcess/WebContext.cpp: 18 (WebKit::WebContext::createNewWebProcess): 19 (WebKit::WebContext::registerURLSchemeAsCachePartitioned): 20 * UIProcess/WebContext.h: 21 * WebProcess/WebProcess.cpp: 22 (WebKit::WebProcess::initializeWebProcess): 23 (WebKit::WebProcess::registerURLSchemeAsCachePartitioned): 24 * WebProcess/WebProcess.h: 25 * WebProcess/WebProcess.messages.in: 26 1 27 2014-01-30 Tim Horton <timothy_horton@apple.com> 2 28 -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
r162904 r163121 71 71 encoder << urlSchemesRegisteredAsDisplayIsolated; 72 72 encoder << urlSchemesRegisteredAsCORSEnabled; 73 #if ENABLE(CACHE_PARTITIONING) 74 encoder << urlSchemesRegisteredAsCachePartitioned; 75 #endif 73 76 #if ENABLE(CUSTOM_PROTOCOLS) 74 77 encoder << urlSchemesRegisteredForCustomProtocols; … … 163 166 if (!decoder.decode(parameters.urlSchemesRegisteredAsCORSEnabled)) 164 167 return false; 168 #if ENABLE(CACHE_PARTITIONING) 169 if (!decoder.decode(parameters.urlSchemesRegisteredAsCachePartitioned)) 170 return false; 171 #endif 165 172 #if ENABLE(CUSTOM_PROTOCOLS) 166 173 if (!decoder.decode(parameters.urlSchemesRegisteredForCustomProtocols)) -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h
r162904 r163121 79 79 Vector<String> urlSchemesRegisteredAsDisplayIsolated; 80 80 Vector<String> urlSchemesRegisteredAsCORSEnabled; 81 #if ENABLE(CACHE_PARTITIONING) 82 Vector<String> urlSchemesRegisteredAsCachePartitioned; 83 #endif 81 84 #if ENABLE(CUSTOM_PROTOCOLS) 82 85 Vector<String> urlSchemesRegisteredForCustomProtocols; -
trunk/Source/WebKit2/UIProcess/API/C/WKContext.cpp
r162904 r163121 187 187 } 188 188 189 void WKContextRegisterURLSchemeAsCachePartitioned(WKContextRef contextRef, WKStringRef urlScheme) 190 { 191 #if ENABLE(CACHE_PARTITIONING) 192 toImpl(contextRef)->registerURLSchemeAsCachePartitioned(toImpl(urlScheme)->string()); 193 #else 194 UNUSED_PARAM(contextRef); 195 UNUSED_PARAM(urlScheme); 196 #endif 197 } 198 189 199 void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef contextRef, WKStringRef urlScheme) 190 200 { -
trunk/Source/WebKit2/UIProcess/API/C/WKContextPrivate.h
r162904 r163121 53 53 WK_EXPORT void WKContextRegisterURLSchemeAsSecure(WKContextRef context, WKStringRef urlScheme); 54 54 55 WK_EXPORT void WKContextRegisterURLSchemeAsCachePartitioned(WKContextRef context, WKStringRef urlScheme); 56 55 57 WK_EXPORT void WKContextSetDomainRelaxationForbiddenForURLScheme(WKContextRef context, WKStringRef urlScheme); 56 58 -
trunk/Source/WebKit2/UIProcess/WebContext.cpp
r162904 r163121 577 577 copyToVector(m_schemesToRegisterAsDisplayIsolated, parameters.urlSchemesRegisteredAsDisplayIsolated); 578 578 copyToVector(m_schemesToRegisterAsCORSEnabled, parameters.urlSchemesRegisteredAsCORSEnabled); 579 #if ENABLE(CACHE_PARTITIONING) 580 copyToVector(m_schemesToRegisterAsCachePartitioned, parameters.urlSchemesRegisteredAsCachePartitioned); 581 #endif 579 582 580 583 parameters.shouldAlwaysUseComplexTextCodePath = m_alwaysUsesComplexTextCodePath; … … 939 942 #endif 940 943 944 #if ENABLE(CACHE_PARTITIONING) 945 void WebContext::registerURLSchemeAsCachePartitioned(const String& urlScheme) 946 { 947 m_schemesToRegisterAsCachePartitioned.add(urlScheme); 948 sendToAllProcesses(Messages::WebProcess::RegisterURLSchemeAsCachePartitioned(urlScheme)); 949 } 950 #endif 951 941 952 void WebContext::setCacheModel(CacheModel cacheModel) 942 953 { -
trunk/Source/WebKit2/UIProcess/WebContext.h
r162904 r163121 190 190 void registerURLSchemeAsDisplayIsolated(const String&); 191 191 void registerURLSchemeAsCORSEnabled(const String&); 192 #if ENABLE(CACHE_PARTITIONING) 193 void registerURLSchemeAsCachePartitioned(const String&); 194 #endif 192 195 193 196 void addVisitedLink(const String&); … … 453 456 HashSet<String> m_schemesToRegisterAsDisplayIsolated; 454 457 HashSet<String> m_schemesToRegisterAsCORSEnabled; 458 #if ENABLE(CACHE_PARTITIONING) 459 HashSet<String> m_schemesToRegisterAsCachePartitioned; 460 #endif 455 461 456 462 bool m_alwaysUsesComplexTextCodePath; -
trunk/Source/WebKit2/WebProcess/WebProcess.cpp
r163079 r163121 328 328 registerURLSchemeAsCORSEnabled(parameters.urlSchemesRegisteredAsCORSEnabled[i]); 329 329 330 #if ENABLE(CACHE_PARTITIONING) 331 for (auto& scheme : parameters.urlSchemesRegisteredAsCachePartitioned) 332 registerURLSchemeAsCORSEnabled(scheme); 333 #endif 334 330 335 setDefaultRequestTimeoutInterval(parameters.defaultRequestTimeoutInterval); 331 336 … … 429 434 SchemeRegistry::registerURLSchemeAsCORSEnabled(urlScheme); 430 435 } 436 437 #if ENABLE(CACHE_PARTITIONING) 438 void WebProcess::registerURLSchemeAsCachePartitioned(const String& urlScheme) const 439 { 440 SchemeRegistry::registerURLSchemeAsCachePartitioned(urlScheme); 441 } 442 #endif 431 443 432 444 void WebProcess::setDefaultRequestTimeoutInterval(double timeoutInterval) -
trunk/Source/WebKit2/WebProcess/WebProcess.h
r163079 r163121 204 204 void registerURLSchemeAsDisplayIsolated(const String&) const; 205 205 void registerURLSchemeAsCORSEnabled(const String&) const; 206 #if ENABLE(CACHE_PARTITIONING) 207 void registerURLSchemeAsCachePartitioned(const String&) const; 208 #endif 206 209 void setDefaultRequestTimeoutInterval(double); 207 210 void setAlwaysUsesComplexTextCodePath(bool); -
trunk/Source/WebKit2/WebProcess/WebProcess.messages.in
r162904 r163121 43 43 RegisterURLSchemeAsDisplayIsolated(String scheme) 44 44 RegisterURLSchemeAsCORSEnabled(String scheme) 45 #if ENABLE(CACHE_PARTITIONING) 46 RegisterURLSchemeAsCachePartitioned(String scheme) 47 #endif 45 48 SetDefaultRequestTimeoutInterval(double timeoutInterval) 46 49 SetAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText)
Note: See TracChangeset
for help on using the changeset viewer.