All of MiniBrowser's WKWebViews should share a configuration
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jun 2014 22:19:41 +0000 (22:19 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jun 2014 22:19:41 +0000 (22:19 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134017

Reviewed by Anders Carlsson.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
Share a single WKWebViewConfiguration between all of MiniBrowser's views.
This means that they'll share things like preferences, visited links, etc.
It also means that we'll properly share processes once we hit the process limit.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170122 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/MiniBrowser/mac/WK2BrowserWindowController.m

index 74baf5fb19cda0f71c80990186943d6b517b0f8b..a7c0b36b7c9642709e218d7df682a8d9c81abd8d 100644 (file)
@@ -1,3 +1,16 @@
+2014-06-18  Tim Horton  <timothy_horton@apple.com>
+
+        All of MiniBrowser's WKWebViews should share a configuration
+        https://bugs.webkit.org/show_bug.cgi?id=134017
+
+        Reviewed by Anders Carlsson.
+
+        * MiniBrowser/mac/WK2BrowserWindowController.m:
+        (-[WK2BrowserWindowController awakeFromNib]):
+        Share a single WKWebViewConfiguration between all of MiniBrowser's views.
+        This means that they'll share things like preferences, visited links, etc.
+        It also means that we'll properly share processes once we hit the process limit.
+
 2014-06-18  Zan Dobersek  <zdobersek@igalia.com>
 
         [GTK] Bump the GLib and GTK+ dependencies in jhbuild-wayland.modules
index 97a39ccc84a0f1713b58969d28129b350975cadf..f70fd903f2210b6a7115630d99c93a42a518beba 100644 (file)
@@ -32,6 +32,7 @@
 #import <WebKit/WKNavigationDelegate.h>
 #import <WebKit/WKUIDelegate.h>
 #import <WebKit/WKWebView.h>
+#import <WebKit/WKWebViewConfiguration.h>
 #import <WebKit/WKWebViewPrivate.h>
 
 static void* keyValueObservingContext = &keyValueObservingContext;
@@ -48,7 +49,10 @@ static NSString * const WebKit2SubpixelCSSOMElementMetricsEnabledKey = @"WebKitS
 
 - (void)awakeFromNib
 {
-    _webView = [[WKWebView alloc] initWithFrame:[containerView bounds]];
+    static WKWebViewConfiguration *configuration;
+    if (!configuration)
+        configuration = [[WKWebViewConfiguration alloc] init];
+    _webView = [[WKWebView alloc] initWithFrame:[containerView bounds] configuration:configuration];
 
     _webView.allowsMagnification = YES;
     _webView.allowsBackForwardNavigationGestures = YES;