[wk2] PlatformCALayerRemoteCustom doesn't work on iOS
https://bugs.webkit.org/show_bug.cgi?id=128025
<rdar://problem/15950271>

Reviewed by Simon Fraser.

* Platform/mac/LayerHostingContext.h:
* Platform/mac/LayerHostingContext.mm:
(WebKit::LayerHostingContext::createForPort):
(WebKit::LayerHostingContext::createForExternalHostingProcess):
Use the new macro name (in a lot of places).
Rename LayerHostingContext::createForWindowServer() to createForExternalHostingProcess().
Don't use WKCAContextMakeRemoteForWindowServer on iOS, just use the CAContext
SPI directly. We don't want our CAContext to be hit tested because it's purely
presentational.

* UIProcess/API/ios/PageClientImplIOS.h:
iOS always hosts layers in an external process.

* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::updateLayerHostingContext):
* Shared/LayerTreeContext.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::viewLayerHostingMode):
* UIProcess/PageClient.h:
(WebKit::PageClient::viewLayerHostingMode):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::viewStateDidChange):
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::NetscapePlugin):
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::compositingRenderServerPort):
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setLayerHostingMode):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):
* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
(PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext):
Use enum class for LayerHostingMode and rename the members to InProcess and OutOfProcess.

* Plugins/Hosted/WebHostedNetscapePluginView.mm:
(-[WebHostedNetscapePluginView windowHostsLayersInWindowServer]):
Use the new macro name.

* wtf/Platform.h:
Rename HAVE_LAYER_HOSTING_IN_WINDOW_SERVER to HAVE_OUT_OF_PROCESS_LAYER_HOSTING
and make it true on iOS.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog
index c868279..f9a9e81 100644
--- a/Source/WTF/ChangeLog
+++ b/Source/WTF/ChangeLog
@@ -1,3 +1,15 @@
+2014-01-31  Tim Horton  <timothy_horton@apple.com>
+
+        [wk2] PlatformCALayerRemoteCustom doesn't work on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=128025
+        <rdar://problem/15950271>
+
+        Reviewed by Simon Fraser.
+
+        * wtf/Platform.h:
+        Rename HAVE_LAYER_HOSTING_IN_WINDOW_SERVER to HAVE_OUT_OF_PROCESS_LAYER_HOSTING
+        and make it true on iOS.
+
 2014-01-31  Michael Saboff  <msaboff@apple.com>
 
         REGRESSION: Crash in sanitizeStackForVMImpl when scrolling @ lifehacker.com.au
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index dd112e3..a896530 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -477,6 +477,10 @@
 
 #endif
 
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080)
+#define HAVE_OUT_OF_PROCESS_LAYER_HOSTING 1
+#endif
+
 #if PLATFORM(MAC) && !PLATFORM(IOS)
 
 #define WTF_USE_APPKIT 1
@@ -488,10 +492,6 @@
 #define WTF_USE_PLUGIN_HOST_PROCESS 1
 #endif
 
-#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 1080
-#define HAVE_LAYER_HOSTING_IN_WINDOW_SERVER 1
-#endif
-
 /* OS X defines a series of platform macros for debugging. */
 /* Some of them are really annoying because they use common names (e.g. check()). */
 /* Disable those macros so that we are not limited in how we name methods and functions. */
diff --git a/Source/WebKit/mac/ChangeLog b/Source/WebKit/mac/ChangeLog
index f852c48..6db3bd9 100644
--- a/Source/WebKit/mac/ChangeLog
+++ b/Source/WebKit/mac/ChangeLog
@@ -1,3 +1,15 @@
+2014-01-31  Tim Horton  <timothy_horton@apple.com>
+
+        [wk2] PlatformCALayerRemoteCustom doesn't work on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=128025
+        <rdar://problem/15950271>
+
+        Reviewed by Simon Fraser.
+
+        * Plugins/Hosted/WebHostedNetscapePluginView.mm:
+        (-[WebHostedNetscapePluginView windowHostsLayersInWindowServer]):
+        Use the new macro name.
+
 2014-01-30  David Kilzer  <ddkilzer@apple.com>
 
         Add security-checked cast for WebCore::CachedImage
diff --git a/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm b/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
index 54a3d48..f24dfd2 100644
--- a/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
+++ b/Source/WebKit/mac/Plugins/Hosted/WebHostedNetscapePluginView.mm
@@ -61,7 +61,7 @@
 #include "WebKitPluginHost.h"
 }
 
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
 @interface NSWindow (Details)
 - (BOOL)_hostsLayersInWindowServer;
 @end
@@ -114,7 +114,7 @@
 
 - (BOOL)windowHostsLayersInWindowServer
 {
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
     return [[[self webView] window] _hostsLayersInWindowServer];
 #else
     return false;
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 0a50ceb..c5a02ee 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,48 @@
+2014-01-31  Tim Horton  <timothy_horton@apple.com>
+
+        [wk2] PlatformCALayerRemoteCustom doesn't work on iOS
+        https://bugs.webkit.org/show_bug.cgi?id=128025
+        <rdar://problem/15950271>
+
+        Reviewed by Simon Fraser.
+
+        * Platform/mac/LayerHostingContext.h:
+        * Platform/mac/LayerHostingContext.mm:
+        (WebKit::LayerHostingContext::createForPort):
+        (WebKit::LayerHostingContext::createForExternalHostingProcess):
+        Use the new macro name (in a lot of places).
+        Rename LayerHostingContext::createForWindowServer() to createForExternalHostingProcess().
+        Don't use WKCAContextMakeRemoteForWindowServer on iOS, just use the CAContext
+        SPI directly. We don't want our CAContext to be hit tested because it's purely
+        presentational.
+
+        * UIProcess/API/ios/PageClientImplIOS.h:
+        iOS always hosts layers in an external process.
+
+        * PluginProcess/mac/PluginControllerProxyMac.mm:
+        (WebKit::PluginControllerProxy::updateLayerHostingContext):
+        * Shared/LayerTreeContext.h:
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit::PageClientImpl::viewLayerHostingMode):
+        * UIProcess/PageClient.h:
+        (WebKit::PageClient::viewLayerHostingMode):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::viewStateDidChange):
+        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+        (WebKit::NetscapePlugin::NetscapePlugin):
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        (WebKit::NetscapePlugin::compositingRenderServerPort):
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::setLayerHostingMode):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::reinitializeWebPage):
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
+        (PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::updateLayerHostingContext):
+        Use enum class for LayerHostingMode and rename the members to InProcess and OutOfProcess.
+
 2014-01-31  Martin Hock  <mhock@apple.com>
 
         Add session support to WebPlatformStrategies
diff --git a/Source/WebKit2/Platform/mac/LayerHostingContext.h b/Source/WebKit2/Platform/mac/LayerHostingContext.h
index 1bbaced..bb9104e 100644
--- a/Source/WebKit2/Platform/mac/LayerHostingContext.h
+++ b/Source/WebKit2/Platform/mac/LayerHostingContext.h
@@ -40,8 +40,8 @@
     WTF_MAKE_NONCOPYABLE(LayerHostingContext);
 public:
     static std::unique_ptr<LayerHostingContext> createForPort(mach_port_t serverPort);
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-    static std::unique_ptr<LayerHostingContext> createForWindowServer();
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+    static std::unique_ptr<LayerHostingContext> createForExternalHostingProcess();
 #endif
 
     LayerHostingContext();
diff --git a/Source/WebKit2/Platform/mac/LayerHostingContext.mm b/Source/WebKit2/Platform/mac/LayerHostingContext.mm
index 4f5d481..daab07b 100644
--- a/Source/WebKit2/Platform/mac/LayerHostingContext.mm
+++ b/Source/WebKit2/Platform/mac/LayerHostingContext.mm
@@ -29,26 +29,43 @@
 #import <wtf/OwnPtr.h>
 #import <WebKitSystemInterface.h>
 
+#if __has_include(<QuartzCore/QuartzCorePrivate.h>)
+#import <QuartzCore/QuartzCorePrivate.h>
+#else
+@interface CAContext : NSObject
+@end
+#endif
+
+@interface CAContext (Details)
++ (CAContext *)remoteContextWithOptions:(NSDictionary *)dict;
+@end
+
+extern NSString * const kCAContextIgnoresHitTest;
+
 namespace WebKit {
 
 std::unique_ptr<LayerHostingContext> LayerHostingContext::createForPort(mach_port_t serverPort)
 {
     auto layerHostingContext = std::make_unique<LayerHostingContext>();
 
-    layerHostingContext->m_layerHostingMode = LayerHostingModeDefault;
+    layerHostingContext->m_layerHostingMode = LayerHostingMode::InProcess;
     layerHostingContext->m_context = WKCAContextMakeRemoteWithServerPort(serverPort);
 
     return layerHostingContext;
 }
 
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-std::unique_ptr<LayerHostingContext> LayerHostingContext::createForWindowServer()
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+std::unique_ptr<LayerHostingContext> LayerHostingContext::createForExternalHostingProcess()
 {
     auto layerHostingContext = std::make_unique<LayerHostingContext>();
+    layerHostingContext->m_layerHostingMode = LayerHostingMode::OutOfProcess;
 
-    layerHostingContext->m_layerHostingMode = LayerHostingModeInWindowServer;
+#if PLATFORM(IOS)
+    layerHostingContext->m_context = (WKCAContextRef)[CAContext remoteContextWithOptions:@{ kCAContextIgnoresHitTest : @YES }];
+#else
     layerHostingContext->m_context = WKCAContextMakeRemoteForWindowServer();
-
+#endif
+    
     return layerHostingContext;
 }
 #endif
diff --git a/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm b/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm
index bbe1195..f6d427a 100644
--- a/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm
+++ b/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm
@@ -139,12 +139,12 @@
     }
 
     switch (layerHostingMode) {
-        case LayerHostingModeDefault:
+        case LayerHostingMode::InProcess:
             m_layerHostingContext = LayerHostingContext::createForPort(PluginProcess::shared().compositingRenderServerPort());
             break;
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-        case LayerHostingModeInWindowServer:
-            m_layerHostingContext = LayerHostingContext::createForWindowServer();
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+        case LayerHostingMode::OutOfProcess:
+            m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess();
             break;
 #endif
     }
diff --git a/Source/WebKit2/Shared/LayerTreeContext.h b/Source/WebKit2/Shared/LayerTreeContext.h
index 94296fb..51a15ce 100644
--- a/Source/WebKit2/Shared/LayerTreeContext.h
+++ b/Source/WebKit2/Shared/LayerTreeContext.h
@@ -35,10 +35,10 @@
 
 namespace WebKit {
 
-enum LayerHostingMode {
-    LayerHostingModeDefault,
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-    LayerHostingModeInWindowServer
+enum class LayerHostingMode {
+    InProcess,
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+    OutOfProcess
 #endif
 };
 
diff --git a/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.h b/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.h
index 2e5b2a5..43f7731 100644
--- a/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.h
+++ b/Source/WebKit2/UIProcess/API/ios/PageClientImplIOS.h
@@ -95,6 +95,7 @@
     virtual void updateAcceleratedCompositingMode(const LayerTreeContext&) override;
     virtual void setAcceleratedCompositingRootLayer(CALayer *rootLayer) override;
     virtual CALayer *acceleratedCompositingRootLayer() const override;
+    virtual LayerHostingMode viewLayerHostingMode() override { return LayerHostingMode::OutOfProcess; }
 
     virtual RetainPtr<CGImageRef> takeViewSnapshot() override;
     virtual void wheelEventWasNotHandledByWebCore(const NativeWebWheelEvent&) override;
diff --git a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
index 3608c87..d3203ff 100644
--- a/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
+++ b/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
@@ -64,7 +64,7 @@
 - (NSCursor *)_cursorRectCursor;
 @end
 
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
 @interface NSWindow (WebNSWindowDetails)
 - (BOOL)_hostsLayersInWindowServer;
 @end
@@ -224,11 +224,11 @@
 
 LayerHostingMode PageClientImpl::viewLayerHostingMode()
 {
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
     if ([m_wkView window] && [[m_wkView window] _hostsLayersInWindowServer])
-        return LayerHostingModeInWindowServer;
+        return LayerHostingMode::OutOfProcess;
 #endif
-    return LayerHostingModeDefault;
+    return LayerHostingMode::InProcess;
 }
 
 void PageClientImpl::viewWillMoveToAnotherWindow()
diff --git a/Source/WebKit2/UIProcess/PageClient.h b/Source/WebKit2/UIProcess/PageClient.h
index 291ea59..9f20a66 100644
--- a/Source/WebKit2/UIProcess/PageClient.h
+++ b/Source/WebKit2/UIProcess/PageClient.h
@@ -115,7 +115,7 @@
     virtual bool isVisuallyIdle() { return !isViewVisible(); }
 
     // Return the layer hosting mode for the view.
-    virtual LayerHostingMode viewLayerHostingMode() { return LayerHostingModeDefault; }
+    virtual LayerHostingMode viewLayerHostingMode() { return LayerHostingMode::InProcess; }
 
     virtual void processDidExit() = 0;
     virtual void didRelaunchProcess() = 0;
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index a6b8912..9fb6640 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -263,7 +263,7 @@
     , m_pageScaleFactor(1)
     , m_intrinsicDeviceScaleFactor(1)
     , m_customDeviceScaleFactor(0)
-    , m_layerHostingMode(LayerHostingModeDefault)
+    , m_layerHostingMode(LayerHostingMode::InProcess)
     , m_drawsBackground(true)
     , m_drawsTransparentBackground(false)
     , m_areMemoryCacheClientCallsEnabled(true)
@@ -328,8 +328,8 @@
 {
     updateViewState();
 
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-    m_layerHostingMode = m_viewState & ViewState::IsInWindow ? m_pageClient.viewLayerHostingMode() : LayerHostingModeInWindowServer;
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+    m_layerHostingMode = m_viewState & ViewState::IsInWindow ? m_pageClient.viewLayerHostingMode() : LayerHostingMode::OutOfProcess;
 #endif
 
     platformInitialize();
@@ -982,7 +982,7 @@
         LayerHostingMode layerHostingMode = m_pageClient.viewLayerHostingMode();
         if (m_layerHostingMode != layerHostingMode) {
             m_layerHostingMode = layerHostingMode;
-            m_process->send(Messages::WebPage::SetLayerHostingMode(layerHostingMode), m_pageID);
+            m_process->send(Messages::WebPage::SetLayerHostingMode(static_cast<unsigned>(layerHostingMode)), m_pageID);
         }
     }
 
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index 868d8c6..b600a59 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -76,7 +76,7 @@
     , m_drawingModel(static_cast<NPDrawingModel>(-1))
     , m_eventModel(static_cast<NPEventModel>(-1))
     , m_pluginReturnsNonretainedLayer(!m_pluginModule->pluginQuirks().contains(PluginQuirks::ReturnsRetainedCoreAnimationLayer))
-    , m_layerHostingMode(LayerHostingModeDefault)
+    , m_layerHostingMode(LayerHostingMode::InProcess)
     , m_currentMouseEvent(0)
     , m_pluginHasFocus(false)
     , m_windowHasFocus(false)
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
index 561e58c..488713d 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
@@ -171,8 +171,8 @@
 
 mach_port_t NetscapePlugin::compositingRenderServerPort()
 {
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-    if (m_layerHostingMode == LayerHostingModeInWindowServer)
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+    if (m_layerHostingMode == LayerHostingMode::OutOfProcess)
         return MACH_PORT_NULL;
 #endif
 
diff --git a/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm b/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm
index 6fca2be..15119d8 100644
--- a/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm
+++ b/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm
@@ -86,7 +86,7 @@
 
 void PluginProxy::setLayerHostingMode(LayerHostingMode layerHostingMode)
 {
-    m_connection->connection()->send(Messages::PluginControllerProxy::SetLayerHostingMode(layerHostingMode), m_pluginInstanceID);
+    m_connection->connection()->send(Messages::PluginControllerProxy::SetLayerHostingMode(static_cast<unsigned>(layerHostingMode)), m_pluginInstanceID);
 }
 
 void PluginProxy::setLayerHostingContextID(uint32_t layerHostingContextID)
diff --git a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
index 6cc2b78..21edaca 100644
--- a/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -366,7 +366,7 @@
 
 void PluginView::setLayerHostingMode(LayerHostingMode layerHostingMode)
 {
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
     if (!m_plugin)
         return;
 
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 61167c9..37617a3 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -442,7 +442,7 @@
     if (m_viewState != parameters.viewState)
         setViewStateInternal(parameters.viewState, true);
     if (m_layerHostingMode != parameters.layerHostingMode)
-        setLayerHostingMode(parameters.layerHostingMode);
+        setLayerHostingMode(static_cast<unsigned>(parameters.layerHostingMode));
 }
 
 WebPage::~WebPage()
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm b/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm
index f2c06b0..95a1dda 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm
@@ -43,12 +43,12 @@
     : PlatformCALayerRemote(LayerTypeCustom, owner, context)
 {
     switch (context->layerHostingMode()) {
-    case LayerHostingModeDefault:
+    case LayerHostingMode::InProcess:
         m_layerHostingContext = LayerHostingContext::createForPort(WebProcess::shared().compositingRenderServerPort());
         break;
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-    case LayerHostingModeInWindowServer:
-        m_layerHostingContext = LayerHostingContext::createForWindowServer();
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+    case LayerHostingMode::OutOfProcess:
+        m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess();
         break;
 #endif
     }
diff --git a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
index e737732..e3f5a20 100644
--- a/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
+++ b/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm
@@ -549,12 +549,12 @@
 
     // Create a new context and set it up.
     switch (m_webPage->layerHostingMode()) {
-    case LayerHostingModeDefault:
+    case LayerHostingMode::InProcess:
         m_layerHostingContext = LayerHostingContext::createForPort(WebProcess::shared().compositingRenderServerPort());
         break;
-#if HAVE(LAYER_HOSTING_IN_WINDOW_SERVER)
-    case LayerHostingModeInWindowServer:
-        m_layerHostingContext = LayerHostingContext::createForWindowServer();
+#if HAVE(OUT_OF_PROCESS_LAYER_HOSTING)
+    case LayerHostingMode::OutOfProcess:
+        m_layerHostingContext = LayerHostingContext::createForExternalHostingProcess();
         break;
 #endif
     }