Add WKWebView SPI to forcefully kill the associated Web process
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 May 2014 21:48:05 +0000 (21:48 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 May 2014 21:48:05 +0000 (21:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133357

Reviewed by Anders Carlsson.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _killWebContentProcess]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h

index 7a79da787d15ef2e25fc1a7b3d724ea467157207..2c8e8e5c1a488233dc30bbd7efae055f63381169 100644 (file)
@@ -1,3 +1,14 @@
+2014-05-28  Timothy Horton  <timothy_horton@apple.com>
+
+        Add WKWebView SPI to forcefully kill the associated Web process
+        https://bugs.webkit.org/show_bug.cgi?id=133357
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _killWebContentProcess]):
+        * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+
 2014-05-28  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Crash when trying to decode an instance of a class inheriting from WKObject
index 1db065c7ca66c4f62b10291fd4ebf3715bc67efd..cb528a0a19e502af922a477cba3de2b76710e773 100644 (file)
@@ -1288,6 +1288,14 @@ static WebCore::FloatPoint constrainContentOffset(WebCore::FloatPoint contentOff
     return _page->isValid() ? _page->processIdentifier() : 0;
 }
 
+- (void)_killWebContentProcess
+{
+    if (!_page->isValid())
+        return;
+
+    _page->process().terminate();
+}
+
 - (NSData *)_sessionState
 {
     return [wrapper(*_page->sessionStateData(nullptr, nullptr).leakRef()) autorelease];
index 53b06a52df744388ce62038a576a6a2c5df86699..3df2a0da4cde1701c6390526b1276fda89c2ca44 100644 (file)
@@ -136,6 +136,8 @@ typedef NS_OPTIONS(NSUInteger, _WKFindOptions) {
 
 - (void)_setOverlaidAccessoryViewsInset:(CGSize)inset;
 
+- (void)_killWebContentProcess;
+
 // FIXME: Remove this once nobody uses it.
 @property (nonatomic, readonly) NSURL *activeURL;