Title: [121482] trunk/Source/WebKit2
- Revision
- 121482
- Author
- [email protected]
- Date
- 2012-06-28 16:12:48 -0700 (Thu, 28 Jun 2012)
Log Message
<https://bugs.webkit.org/show_bug.cgi?id=90216>
<rdar://problem/11766518>
Undo handling in WebKit2 is not robust against some page-closing code paths
Reviewed by Enrica Casucci.
* UIProcess/API/mac/PageClientImpl.h:
Declared public function viewWillMoveToAnotherWindow().
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::viewWillMoveToAnotherWindow):
New function, calls clearAllEditCommands() to remove any Undo actions from the stack.
This guarantees that no Undo actions will be abandoned when the PageClientImpl is dealloc'ed.
* UIProcess/API/mac/WKView.mm:
(-[WKView viewWillMoveToWindow:]):
Now informs PageClientImpl via new function PageClientImpl::viewWillMoveToAnotherWindow().
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (121481 => 121482)
--- trunk/Source/WebKit2/ChangeLog 2012-06-28 23:05:59 UTC (rev 121481)
+++ trunk/Source/WebKit2/ChangeLog 2012-06-28 23:12:48 UTC (rev 121482)
@@ -1,3 +1,23 @@
+2012-06-28 John Sullivan <[email protected]>
+
+ <https://bugs.webkit.org/show_bug.cgi?id=90216>
+ <rdar://problem/11766518>
+ Undo handling in WebKit2 is not robust against some page-closing code paths
+
+ Reviewed by Enrica Casucci.
+
+ * UIProcess/API/mac/PageClientImpl.h:
+ Declared public function viewWillMoveToAnotherWindow().
+
+ * UIProcess/API/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::viewWillMoveToAnotherWindow):
+ New function, calls clearAllEditCommands() to remove any Undo actions from the stack.
+ This guarantees that no Undo actions will be abandoned when the PageClientImpl is dealloc'ed.
+
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView viewWillMoveToWindow:]):
+ Now informs PageClientImpl via new function PageClientImpl::viewWillMoveToAnotherWindow().
+
2012-06-28 Christophe Dumez <[email protected]>
[WK2] Add C API to inspect a Web Intent service
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (121481 => 121482)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2012-06-28 23:05:59 UTC (rev 121481)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2012-06-28 23:12:48 UTC (rev 121482)
@@ -44,6 +44,8 @@
public:
static PassOwnPtr<PageClientImpl> create(WKView*);
virtual ~PageClientImpl();
+
+ void viewWillMoveToAnotherWindow();
private:
PageClientImpl(WKView*);
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (121481 => 121482)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2012-06-28 23:05:59 UTC (rev 121481)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2012-06-28 23:12:48 UTC (rev 121482)
@@ -201,6 +201,11 @@
return [m_wkView window];
}
+void PageClientImpl::viewWillMoveToAnotherWindow()
+{
+ clearAllEditCommands();
+}
+
LayerHostingMode PageClientImpl::viewLayerHostingMode()
{
#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (121481 => 121482)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-06-28 23:05:59 UTC (rev 121481)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2012-06-28 23:12:48 UTC (rev 121482)
@@ -1883,6 +1883,8 @@
if (window == currentWindow)
return;
+ _data->_pageClient->viewWillMoveToAnotherWindow();
+
[self removeWindowObservers];
[self addWindowObserversForWindow:window];
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes