Changeset 243143 in webkit
- Timestamp:
- Mar 19, 2019, 10:05:55 AM (8 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 deleted
- 13 edited
-
ChangeLog (modified) (1 diff)
-
NetworkProcess/NetworkProcessCreationParameters.cpp (modified) (2 diffs)
-
NetworkProcess/NetworkProcessCreationParameters.h (modified) (1 diff)
-
NetworkProcess/cache/NetworkCache.cpp (modified) (10 diffs)
-
NetworkProcess/cache/NetworkCache.h (modified) (4 diffs)
-
NetworkProcess/cache/NetworkCacheStatistics.cpp (deleted)
-
NetworkProcess/cache/NetworkCacheStatistics.h (deleted)
-
NetworkProcess/cache/NetworkCacheStorage.cpp (modified) (1 diff)
-
NetworkProcess/cache/NetworkCacheStorage.h (modified) (1 diff)
-
NetworkProcess/cocoa/NetworkProcessCocoa.mm (modified) (1 diff)
-
NetworkProcess/soup/NetworkProcessSoup.cpp (modified) (1 diff)
-
Sources.txt (modified) (1 diff)
-
UIProcess/Cocoa/WebProcessPoolCocoa.mm (modified) (3 diffs)
-
UIProcess/soup/WebProcessPoolSoup.cpp (modified) (1 diff)
-
WebKit.xcodeproj/project.pbxproj (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r243142 r243143 1 2019-03-19 Chris Dumez <cdumez@apple.com> 2 3 Drop NetworkCacheStatistics code 4 https://bugs.webkit.org/show_bug.cgi?id=195910 5 6 Reviewed by Antti Koivisto. 7 8 Drop NetworkCacheStatistics code. It was a temporary experiment and has not been used in a long time. 9 10 * NetworkProcess/NetworkProcessCreationParameters.cpp: 11 (WebKit::NetworkProcessCreationParameters::encode const): 12 (WebKit::NetworkProcessCreationParameters::decode): 13 * NetworkProcess/NetworkProcessCreationParameters.h: 14 * NetworkProcess/cache/NetworkCache.cpp: 15 (WebKit::NetworkCache::Cache::Cache): 16 (WebKit::NetworkCache::Cache::retrieve): 17 (WebKit::NetworkCache::Cache::store): 18 (WebKit::NetworkCache::Cache::storeRedirect): 19 (WebKit::NetworkCache::Cache::update): 20 (WebKit::NetworkCache::Cache::clear): 21 * NetworkProcess/cache/NetworkCache.h: 22 * NetworkProcess/cache/NetworkCacheStatistics.cpp: Removed. 23 * NetworkProcess/cache/NetworkCacheStatistics.h: Removed. 24 * NetworkProcess/cache/NetworkCacheStorage.cpp: 25 (WebKit::NetworkCache::traverseRecordsFiles): 26 * NetworkProcess/cache/NetworkCacheStorage.h: 27 * NetworkProcess/cocoa/NetworkProcessCocoa.mm: 28 (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa): 29 * NetworkProcess/soup/NetworkProcessSoup.cpp: 30 (WebKit::NetworkProcess::platformInitializeNetworkProcess): 31 * Sources.txt: 32 * UIProcess/Cocoa/WebProcessPoolCocoa.mm: 33 (WebKit::registerUserDefaultsIfNeeded): 34 (WebKit::WebProcessPool::platformInitializeNetworkProcess): 35 * UIProcess/soup/WebProcessPoolSoup.cpp: 36 (WebKit::WebProcessPool::platformInitializeNetworkProcess): 37 * WebKit.xcodeproj/project.pbxproj: 38 1 39 2019-03-19 Chris Dumez <cdumez@apple.com> 2 40 -
trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.cpp
r243110 r243143 46 46 encoder << diskCacheDirectory; 47 47 encoder << diskCacheDirectoryExtensionHandle; 48 encoder << shouldEnableNetworkCacheEfficacyLogging;49 48 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) 50 49 encoder << shouldEnableNetworkCacheSpeculativeRevalidation; … … 114 113 result.diskCacheDirectoryExtensionHandle = WTFMove(*diskCacheDirectoryExtensionHandle); 115 114 116 if (!decoder.decode(result.shouldEnableNetworkCacheEfficacyLogging))117 return false;118 115 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) 119 116 if (!decoder.decode(result.shouldEnableNetworkCacheSpeculativeRevalidation)) -
trunk/Source/WebKit/NetworkProcess/NetworkProcessCreationParameters.h
r243110 r243143 57 57 String diskCacheDirectory; 58 58 SandboxExtension::Handle diskCacheDirectoryExtensionHandle; 59 bool shouldEnableNetworkCacheEfficacyLogging { false };60 59 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) 61 60 bool shouldEnableNetworkCacheSpeculativeRevalidation { false }; -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.cpp
r242713 r243143 29 29 #include "Logging.h" 30 30 #include "NetworkCacheSpeculativeLoadManager.h" 31 #include "NetworkCacheStatistics.h"32 31 #include "NetworkCacheStorage.h" 33 32 #include "NetworkProcess.h" … … 100 99 #endif 101 100 102 if (options.contains(Option::EfficacyLogging))103 m_statistics = Statistics::open(*this, m_storage->basePath());104 105 101 if (options.contains(Option::RegisterNotify)) { 106 102 #if PLATFORM(COCOA) … … 280 276 LOG(NetworkCache, "(NetworkProcess) retrieving %s priority %d", request.url().string().ascii().data(), static_cast<int>(request.priority())); 281 277 282 if (m_statistics)283 m_statistics->recordRetrievalRequest(frameID.first);284 285 278 Key storageKey = makeCacheKey(request); 286 279 auto priority = static_cast<unsigned>(request.priority()); … … 298 291 auto retrieveDecision = makeRetrieveDecision(request); 299 292 if (retrieveDecision != RetrieveDecision::Yes) { 300 if (m_statistics)301 m_statistics->recordNotUsingCacheForRequest(frameID.first, storageKey, request, retrieveDecision);302 303 293 completeRetrieve(WTFMove(completionHandler), nullptr, info); 304 294 return; … … 318 308 #endif 319 309 320 m_storage->retrieve(storageKey, priority, [ this, protectedThis = makeRef(*this), request, completionHandler = WTFMove(completionHandler), info = WTFMove(info), storageKey, frameID, networkProcess = makeRef(networkProcess())](auto record, auto timings) mutable {310 m_storage->retrieve(storageKey, priority, [request, completionHandler = WTFMove(completionHandler), info = WTFMove(info), storageKey, networkProcess = makeRef(networkProcess())](auto record, auto timings) mutable { 321 311 info.storageTimings = timings; 322 312 323 313 if (!record) { 324 314 LOG(NetworkCache, "(NetworkProcess) not found in storage"); 325 326 if (m_statistics)327 m_statistics->recordRetrievalFailure(frameID.first, storageKey, request);328 315 329 316 completeRetrieve(WTFMove(completionHandler), nullptr, info); … … 352 339 completeRetrieve(WTFMove(completionHandler), WTFMove(entry), info); 353 340 354 if (m_statistics)355 m_statistics->recordRetrievedCachedEntry(frameID.first, storageKey, request, useDecision);356 341 return useDecision != UseDecision::NoDueToDecodeFailure; 357 342 }); … … 390 375 remove(key); 391 376 } 392 393 if (m_statistics)394 m_statistics->recordNotCachingResponse(key, storeDecision);395 377 396 378 return nullptr; … … 423 405 if (storeDecision != StoreDecision::Yes) { 424 406 LOG(NetworkCache, "(NetworkProcess) didn't store redirect, storeDecision=%d", static_cast<int>(storeDecision)); 425 auto key = makeCacheKey(request);426 if (m_statistics)427 m_statistics->recordNotCachingResponse(key, storeDecision);428 429 407 return nullptr; 430 408 } … … 459 437 460 438 m_storage->store(updateRecord, { }); 461 462 if (m_statistics)463 m_statistics->recordRevalidationSuccess(frameID.first, existingEntry.key(), originalRequest);464 439 465 440 return updateEntry; … … 584 559 LOG(NetworkCache, "(NetworkProcess) clearing cache"); 585 560 586 if (m_statistics)587 m_statistics->clear();588 589 561 String anyType; 590 562 m_storage->clear(anyType, modifiedSince, WTFMove(completionHandler)); -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCache.h
r239759 r243143 49 49 class Cache; 50 50 class SpeculativeLoadManager; 51 class Statistics;52 51 53 52 struct MappedBody { … … 66 65 }; 67 66 68 // FIXME: This enum is used in the Statistics code in a way that prevents removing or reordering anything.69 67 enum class StoreDecision { 70 68 Yes, 71 69 NoDueToProtocol, 72 70 NoDueToHTTPMethod, 73 NoDueToAttachmentResponse, // Unused.74 71 NoDueToNoStoreResponse, 75 72 NoDueToHTTPStatusCode, … … 93 90 public: 94 91 enum class Option { 95 EfficacyLogging = 1 << 0,96 92 // In testing mode we try to eliminate sources of randomness. Cache does not shrink and there are no read timeouts. 97 TestingMode = 1 << 1,98 RegisterNotify = 1 << 2,93 TestingMode = 1 << 0, 94 RegisterNotify = 1 << 1, 99 95 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) 100 SpeculativeRevalidation = 1 << 3,96 SpeculativeRevalidation = 1 << 2, 101 97 #endif 102 98 }; … … 170 166 std::unique_ptr<SpeculativeLoadManager> m_speculativeLoadManager; 171 167 #endif 172 std::unique_ptr<Statistics> m_statistics;173 168 174 169 unsigned m_traverseCount { 0 }; -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
r241244 r243143 177 177 } 178 178 179 void traverseRecordsFiles(const String& recordsPath, const String& expectedType, const RecordFileTraverseFunction& function) 179 using RecordFileTraverseFunction = Function<void (const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath)>; 180 static void traverseRecordsFiles(const String& recordsPath, const String& expectedType, const RecordFileTraverseFunction& function) 180 181 { 181 182 traverseDirectory(recordsPath, [&](const String& partitionName, DirectoryEntryType entryType) { -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.h
r239759 r243143 210 210 }; 211 211 212 // FIXME: Remove, used by NetworkCacheStatistics only.213 using RecordFileTraverseFunction = Function<void (const String& fileName, const String& hashString, const String& type, bool isBlob, const String& recordDirectoryPath)>;214 void traverseRecordsFiles(const String& recordsPath, const String& type, const RecordFileTraverseFunction&);215 216 212 } 217 213 } -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkProcessCocoa.mm
r240350 r243143 113 113 SandboxExtension::consumePermanently(parameters.diskCacheDirectoryExtensionHandle); 114 114 OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify }; 115 if (parameters.shouldEnableNetworkCacheEfficacyLogging)116 cacheOptions.add(NetworkCache::Cache::Option::EfficacyLogging);117 115 if (parameters.shouldUseTestingNetworkSession) 118 116 cacheOptions.add(NetworkCache::Cache::Option::TestingMode); -
trunk/Source/WebKit/NetworkProcess/soup/NetworkProcessSoup.cpp
r241587 r243143 113 113 114 114 OptionSet<NetworkCache::Cache::Option> cacheOptions { NetworkCache::Cache::Option::RegisterNotify }; 115 if (parameters.shouldEnableNetworkCacheEfficacyLogging)116 cacheOptions.add(NetworkCache::Cache::Option::EfficacyLogging);117 115 #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION) 118 116 if (parameters.shouldEnableNetworkCacheSpeculativeRevalidation) -
trunk/Source/WebKit/Sources.txt
r243110 r243143 79 79 NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp 80 80 NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp 81 NetworkProcess/cache/NetworkCacheStatistics.cpp82 81 NetworkProcess/cache/NetworkCacheStorage.cpp 83 82 NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp -
trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm
r243110 r243143 79 79 #endif 80 80 81 static NSString * const WebKitNetworkCacheEfficacyLoggingEnabledDefaultsKey = @"WebKitNetworkCacheEfficacyLoggingEnabled";82 83 81 static NSString * const WebKitSuppressMemoryPressureHandlerDefaultsKey = @"WebKitSuppressMemoryPressureHandler"; 84 82 … … 106 104 [registrationDictionary setObject:@YES forKey:WebKitJSCJITEnabledDefaultsKey]; 107 105 [registrationDictionary setObject:@YES forKey:WebKitJSCFTLJITEnabledDefaultsKey]; 108 109 [registrationDictionary setObject:@NO forKey:WebKitNetworkCacheEfficacyLoggingEnabledDefaultsKey];110 106 111 107 [[NSUserDefaults standardUserDefaults] registerDefaults:registrationDictionary]; … … 290 286 291 287 parameters.networkATSContext = adoptCF(_CFNetworkCopyATSContext()); 292 293 parameters.shouldEnableNetworkCacheEfficacyLogging = [defaults boolForKey:WebKitNetworkCacheEfficacyLoggingEnabledDefaultsKey];294 288 295 289 #if PLATFORM(IOS_FAMILY) -
trunk/Source/WebKit/UIProcess/soup/WebProcessPoolSoup.cpp
r241013 r243143 45 45 parameters.ignoreTLSErrors = m_ignoreTLSErrors; 46 46 parameters.languages = userPreferredLanguages(); 47 parameters.shouldEnableNetworkCacheEfficacyLogging = false;48 47 parameters.proxySettings = m_networkProxySettings; 49 48 } -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r243113 r243143 1205 1205 832ED18C1E2FE157006BA64A /* PerActivityStateCPUUsageSampler.h in Headers */ = {isa = PBXBuildFile; fileRef = 832ED18A1E2FE13B006BA64A /* PerActivityStateCPUUsageSampler.h */; }; 1206 1206 834B250F1A831A8D00CFB150 /* NetworkCacheFileSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B250E1A831A8D00CFB150 /* NetworkCacheFileSystem.h */; }; 1207 834B25121A842C8700CFB150 /* NetworkCacheStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B25101A842C8700CFB150 /* NetworkCacheStatistics.h */; };1208 1207 836034A01ACB34D600626549 /* WebSQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */; }; 1209 1208 8372DB251A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 8372DB241A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 3724 3723 83397C6722124BD100B62388 /* WebProcessCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProcessCache.h; sourceTree = "<group>"; }; 3725 3724 834B250E1A831A8D00CFB150 /* NetworkCacheFileSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheFileSystem.h; sourceTree = "<group>"; }; 3726 834B25101A842C8700CFB150 /* NetworkCacheStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheStatistics.h; sourceTree = "<group>"; };3727 3725 8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSQLiteDatabaseTracker.cpp; sourceTree = "<group>"; }; 3728 3726 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSQLiteDatabaseTracker.h; sourceTree = "<group>"; }; … … 3742 3740 83A0ED321F747CC6003299EB /* PreconnectTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PreconnectTask.h; sourceTree = "<group>"; }; 3743 3741 83A0ED331F747CC7003299EB /* PreconnectTask.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PreconnectTask.cpp; sourceTree = "<group>"; }; 3744 83BDCCB81AC5FDB6003F6441 /* NetworkCacheStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheStatistics.cpp; sourceTree = "<group>"; };3745 3742 83D454D61BE9D3C4006C93BD /* NetworkLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkLoadClient.h; sourceTree = "<group>"; }; 3746 3743 83EE57591DB7D60600C74C50 /* WebValidationMessageClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebValidationMessageClient.cpp; sourceTree = "<group>"; }; … … 8876 8873 832AE2511BE2E8CD00FAAE10 /* NetworkCacheSpeculativeLoadManager.cpp */, 8877 8874 832AE2501BE2E8CD00FAAE10 /* NetworkCacheSpeculativeLoadManager.h */, 8878 83BDCCB81AC5FDB6003F6441 /* NetworkCacheStatistics.cpp */,8879 834B25101A842C8700CFB150 /* NetworkCacheStatistics.h */,8880 8875 E4436EC31A0CFDB200EAD204 /* NetworkCacheStorage.cpp */, 8881 8876 E4436EC21A0CFDB200EAD204 /* NetworkCacheStorage.h */, … … 9258 9253 831EEBBD1BD85C4300BB64C3 /* NetworkCacheSpeculativeLoad.h in Headers */, 9259 9254 832AE2521BE2E8CD00FAAE10 /* NetworkCacheSpeculativeLoadManager.h in Headers */, 9260 834B25121A842C8700CFB150 /* NetworkCacheStatistics.h in Headers */,9261 9255 E4436ECF1A0D040B00EAD204 /* NetworkCacheStorage.h in Headers */, 9262 9256 8310428B1BD6B66F00A715E4 /* NetworkCacheSubresourcesEntry.h in Headers */,
Note:
See TracChangeset
for help on using the changeset viewer.