Lots of API test assertion failures after r163093
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jan 2014 22:49:32 +0000 (22:49 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Jan 2014 22:49:32 +0000 (22:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=127948

Reviewed by Alexey Proskuryakov.

* UIProcess/API/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::processDidExit):
* UIProcess/API/ios/WKContentView.mm:
(-[WKContentView _processDidExit]):
* UIProcess/API/ios/WKContentViewInternal.h:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::processDidExit):
* UIProcess/API/mac/WKView.mm:
(-[WKView _processDidExit]):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::processDidCrash):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/API/mac/WKViewInternal.h:
Rename _processDidCrash to _processDidExit, since it containes cleanup we
should do in both cases. Also, call it whenever a process terminates instead
of just upon a crash. Also clear the ViewGestureController, because its
state doesn't make sense between WebProcesses.

(-[WKView _setCustomSwipeViews:]):
Don't make a ViewGestureController if we don't have one and would be
only creating one to set an empty list of custom swipe views.

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

13 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/API/ios/WKContentView.mm
Source/WebKit2/UIProcess/API/ios/WKContentViewInternal.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewInternal.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp

index 4a25aba..d0f2a3b 100644 (file)
@@ -1,3 +1,34 @@
+2014-01-30  Tim Horton  <timothy_horton@apple.com>
+
+        Lots of API test assertion failures after r163093
+        https://bugs.webkit.org/show_bug.cgi?id=127948
+
+        Reviewed by Alexey Proskuryakov.
+
+        * UIProcess/API/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::processDidExit):
+        * UIProcess/API/ios/WKContentView.mm:
+        (-[WKContentView _processDidExit]):
+        * UIProcess/API/ios/WKContentViewInternal.h:
+        * UIProcess/API/mac/PageClientImpl.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::processDidExit):
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _processDidExit]):
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::processDidCrash):
+        (WebKit::WebPageProxy::resetStateAfterProcessExited):
+        * UIProcess/API/mac/WKViewInternal.h:
+        Rename _processDidCrash to _processDidExit, since it containes cleanup we
+        should do in both cases. Also, call it whenever a process terminates instead
+        of just upon a crash. Also clear the ViewGestureController, because its
+        state doesn't make sense between WebProcesses.
+
+        (-[WKView _setCustomSwipeViews:]):
+        Don't make a ViewGestureController if we don't have one and would be
+        only creating one to set an empty list of custom swipe views.
+
 2014-01-30  Brady Eidson  <beidson@apple.com>
 
         IDB: ObjectStore cursor advance() support
index 09d0b95..4b7da1d 100644 (file)
@@ -116,7 +116,7 @@ bool PageClientImpl::isViewInWindow()
     return webkitWebViewBaseIsInWindow(WEBKIT_WEB_VIEW_BASE(m_viewWidget));
 }
 
-void PageClientImpl::PageClientImpl::processDidCrash()
+void PageClientImpl::PageClientImpl::processDidExit()
 {
     notImplemented();
 }
index 8df35ba..963c2ce 100644 (file)
@@ -70,7 +70,7 @@ private:
     virtual bool isViewFocused() override;
     virtual bool isViewVisible() override;
     virtual bool isViewInWindow() override;
-    virtual void processDidCrash() override;
+    virtual void processDidExit() override;
     virtual void didRelaunchProcess() override;
     virtual void pageClosed() override;
     virtual void preferencesDidChange() override;
index acaf0b0..2e5b2a5 100644 (file)
@@ -55,7 +55,7 @@ private:
     virtual bool isViewFocused() override;
     virtual bool isViewVisible() override;
     virtual bool isViewInWindow() override;
-    virtual void processDidCrash() override;
+    virtual void processDidExit() override;
     virtual void didRelaunchProcess() override;
     virtual void pageClosed() override;
     virtual void preferencesDidChange() override;
index 7b14535..304826b 100644 (file)
@@ -109,9 +109,9 @@ bool PageClientImpl::isViewInWindow()
     return [m_view window];
 }
 
-void PageClientImpl::processDidCrash()
+void PageClientImpl::processDidExit()
 {
-    [m_view _processDidCrash];
+    [m_view _processDidExit];
 }
 
 void PageClientImpl::didRelaunchProcess()
index 8658796..3c4d51b 100644 (file)
@@ -281,7 +281,7 @@ using namespace WebKit;
     return std::make_unique<RemoteLayerTreeDrawingAreaProxy>(_page.get());
 }
 
-- (void)_processDidCrash
+- (void)_processDidExit
 {
     // FIXME: Implement.
 }
index d5844d0..2bf8a0d 100644 (file)
@@ -52,7 +52,7 @@ struct InteractionInformationAtPosition;
 }
 
 - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
-- (void)_processDidCrash;
+- (void)_processDidExit;
 - (void)_didRelaunchProcess;
 - (void)_setAcceleratedCompositingRootLayer:(CALayer *)rootLayer;
 
index 2161f99..dcec1b3 100644 (file)
@@ -72,7 +72,7 @@ private:
     virtual void setAcceleratedCompositingRootLayer(CALayer *) override;
     virtual CALayer *acceleratedCompositingRootLayer() const override;
 
-    virtual void processDidCrash();
+    virtual void processDidExit();
     virtual void pageClosed();
     virtual void didRelaunchProcess();
     virtual void preferencesDidChange() override;
index 3531613..3608c87 100644 (file)
@@ -241,9 +241,9 @@ ColorSpaceData PageClientImpl::colorSpace()
     return [m_wkView _colorSpace];
 }
 
-void PageClientImpl::processDidCrash()
+void PageClientImpl::processDidExit()
 {
-    [m_wkView _processDidCrash];
+    [m_wkView _processDidExit];
 }
 
 void PageClientImpl::pageClosed()
index 4914eb7..aa0bdfb 100644 (file)
@@ -2219,12 +2219,14 @@ static void createSandboxExtensionsForFileUpload(NSPasteboard *pasteboard, Sandb
     return colorSpaceData;    
 }
 
-- (void)_processDidCrash
+- (void)_processDidExit
 {
     if (_data->_layerHostingView)
         [self _setAcceleratedCompositingModeRootLayer:nil];
 
     [self _updateRemoteAccessibilityRegistration:NO];
+
+    _data->_gestureController = nullptr;
 }
 
 - (void)_pageClosed
@@ -3338,6 +3340,9 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
 
 - (void)_setCustomSwipeViews:(NSArray *)customSwipeViews
 {
+    if (!customSwipeViews.count && !_data->_gestureController)
+        return;
+
     [self _ensureGestureController];
 
     Vector<RetainPtr<NSView>> views;
index a1790fe..4e44e3c 100644 (file)
@@ -59,7 +59,7 @@ namespace WebKit {
 
 - (std::unique_ptr<WebKit::DrawingAreaProxy>)_createDrawingAreaProxy;
 - (BOOL)_isFocused;
-- (void)_processDidCrash;
+- (void)_processDidExit;
 - (void)_pageClosed;
 - (void)_didRelaunchProcess;
 - (void)_preferencesDidChange;
index 9f8ada7..291ea59 100644 (file)
@@ -117,7 +117,7 @@ public:
     // Return the layer hosting mode for the view.
     virtual LayerHostingMode viewLayerHostingMode() { return LayerHostingModeDefault; }
 
-    virtual void processDidCrash() = 0;
+    virtual void processDidExit() = 0;
     virtual void didRelaunchProcess() = 0;
     virtual void pageClosed() = 0;
 
index ea4a5f9..b2f6b3c 100644 (file)
@@ -3749,12 +3749,10 @@ void WebPageProxy::processDidCrash()
 
     resetStateAfterProcessExited();
 
+    // FIXME: Should we do this when the process exits cleanly, instead of just upon crashing?
     auto transaction = m_pageLoadState.transaction();
-
     m_pageLoadState.reset(transaction);
 
-    m_pageClient.processDidCrash();
-
     m_loaderClient->processDidCrash(this);
 }
 
@@ -3856,6 +3854,8 @@ void WebPageProxy::resetStateAfterProcessExited()
 
     resetState();
 
+    m_pageClient.processDidExit();
+
     m_pageClient.clearAllEditCommands();
     m_pendingLearnOrIgnoreWordMessageCount = 0;