Title: [166374] trunk/Source/WebKit2
Revision
166374
Author
wei...@apple.com
Date
2014-03-27 15:30:53 -0700 (Thu, 27 Mar 2014)

Log Message

Support dynamic layer hosting context changes
<rdar://problem/16278019>
https://bugs.webkit.org/show_bug.cgi?id=130863

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView addWindowObserversForWindow:]):
(-[WKView removeWindowObservers]):
(-[WKView _windowDidChangeLayerHosting:]):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::layerHostingModeDidChange):
* UIProcess/WebPageProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (166373 => 166374)


--- trunk/Source/WebKit2/ChangeLog	2014-03-27 22:28:04 UTC (rev 166373)
+++ trunk/Source/WebKit2/ChangeLog	2014-03-27 22:30:53 UTC (rev 166374)
@@ -1,3 +1,19 @@
+2014-03-27  Sam Weinig  <s...@webkit.org>
+
+        Support dynamic layer hosting context changes
+        <rdar://problem/16278019>
+        https://bugs.webkit.org/show_bug.cgi?id=130863
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView addWindowObserversForWindow:]):
+        (-[WKView removeWindowObservers]):
+        (-[WKView _windowDidChangeLayerHosting:]):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::layerHostingModeDidChange):
+        * UIProcess/WebPageProxy.h:
+
 2014-03-27  Simon Fraser  <simon.fra...@apple.com>
 
         Don't leak the WKBrowsingContextController

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (166373 => 166374)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-03-27 22:28:04 UTC (rev 166373)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-03-27 22:30:53 UTC (rev 166374)
@@ -2373,6 +2373,8 @@
                                                      name:NSWindowDidChangeBackingPropertiesNotification object:window];
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeScreen:)
                                                      name:NSWindowDidChangeScreenNotification object:window];
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeLayerHosting:)
+                                                     name:@"_NSWindowDidChangeContentsHostedInLayerSurfaceNotification" object:window];
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
         [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_windowDidChangeOcclusionState:)
                                                      name:NSWindowDidChangeOcclusionStateNotification object:window];
@@ -2397,6 +2399,7 @@
     [[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidBecomeVisible" object:window];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeBackingPropertiesNotification object:window];
     [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeScreenNotification object:window];
+    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"_NSWindowDidChangeContentsHostedInLayerSurfaceNotification" object:window];
 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090
     [[NSNotificationCenter defaultCenter] removeObserver:self name:NSWindowDidChangeOcclusionStateNotification object:window];
 #endif
@@ -2472,6 +2475,11 @@
     [self doWindowDidChangeScreen];
 }
 
+- (void)_windowDidChangeLayerHosting:(NSNotification *)notification
+{
+    _data->_page->layerHostingModeDidChange();
+}
+
 - (void)_windowDidResignKey:(NSNotification *)notification
 {
     NSWindow *formerKeyWindow = [notification object];

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (166373 => 166374)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-03-27 22:28:04 UTC (rev 166373)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-03-27 22:30:53 UTC (rev 166374)
@@ -1054,6 +1054,19 @@
     updateBackingStoreDiscardableState();
 }
 
+void WebPageProxy::layerHostingModeDidChange()
+{
+    if (!isValid())
+        return;
+
+    LayerHostingMode layerHostingMode = m_pageClient.viewLayerHostingMode();
+    if (m_layerHostingMode == layerHostingMode)
+        return;
+
+    m_layerHostingMode = layerHostingMode;
+    m_process->send(Messages::WebPage::SetLayerHostingMode(static_cast<unsigned>(layerHostingMode)), m_pageID);
+}
+
 void WebPageProxy::waitForDidUpdateViewState()
 {
     // If we have previously timed out with no response from the WebProcess, don't block the UIProcess again until it starts responding.

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (166373 => 166374)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-03-27 22:28:04 UTC (rev 166373)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-03-27 22:30:53 UTC (rev 166374)
@@ -555,6 +555,8 @@
     bool isInWindow() const { return m_viewState & WebCore::ViewState::IsInWindow; }
     void waitForDidUpdateViewState();
 
+    void layerHostingModeDidChange();
+
     WebCore::IntSize viewSize() const;
     bool isViewVisible() const { return m_viewState & WebCore::ViewState::IsVisible; }
     bool isViewWindowActive() const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to