Title: [209717] trunk/Tools
Revision
209717
Author
[email protected]
Date
2016-12-12 11:49:56 -0800 (Mon, 12 Dec 2016)

Log Message

Enable network cache speculative revalidation in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=165616

Reviewed by Darin Adler.

Match Safari. Also add a menu item to disable it.

* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration):
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController networkCacheSpeculativeRevalidationDisabled]):
(-[SettingsController toggleNetworkCacheSpeculativeRevalidationDisabled:]):

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (209716 => 209717)


--- trunk/Tools/ChangeLog	2016-12-12 18:59:39 UTC (rev 209716)
+++ trunk/Tools/ChangeLog	2016-12-12 19:49:56 UTC (rev 209717)
@@ -1,3 +1,21 @@
+2016-12-08  Antti Koivisto  <[email protected]>
+
+        Enable network cache speculative revalidation in MiniBrowser
+        https://bugs.webkit.org/show_bug.cgi?id=165616
+
+        Reviewed by Darin Adler.
+
+        Match Safari. Also add a menu item to disable it.
+
+        * MiniBrowser/mac/AppDelegate.m:
+        (defaultConfiguration):
+        * MiniBrowser/mac/SettingsController.h:
+        * MiniBrowser/mac/SettingsController.m:
+        (-[SettingsController _populateMenu]):
+        (-[SettingsController validateMenuItem:]):
+        (-[SettingsController networkCacheSpeculativeRevalidationDisabled]):
+        (-[SettingsController toggleNetworkCacheSpeculativeRevalidationDisabled:]):
+
 2016-12-12  Alexey Proskuryakov  <[email protected]>
 
         ChangeLogs become readonly after resolving a conflict

Modified: trunk/Tools/MiniBrowser/mac/AppDelegate.m (209716 => 209717)


--- trunk/Tools/MiniBrowser/mac/AppDelegate.m	2016-12-12 18:59:39 UTC (rev 209716)
+++ trunk/Tools/MiniBrowser/mac/AppDelegate.m	2016-12-12 19:49:56 UTC (rev 209717)
@@ -92,12 +92,12 @@
         configuration.preferences._fullScreenEnabled = YES;
         configuration.preferences._developerExtrasEnabled = YES;
 
-        if ([SettingsController shared].perWindowWebProcessesDisabled) {
-            _WKProcessPoolConfiguration *singleProcessConfiguration = [[_WKProcessPoolConfiguration alloc] init];
-            singleProcessConfiguration.maximumProcessCount = 1;
-            configuration.processPool = [[[WKProcessPool alloc] _initWithConfiguration:singleProcessConfiguration] autorelease];
-            [singleProcessConfiguration release];
-        }
+        _WKProcessPoolConfiguration *processConfiguration = [[[_WKProcessPoolConfiguration alloc] init] autorelease];
+        processConfiguration.diskCacheSpeculativeValidationEnabled = ![SettingsController shared].networkCacheSpeculativeRevalidationDisabled;
+        if ([SettingsController shared].perWindowWebProcessesDisabled)
+            processConfiguration.maximumProcessCount = 1;
+        
+        configuration.processPool = [[[WKProcessPool alloc] _initWithConfiguration:processConfiguration] autorelease];
 
 #if WK_API_ENABLED
         NSArray<_WKExperimentalFeature *> *features = [WKPreferences _experimentalFeatures];

Modified: trunk/Tools/MiniBrowser/mac/SettingsController.h (209716 => 209717)


--- trunk/Tools/MiniBrowser/mac/SettingsController.h	2016-12-12 18:59:39 UTC (rev 209716)
+++ trunk/Tools/MiniBrowser/mac/SettingsController.h	2016-12-12 19:49:56 UTC (rev 209717)
@@ -54,6 +54,7 @@
 @property (nonatomic, readonly) BOOL animatedImageAsyncDecodingEnabled;
 @property (nonatomic, readonly) BOOL loadsAllSiteIcons;
 @property (nonatomic, readonly) BOOL usesGameControllerFramework;
+@property (nonatomic, readonly) BOOL networkCacheSpeculativeRevalidationDisabled;
 
 @property (nonatomic, readonly) NSString *defaultURL;
 

Modified: trunk/Tools/MiniBrowser/mac/SettingsController.m (209716 => 209717)


--- trunk/Tools/MiniBrowser/mac/SettingsController.m	2016-12-12 18:59:39 UTC (rev 209716)
+++ trunk/Tools/MiniBrowser/mac/SettingsController.m	2016-12-12 19:49:56 UTC (rev 209717)
@@ -63,6 +63,7 @@
 static NSString * const UseRemoteLayerTreeDrawingAreaPreferenceKey = @"WebKit2UseRemoteLayerTreeDrawingArea";
 
 static NSString * const PerWindowWebProcessesDisabledKey = @"PerWindowWebProcessesDisabled";
+static NSString * const NetworkCacheSpeculativeRevalidationDisabledKey = @"NetworkCacheSpeculativeRevalidationDisabled";
 
 typedef NS_ENUM(NSInteger, DebugOverylayMenuItemTag) {
     NonFastScrollableRegionOverlayTag = 100,
@@ -140,6 +141,7 @@
     [self _addItemWithTitle:@"Show Resource Usage Overlay" action:@selector(toggleShowResourceUsageOverlay:) indented:YES];
     [self _addItemWithTitle:@"Load All Site Icons Per-Page" action:@selector(toggleLoadsAllSiteIcons:) indented:YES];
     [self _addItemWithTitle:@"Use GameController.framework on macOS (Restart required)" action:@selector(toggleUsesGameControllerFramework:) indented:YES];
+    [self _addItemWithTitle:@"Disable network cache speculative revalidation" action:@selector(toggleNetworkCacheSpeculativeRevalidationDisabled:) indented:YES];
 
     NSMenuItem *debugOverlaysSubmenuItem = [[NSMenuItem alloc] initWithTitle:@"Debug Overlays" action:nil keyEquivalent:@""];
     NSMenu *debugOverlaysMenu = [[NSMenu alloc] initWithTitle:@"Debug Overlays"];
@@ -219,6 +221,8 @@
         [menuItem setState:[self loadsAllSiteIcons] ? NSOnState : NSOffState];
     else if (action == @selector(toggleUsesGameControllerFramework:))
         [menuItem setState:[self usesGameControllerFramework] ? NSOnState : NSOffState];
+    else if (action == @selector(toggleNetworkCacheSpeculativeRevalidationDisabled:))
+        [menuItem setState:[self networkCacheSpeculativeRevalidationDisabled] ? NSOnState : NSOffState];
     else if (action == @selector(toggleUseUISideCompositing:))
         [menuItem setState:[self useUISideCompositing] ? NSOnState : NSOffState];
     else if (action == @selector(togglePerWindowWebProcessesDisabled:))
@@ -386,6 +390,16 @@
     [self _toggleBooleanDefault:UsesGameControllerFrameworkKey];
 }
 
+- (BOOL)networkCacheSpeculativeRevalidationDisabled
+{
+    return [[NSUserDefaults standardUserDefaults] boolForKey:NetworkCacheSpeculativeRevalidationDisabledKey];
+}
+
+- (void)toggleNetworkCacheSpeculativeRevalidationDisabled:(id)sender
+{
+    [self _toggleBooleanDefault:NetworkCacheSpeculativeRevalidationDisabledKey];
+}
+
 - (BOOL)tiledScrollingIndicatorVisible
 {
     return [[NSUserDefaults standardUserDefaults] boolForKey:TiledScrollingIndicatorVisiblePreferenceKey];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to