Snapshotting WKThumbnailViews should not tell Web processes backing unparented WKView...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 22:40:30 +0000 (22:40 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 22:40:30 +0000 (22:40 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134134
<rdar://problem/17402119>

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView _setThumbnailView:]):
Re-evaluating our in-window state is only useful if we're going to use the live layer tree;
snapshots can be taken of unparented views with no trouble. Plus, doing so sets off a chain of
expensive things in the Web process which we can avoid if using snapshots.

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/mac/WKView.mm

index b755901865b2dec7fd83e162446cc482b7637cf1..f1e884a45287edaeefc05eee16bef098f9e2aae2 100644 (file)
@@ -1,3 +1,17 @@
+2014-06-20  Timothy Horton  <timothy_horton@apple.com>
+
+        Snapshotting WKThumbnailViews should not tell Web processes backing unparented WKViews that they're in window
+        https://bugs.webkit.org/show_bug.cgi?id=134134
+        <rdar://problem/17402119>
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView _setThumbnailView:]):
+        Re-evaluating our in-window state is only useful if we're going to use the live layer tree;
+        snapshots can be taken of unparented views with no trouble. Plus, doing so sets off a chain of
+        expensive things in the Web process which we can avoid if using snapshots.
+
 2014-06-20  Timothy Horton  <timothy_horton@apple.com>
 
         WKThumbnailView should only use live layer trees before the snapshot arrives for parented WKViews
index 9c1c205b9e41f2000e1f5a31ad7dc47c53c3f78e..2833cf034e222b26ba41ffea9070f98ca09168bd 100644 (file)
@@ -3515,7 +3515,8 @@ static NSString *pathWithUniqueFilenameForPath(NSString *path)
     else
         [self _setAcceleratedCompositingModeRootLayer:_data->_rootLayer.get()];
 
-    _data->_page->viewStateDidChange(ViewState::WindowIsActive | ViewState::IsInWindow | ViewState::IsVisible);
+    if (!thumbnailView.usesSnapshot)
+        _data->_page->viewStateDidChange(ViewState::WindowIsActive | ViewState::IsInWindow | ViewState::IsVisible);
 }
 
 - (_WKThumbnailView *)_thumbnailView