Changeset 196622 in webkit
- Timestamp:
- Feb 15, 2016 9:36:38 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196621 r196622 1 2016-02-15 Brent Fulgham <bfulgham@apple.com> 2 3 [Mac] Gather some rudimentary statistics during resource load 4 https://bugs.webkit.org/show_bug.cgi?id=153575 5 <rdar://problem/24075254> 6 7 Reviewed by Brady Eidson. 8 9 * http/tests/navigation/resources/redirect-on-reload-updates-history-item-statistics.php: Added. 10 * http/tests/navigation/resources/redirect-updates-history-item-done-statistics.html: Added. 11 * http/tests/navigation/statistics-expected.txt: Added. 12 * http/tests/navigation/statistics.html: Added. 13 1 14 2016-02-15 Chris Dumez <cdumez@apple.com> 2 15 -
trunk/Source/WebCore/CMakeLists.txt
r196604 r196622 1937 1937 loader/ProgressTracker.cpp 1938 1938 loader/ResourceLoadNotifier.cpp 1939 loader/ResourceLoadObserver.cpp 1940 loader/ResourceLoadStatistics.cpp 1939 1941 loader/ResourceLoader.cpp 1940 1942 loader/SinkDocument.cpp -
trunk/Source/WebCore/ChangeLog
r196621 r196622 1 2016-02-15 Brent Fulgham <bfulgham@apple.com> 2 3 [Mac] Gather some rudimentary statistics during resource load 4 https://bugs.webkit.org/show_bug.cgi?id=153575 5 <rdar://problem/24075254> 6 7 Reviewed by Brady Eidson. 8 9 Tested by: http/tests/navigation/statistics.html 10 11 * CMakeLists.txt: 12 * PlatformWin.cmake: 13 * WebCore.xcodeproj/project.pbxproj: 14 * dom/Document.cpp: 15 (WebCore::Document::updateLastHandledUserGestureTimestamp): Log user interaction 16 with the ResourceLoadObserver. 17 * loader/DocumentLoader.cpp: 18 (WebCore::DocumentLoader::willSendRequest): Track load statistics if the 19 user interacted with the document. 20 * loader/ResourceLoadObserver.cpp: Added. 21 * loader/ResourceLoadObserver.h: Added. 22 * loader/ResourceLoadStatistics.cpp: Added. 23 * loader/ResourceLoadStatistics.h: Added. 24 * loader/SubresourceLoader.cpp: 25 (WebCore::SubresourceLoader::willSendRequestInternal): Track load statistics. 26 * page/Settings.cpp: 27 (WebCore::Settings::setResourceLoadStatisticsEnabled): Added. 28 * page/Settings.h: 29 (WebCore::Settings::resourceLoadStatisticsEnabled): Added. 30 * platform/Logging.h: 31 * testing/Internals.cpp: 32 (WebCore::Internals::resourceLoadStatisticsForOrigin): 33 (WebCore::Internals::setResourceLoadStatisticsEnabled): 34 * testing/Internals.h: 35 * testing/Internals.idl: 36 1 37 2016-02-15 Chris Dumez <cdumez@apple.com> 2 38 -
trunk/Source/WebCore/PlatformWin.cmake
r195733 r196622 65 65 66 66 platform/cf/FileSystemCF.cpp 67 platform/cf/KeyedDecoderCF.cpp 68 platform/cf/KeyedEncoderCF.cpp 67 69 platform/cf/SharedBufferCF.cpp 68 70 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r196614 r196622 2518 2518 65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; }; 2519 2519 6B3480940EEF50D400AC1B41 /* NativeImagePtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2520 6B693A2E1C51A82E00B03BEF /* ResourceLoadObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B693A2D1C51A82E00B03BEF /* ResourceLoadObserver.h */; settings = {ATTRIBUTES = (Private, ); }; }; 2521 6B693A341C51A95D00B03BEF /* ResourceLoadObserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B693A331C51A95D00B03BEF /* ResourceLoadObserver.cpp */; }; 2520 2522 6C4C96DE1AD4483500365A50 /* JSReadableStreamController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6C4C96DA1AD4483500365A50 /* JSReadableStreamController.cpp */; }; 2521 2523 6C4C96DF1AD4483500365A50 /* JSReadableStreamController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6C4C96DB1AD4483500365A50 /* JSReadableStreamController.h */; }; … … 2692 2694 7A74ECBB101839A600BF939E /* InspectorDOMStorageAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */; }; 2693 2695 7A74ECBD101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */; }; 2696 7A929CA61C598A9E004DF226 /* ResourceLoadStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A929CA11C598378004DF226 /* ResourceLoadStatistics.cpp */; }; 2697 7A929CA71C598AA9004DF226 /* ResourceLoadStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */; }; 2694 2698 7A93868518DCC14500B8263D /* VTTScanner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A93868218DCC14500B8263D /* VTTScanner.cpp */; }; 2695 2699 7A93868618DCC14500B8263D /* VTTScanner.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A93868318DCC14500B8263D /* VTTScanner.h */; }; … … 10089 10093 65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; }; 10090 10094 6B3480920EEF50D400AC1B41 /* NativeImagePtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = NativeImagePtr.h; sourceTree = "<group>"; }; 10095 6B693A2D1C51A82E00B03BEF /* ResourceLoadObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadObserver.h; sourceTree = "<group>"; }; 10096 6B693A331C51A95D00B03BEF /* ResourceLoadObserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadObserver.cpp; sourceTree = "<group>"; }; 10091 10097 6C4C96DA1AD4483500365A50 /* JSReadableStreamController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSReadableStreamController.cpp; sourceTree = "<group>"; }; 10092 10098 6C4C96DB1AD4483500365A50 /* JSReadableStreamController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamController.h; sourceTree = "<group>"; }; … … 10293 10299 7A74ECB9101839A600BF939E /* InspectorDOMStorageAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDOMStorageAgent.h; sourceTree = "<group>"; }; 10294 10300 7A74ECBC101839DA00BF939E /* JSInspectorFrontendHostCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSInspectorFrontendHostCustom.cpp; sourceTree = "<group>"; }; 10301 7A929CA11C598378004DF226 /* ResourceLoadStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ResourceLoadStatistics.cpp; sourceTree = "<group>"; }; 10302 7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatistics.h; sourceTree = "<group>"; }; 10295 10303 7A93868218DCC14500B8263D /* VTTScanner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VTTScanner.cpp; sourceTree = "<group>"; }; 10296 10304 7A93868318DCC14500B8263D /* VTTScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VTTScanner.h; sourceTree = "<group>"; }; … … 22690 22698 973E325410883B7C005BC493 /* ResourceLoadNotifier.cpp */, 22691 22699 973E325510883B7C005BC493 /* ResourceLoadNotifier.h */, 22700 6B693A331C51A95D00B03BEF /* ResourceLoadObserver.cpp */, 22701 6B693A2D1C51A82E00B03BEF /* ResourceLoadObserver.h */, 22702 7A929CA11C598378004DF226 /* ResourceLoadStatistics.cpp */, 22703 7A929CA21C598378004DF226 /* ResourceLoadStatistics.h */, 22692 22704 51327D5F11A33A2B004F9D65 /* SinkDocument.cpp */, 22693 22705 51327D5E11A33A2B004F9D65 /* SinkDocument.h */, … … 24856 24868 buildActionMask = 2147483647; 24857 24869 files = ( 24870 6B693A2E1C51A82E00B03BEF /* ResourceLoadObserver.h in Headers */, 24858 24871 FE115FAB167988CD00249134 /* AbstractDatabaseServer.h in Headers */, 24859 24872 41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */, … … 25085 25098 CDC734151977896D0046BFC5 /* CARingBuffer.h in Headers */, 25086 25099 6550B69E099DF0270090D781 /* CDATASection.h in Headers */, 25100 7A929CA71C598AA9004DF226 /* ResourceLoadStatistics.h in Headers */, 25087 25101 CDE8B5ED1A69777300B4B66A /* CDMPrivateClearKey.h in Headers */, 25088 25102 CD318623199F1E2A0030A0F7 /* CDMPrivateMediaSourceAVFObjC.h in Headers */, … … 29149 29163 E125F859182C1AA600D84CD9 /* CryptoKeySerializationRaw.cpp in Sources */, 29150 29164 31BC742D1AAFF45C006B4340 /* CSSAnimationTriggerScrollValue.cpp in Sources */, 29165 7A929CA61C598A9E004DF226 /* ResourceLoadStatistics.cpp in Sources */, 29151 29166 CAE9F90F146441F000C245B0 /* CSSAspectRatioValue.cpp in Sources */, 29152 29167 FBD6AF8B15EF25E5008B7110 /* CSSBasicShapes.cpp in Sources */, … … 30121 30136 FD7868B9136B999200D403DF /* JSDynamicsCompressorNode.cpp in Sources */, 30122 30137 65DF31F909D1CC60000BE325 /* JSElement.cpp in Sources */, 30138 6B693A341C51A95D00B03BEF /* ResourceLoadObserver.cpp in Sources */, 30123 30139 BC2ED5550C6B9BD300920BFF /* JSElementCustom.cpp in Sources */, 30124 30140 2ECF7ADC10162B3800427DE7 /* JSErrorEvent.cpp in Sources */, -
trunk/Source/WebCore/dom/Document.cpp
r196400 r196622 135 135 #include "RenderView.h" 136 136 #include "RenderWidget.h" 137 #include "ResourceLoadObserver.h" 137 138 #include "RuntimeEnabledFeatures.h" 138 139 #include "SVGDocumentExtensions.h" … … 6397 6398 void Document::updateLastHandledUserGestureTimestamp() 6398 6399 { 6400 if (!m_lastHandledUserGestureTimestamp) 6401 ResourceLoadObserver::sharedObserver().logUserInteraction(*this); 6402 6399 6403 m_lastHandledUserGestureTimestamp = monotonicallyIncreasingTime(); 6400 6404 } -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r195770 r196622 60 60 #include "ProgressTracker.h" 61 61 #include "ResourceHandle.h" 62 #include "ResourceLoadObserver.h" 62 63 #include "SchemeRegistry.h" 63 64 #include "ScriptController.h" … … 525 526 } 526 527 528 ASSERT(m_frame); 529 530 Frame& topFrame = m_frame->tree().top(); 531 532 ASSERT(m_frame->document()); 533 ASSERT(topFrame.document()); 534 535 if (Settings::resourceLoadStatisticsEnabled()) 536 ResourceLoadObserver::sharedObserver().logFrameNavigation(!redirectResponse.isNull(), m_frame->document()->url(), newRequest.url(), m_frame->isMainFrame(), topFrame.document()->url()); 537 527 538 // Update cookie policy base URL as URL changes, except for subframes, which use the 528 539 // URL of the main frame which doesn't change when we redirect. 529 if ( frameLoader()->frame().isMainFrame())540 if (m_frame->isMainFrame()) 530 541 newRequest.setFirstPartyForCookies(newRequest.url()); 531 542 … … 537 548 newRequest.setCachePolicy(ReloadIgnoringCacheData); 538 549 539 Frame& topFrame = m_frame->tree().top();540 550 if (&topFrame != m_frame) { 541 551 if (!frameLoader()->mixedContentChecker().canDisplayInsecureContent(topFrame.document()->securityOrigin(), MixedContentChecker::ContentType::Active, newRequest.url())) { -
trunk/Source/WebCore/loader/SubresourceLoader.cpp
r195004 r196622 41 41 #include "MemoryCache.h" 42 42 #include "Page.h" 43 #include "ResourceLoadObserver.h" 43 44 #include "Settings.h" 44 45 #include <wtf/Ref.h> … … 190 191 if (newRequest.isNull()) 191 192 cancel(); 193 194 if (Settings::resourceLoadStatisticsEnabled()) 195 ResourceLoadObserver::sharedObserver().logSubresourceLoading(!redirectResponse.isNull(), redirectResponse.url(), newRequest.url(), m_frame ? m_frame->mainFrame().document()->url() : URL()); 192 196 } 193 197 -
trunk/Source/WebCore/page/Settings.cpp
r196332 r196622 97 97 bool Settings::gShouldRespectPriorityInCSSAttributeSetters = false; 98 98 bool Settings::gLowPowerVideoAudioBufferSizeEnabled = false; 99 bool Settings::gResourceLoadStatisticsEnabledEnabled = false; 99 100 100 101 #if PLATFORM(IOS) … … 700 701 } 701 702 703 void Settings::setResourceLoadStatisticsEnabled(bool flag) 704 { 705 gResourceLoadStatisticsEnabledEnabled = flag; 706 } 707 702 708 #if PLATFORM(IOS) 703 709 void Settings::setAudioSessionCategoryOverride(unsigned sessionCategory) -
trunk/Source/WebCore/page/Settings.h
r196328 r196622 243 243 WEBCORE_EXPORT static void setLowPowerVideoAudioBufferSizeEnabled(bool); 244 244 245 static bool resourceLoadStatisticsEnabled() { return gResourceLoadStatisticsEnabledEnabled; } 246 WEBCORE_EXPORT static void setResourceLoadStatisticsEnabled(bool); 247 245 248 #if PLATFORM(IOS) 246 249 WEBCORE_EXPORT static void setAudioSessionCategoryOverride(unsigned); … … 378 381 379 382 static bool gLowPowerVideoAudioBufferSizeEnabled; 383 static bool gResourceLoadStatisticsEnabledEnabled; 380 384 }; 381 385 -
trunk/Source/WebCore/platform/Logging.h
r194708 r196622 87 87 M(WebReplay) \ 88 88 M(WheelEventTestTriggers) \ 89 M(ResourceLoadObserver) \ 89 90 90 91 #define DECLARE_LOG_CHANNEL(name) \ -
trunk/Source/WebCore/testing/Internals.cpp
r196575 r196622 103 103 #include "RenderView.h" 104 104 #include "RenderedDocumentMarker.h" 105 #include "ResourceLoadObserver.h" 105 106 #include "RuntimeEnabledFeatures.h" 106 107 #include "SchemeRegistry.h" … … 3461 3462 #endif 3462 3463 3463 } 3464 String Internals::resourceLoadStatisticsForOrigin(String origin) 3465 { 3466 return ResourceLoadObserver::sharedObserver().statisticsForOrigin(origin); 3467 } 3468 3469 void Internals::setResourceLoadStatisticsEnabled(bool enable) 3470 { 3471 Settings::setResourceLoadStatisticsEnabled(enable); 3472 } 3473 3474 } -
trunk/Source/WebCore/testing/Internals.h
r196575 r196622 463 463 void setShowAllPlugins(bool); 464 464 465 String resourceLoadStatisticsForOrigin(String origin); 466 void setResourceLoadStatisticsEnabled(bool); 467 465 468 #if ENABLE(STREAMS_API) 466 469 bool isReadableStreamDisturbed(ScriptState&, JSC::JSValue); -
trunk/Source/WebCore/testing/Internals.idl
r196575 r196622 434 434 435 435 [Conditional=STREAMS_API, CallWith=ScriptState] boolean isReadableStreamDisturbed(any stream); 436 }; 436 437 DOMString resourceLoadStatisticsForOrigin(DOMString domain); 438 void setResourceLoadStatisticsEnabled(boolean enable); 439 }; -
trunk/Source/WebKit/mac/ChangeLog
r196551 r196622 1 2016-02-15 Brent Fulgham <bfulgham@apple.com> 2 3 [Mac] Gather some rudimentary statistics during resource load 4 https://bugs.webkit.org/show_bug.cgi?id=153575 5 <rdar://problem/24075254> 6 7 Reviewed by Brady Eidson. 8 9 * Misc/WebKitNSStringExtras.h: 10 * Misc/WebKitNSStringExtras.mm: 11 (+[NSString _webkit_localStorageDirectoryWithBundleIdentifier:]): Added. 12 * WebView/WebPreferenceKeysPrivate.h: 13 * WebView/WebPreferences.mm: 14 (+[WebPreferences initialize]): 15 (-[WebPreferences resourceLoadStatisticsEnabled]): Added. 16 (-[WebPreferences setResourceLoadStatisticsEnabled:]): Added. 17 * WebView/WebPreferencesPrivate.h: 18 * WebView/WebView.mm: 19 (WebKitInitializeApplicationCachePathIfNecessary): 20 (WebKitInitializeApplicationStatisticsStoragePathIfNecessary): Added. 21 (-[WebView _commonInitializationWithFrameName:groupName:]): Add call to new 22 initialization method. 23 (-[WebView _preferencesChanged:]): Track changes in the user's desire to 24 monitor resource load statistics. 25 (+[WebView _applicationWillTerminate]): Write statistics to disk (if preferences 26 say to do so.) 27 1 28 2016-02-13 Mark Lam <mark.lam@apple.com> 2 29 -
trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.h
r185294 r196622 34 34 35 35 extern NSString *WebKitLocalCacheDefaultsKey; 36 extern NSString *WebKitResourceLoadStatisticsDirectoryDefaultsKey; 36 37 37 38 @interface NSString (WebKitExtras) … … 66 67 67 68 + (NSString *)_webkit_localCacheDirectoryWithBundleIdentifier:(NSString*)bundleIdentifier; 69 + (NSString *)_webkit_localStorageDirectoryWithBundleIdentifier:(NSString*)bundleIdentifier; 68 70 69 71 @end -
trunk/Source/WebKit/mac/Misc/WebKitNSStringExtras.mm
r195180 r196622 47 47 48 48 NSString *WebKitLocalCacheDefaultsKey = @"WebKitLocalCache"; 49 NSString *WebKitResourceLoadStatisticsDirectoryDefaultsKey = @"WebKitResourceLoadStatisticsDirectory"; 49 50 50 51 using namespace WebCore; … … 312 313 } 313 314 315 + (NSString *)_webkit_localStorageDirectoryWithBundleIdentifier:(NSString*)bundleIdentifier 316 { 317 NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; 318 NSString *storageDirectory = [defaults objectForKey:WebKitResourceLoadStatisticsDirectoryDefaultsKey]; 319 320 if (!storageDirectory || ![storageDirectory isKindOfClass:[NSString class]]) { 321 NSError *error; 322 NSString *storageDirectory = [[[NSFileManager defaultManager] URLForDirectory:NSApplicationSupportDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:YES error:&error] path]; 323 324 if (!storageDirectory || ![storageDirectory isKindOfClass:[NSString class]]) 325 storageDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support"]; 326 } 327 328 return [storageDirectory stringByAppendingPathComponent:bundleIdentifier]; 329 } 330 314 331 @end -
trunk/Source/WebKit/mac/WebKit.exp
r174621 r196622 81 81 _WebKitErrorPlugInPageURLStringKey 82 82 _WebKitLocalCacheDefaultsKey 83 _WebKitResourceLoadStatisticsDirectoryDefaultsKey 83 84 _WebLocalizedString 84 85 _WebPlugInAttributesKey -
trunk/Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
r196328 r196622 137 137 #define WebKitSuppressesIncrementalRenderingKey @"WebKitSuppressesIncrementalRendering" 138 138 #define WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey @"WebKitSubpixelCSSOMElementMetricsEnabled" 139 #define WebKitResourceLoadStatisticsEnabledPreferenceKey @"WebKitResourceLoadStatisticsEnabled" 139 140 #if TARGET_OS_IPHONE 140 141 #define WebKitAudioSessionCategoryOverride @"WebKitAudioSessionCategoryOverride" -
trunk/Source/WebKit/mac/WebView/WebPreferences.mm
r196328 r196622 506 506 [NSNumber numberWithBool:NO], WebKitAccelerated2dCanvasEnabledPreferenceKey, 507 507 [NSNumber numberWithBool:NO], WebKitSubpixelCSSOMElementMetricsEnabledPreferenceKey, 508 [NSNumber numberWithBool:NO], WebKitResourceLoadStatisticsEnabledPreferenceKey, 508 509 #if PLATFORM(IOS) 509 510 [NSNumber numberWithBool:YES], WebKitFrameFlatteningEnabledPreferenceKey, … … 1830 1831 } 1831 1832 1833 - (BOOL)resourceLoadStatisticsEnabled 1834 { 1835 return [self _boolValueForKey:WebKitResourceLoadStatisticsEnabledPreferenceKey]; 1836 } 1837 1838 - (void)setResourceLoadStatisticsEnabled:(BOOL)enabled 1839 { 1840 [self _setBoolValue:enabled forKey:WebKitResourceLoadStatisticsEnabledPreferenceKey]; 1841 } 1842 1832 1843 - (BOOL)canvasUsesAcceleratedDrawing 1833 1844 { -
trunk/Source/WebKit/mac/WebView/WebPreferencesPrivate.h
r196328 r196622 204 204 - (void)setDisplayListDrawingEnabled:(BOOL)enabled; 205 205 206 - (BOOL)resourceLoadStatisticsEnabled; 207 - (void)setResourceLoadStatisticsEnabled:(BOOL)enabled; 208 206 209 - (BOOL)canvasUsesAcceleratedDrawing; 207 210 - (void)setCanvasUsesAcceleratedDrawing:(BOOL)enabled; -
trunk/Source/WebKit/mac/WebView/WebView.mm
r196551 r196622 169 169 #import <WebCore/RenderWidget.h> 170 170 #import <WebCore/ResourceHandle.h> 171 #import <WebCore/ResourceLoadObserver.h> 171 172 #import <WebCore/ResourceRequest.h> 172 173 #import <WebCore/RuntimeApplicationChecks.h> … … 747 748 748 749 webApplicationCacheStorage().setCacheDirectory(cacheDir); 750 751 initialized = YES; 752 } 753 754 static void WebKitInitializeApplicationStatisticsStoragePathIfNecessary() 755 { 756 static BOOL initialized = NO; 757 if (initialized) 758 return; 759 760 NSString *appName = [[NSBundle mainBundle] bundleIdentifier]; 761 if (!appName) 762 appName = [[NSProcessInfo processInfo] processName]; 763 764 ASSERT(appName); 765 766 NSString *supportDirectory = [NSString _webkit_localStorageDirectoryWithBundleIdentifier:appName]; 767 ResourceLoadObserver::sharedObserver().setStatisticsStorageDirectory(supportDirectory); 768 749 769 initialized = YES; 750 770 } … … 944 964 WebKitInitializeStorageIfNecessary(); 945 965 WebKitInitializeApplicationCachePathIfNecessary(); 966 WebKitInitializeApplicationStatisticsStoragePathIfNecessary(); 946 967 #if ENABLE(GAMEPAD) 947 968 WebKitInitializeGamepadProviderIfNecessary(); … … 2453 2474 settings.setHiddenPageCSSAnimationSuspensionEnabled([preferences hiddenPageCSSAnimationSuspensionEnabled]); 2454 2475 2476 settings.setResourceLoadStatisticsEnabled([preferences resourceLoadStatisticsEnabled]); 2477 ResourceLoadObserver::sharedObserver().readDataFromDiskIfNeeded(); 2478 2455 2479 #if ENABLE(GAMEPAD) 2456 2480 RuntimeEnabledFeatures::sharedFeatures().setGamepadsEnabled([preferences gamepadsEnabled]); … … 4820 4844 { 4821 4845 applicationIsTerminating = YES; 4846 4847 ResourceLoadObserver::sharedObserver().writeDataToDisk(); 4822 4848 4823 4849 if (fastDocumentTeardownEnabled()) -
trunk/Tools/ChangeLog
r196601 r196622 1 2016-02-15 Brent Fulgham <bfulgham@apple.com> 2 3 [Mac] Gather some rudimentary statistics during resource load 4 https://bugs.webkit.org/show_bug.cgi?id=153575 5 <rdar://problem/24075254> 6 7 Reviewed by Brady Eidson. 8 9 * MiniBrowser/mac/SettingsController.h: 10 * MiniBrowser/mac/SettingsController.m: 11 (-[SettingsController _populateMenu]): Add menu item for new debug flag. 12 (-[SettingsController toggleResourceLoadStatisticsEnabled:]): Added. 13 (-[SettingsController resourceLoadStatisticsEnabled]): Added. 14 * MiniBrowser/mac/WK1BrowserWindowController.m: 15 (-[WK1BrowserWindowController didChangeSettings]): React to changes in 16 users's desire to track resource load statistics. 17 1 18 2016-02-15 Csaba Osztrogonác <ossy@webkit.org> 2 19 -
trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm
r195984 r196622 1054 1054 WebStorageDirectoryDefaultsKey: [libraryPath stringByAppendingPathComponent:@"LocalStorage"], 1055 1055 WebKitLocalCacheDefaultsKey: [libraryPath stringByAppendingPathComponent:@"LocalCache"], 1056 WebKitResourceLoadStatisticsDirectoryDefaultsKey: [libraryPath stringByAppendingPathComponent:@"LocalStorage"], 1056 1057 #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101000 1057 1058 // This needs to also be added to argument domain because of <rdar://problem/20210002>. -
trunk/Tools/MiniBrowser/mac/SettingsController.h
r194683 r196622 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 49 49 @property (nonatomic, readonly) BOOL acceleratedDrawingEnabled; 50 50 @property (nonatomic, readonly) BOOL displayListDrawingEnabled; 51 @property (nonatomic, readonly) BOOL resourceLoadStatisticsEnabled; 51 52 @property (nonatomic, readonly) NSString *defaultURL; 52 53 -
trunk/Tools/MiniBrowser/mac/SettingsController.m
r194683 r196622 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2016 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 40 40 static NSString * const AcceleratedDrawingEnabledPreferenceKey = @"AcceleratedDrawingEnabled"; 41 41 static NSString * const DisplayListDrawingEnabledPreferenceKey = @"DisplayListDrawingEnabled"; 42 static NSString * const ResourceLoadStatisticsEnabledPreferenceKey = @"ResourceLoadStatisticsEnabled"; 42 43 43 44 static NSString * const NonFastScrollableRegionOverlayVisiblePreferenceKey = @"NonFastScrollableRegionOverlayVisible"; … … 141 142 [self _addHeaderWithTitle:@"WebKit1-only Settings"]; 142 143 [self _addItemWithTitle:@"Enable Subpixel CSSOM Metrics" action:@selector(toggleEnableSubPixelCSSOMMetrics:) indented:YES]; 144 [self _addItemWithTitle:@"Enable Resource Load Statistics" action:@selector(toggleResourceLoadStatisticsEnabled:) indented:NO]; 143 145 } 144 146 … … 163 165 else if (action == @selector(toggleDisplayListDrawingEnabled:)) 164 166 [menuItem setState:[self displayListDrawingEnabled] ? NSOnState : NSOffState]; 167 else if (action == @selector(toggleResourceLoadStatisticsEnabled:)) 168 [menuItem setState:[self resourceLoadStatisticsEnabled] ? NSOnState : NSOffState]; 165 169 else if (action == @selector(toggleShowTiledScrollingIndicator:)) 166 170 [menuItem setState:[self tiledScrollingIndicatorVisible] ? NSOnState : NSOffState]; … … 317 321 } 318 322 323 - (void)toggleResourceLoadStatisticsEnabled:(id)sender 324 { 325 [self _toggleBooleanDefault:ResourceLoadStatisticsEnabledPreferenceKey]; 326 } 327 328 - (BOOL)resourceLoadStatisticsEnabled 329 { 330 return [[NSUserDefaults standardUserDefaults] boolForKey:ResourceLoadStatisticsEnabledPreferenceKey]; 331 } 332 319 333 - (void)toggleEnableSubPixelCSSOMMetrics:(id)sender 320 334 { -
trunk/Tools/MiniBrowser/mac/WK1BrowserWindowController.m
r192801 r196622 261 261 [[WebPreferences standardPreferences] setSuppressesIncrementalRendering:settings.incrementalRenderingSuppressed]; 262 262 [[WebPreferences standardPreferences] setAcceleratedDrawingEnabled:settings.acceleratedDrawingEnabled]; 263 [[WebPreferences standardPreferences] setResourceLoadStatisticsEnabled:settings.resourceLoadStatisticsEnabled]; 263 264 264 265 BOOL useTransparentWindows = settings.useTransparentWindows;
Note: See TracChangeset
for help on using the changeset viewer.