<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[279477] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/279477">279477</a></dd>
<dt>Author</dt> <dd>graouts@webkit.org</dd>
<dt>Date</dt> <dd>2021-07-01 12:37:13 -0700 (Thu, 01 Jul 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Model] Restrict IPC calls to ARKit SPI availability and runtime flag
https://bugs.webkit.org/show_bug.cgi?id=227581

Reviewed by Tim Horton.

Source/WebCore:

Guard all IPC calls related to <model> by the most appropriate platform-specific flag
and also ensure that those calls don't do anything unless the runtime flag is also
enabled.

* Modules/model-element/HTMLModelElement.cpp:
* Modules/model-element/HTMLModelElement.h:
* Modules/model-element/HTMLModelElementCocoa.mm:
(WebCore::HTMLModelElement::inlinePreviewDidObtainContextId):
* loader/EmptyClients.cpp:
(WebCore::EmptyChromeClient::modelElementDidCreatePreview const):
* loader/EmptyClients.h:
* page/ChromeClient.h:

Source/WebKit:

Guard all IPC calls related to <model> by the most appropriate platform-specific flag
and also ensure that those calls don't do anything unless the runtime flag is also
enabled.

* Shared/WebProcessDataStoreParameters.h:
(WebKit::WebProcessDataStoreParameters::encode const):
(WebKit::WebProcessDataStoreParameters::decode):
* UIProcess/Cocoa/ModelElementControllerCocoa.mm:
(WebKit::ModelElementController::takeModelElementFullscreen):
(WebKit::ModelElementController::modelElementDidCreatePreview):
* UIProcess/ModelElementController.cpp:
* UIProcess/ModelElementController.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didAttachToRunningProcess):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::takeModelElementFullscreen):
(WebKit::WebPageProxy::modelElementDidCreatePreview):
(WebKit::WebPageProxy::modelElementPreviewDidObtainContextId):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::webProcessDataStoreParameters):
* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
* UIProcess/WebsiteData/WebsiteDataStore.h:
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
(WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
(WebKit::WebsiteDataStoreConfiguration::copy const):
* UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::modelElementDidCreatePreview const):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::modelElementPreviewDidObtainContextId):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setWebsiteDataStoreParameters):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetWebsiteDataStoreParameters):

Source/WTF:

Define a new compile-time flag when either of the iOS or macOS ARKit SPIs are available.

* wtf/PlatformHave.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfPlatformHaveh">trunk/Source/WTF/wtf/PlatformHave.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmodelelementHTMLModelElementcpp">trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesmodelelementHTMLModelElementh">trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h</a></li>
<li><a href="#trunkSourceWebCoreModulesmodelelementHTMLModelElementCocoamm">trunk/Source/WebCore/Modules/model-element/HTMLModelElementCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientsh">trunk/Source/WebCore/loader/EmptyClients.h</a></li>
<li><a href="#trunkSourceWebCorepageChromeClienth">trunk/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitSharedWebProcessDataStoreParametersh">trunk/Source/WebKit/Shared/WebProcessDataStoreParameters.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaModelElementControllerCocoamm">trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessModelElementControllercpp">trunk/Source/WebKit/UIProcess/ModelElementController.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessModelElementControllerh">trunk/Source/WebKit/UIProcess/ModelElementController.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessPageClienth">trunk/Source/WebKit/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxycpp">trunk/Source/WebKit/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxyh">trunk/Source/WebKit/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebPageProxymessagesin">trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebProcessPoolcpp">trunk/Source/WebKit/UIProcess/WebProcessPool.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm">trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp">trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStoreh">trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStoreConfigurationcpp">trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp</a></li>
<li><a href="#trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStoreConfigurationh">trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth">trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagecpp">trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPageh">trunk/Source/WebKit/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPageWebPagemessagesin">trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebProcesscpp">trunk/Source/WebKit/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcesscocoaWebProcessCocoamm">trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog       2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WTF/ChangeLog  2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2021-07-01  Antoine Quint  <graouts@webkit.org>
+
+        [Model] Restrict IPC calls to ARKit SPI availability and runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=227581
+
+        Reviewed by Tim Horton.
+
+        Define a new compile-time flag when either of the iOS or macOS ARKit SPIs are available.
+
+        * wtf/PlatformHave.h:
+
</ins><span class="cx"> 2021-07-01  Aditya Keerthi  <akeerthi@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [iOS] <select> menus should scroll to the selected option
</span></span></pre></div>
<a id="trunkSourceWTFwtfPlatformHaveh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/PlatformHave.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/PlatformHave.h      2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WTF/wtf/PlatformHave.h 2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -1018,7 +1018,11 @@
</span><span class="cx"> #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 120000
</span><span class="cx"> #define HAVE_ARKIT_INLINE_PREVIEW_MAC 1
</span><span class="cx"> #endif
</span><ins>+
+#if defined(HAVE_ARKIT_INLINE_PREVIEW_IOS) || defined(HAVE_ARKIT_INLINE_PREVIEW_MAC)
+#define HAVE_ARKIT_INLINE_PREVIEW 1
</ins><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS) || PLATFORM(MACCATALYST) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 110000)
</span><span class="cx"> #define HAVE_NSURLPROTOCOL_WITH_SKIPAPPSSO 1
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebCore/ChangeLog      2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2021-07-01  Antoine Quint  <graouts@webkit.org>
+
+        [Model] Restrict IPC calls to ARKit SPI availability and runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=227581
+
+        Reviewed by Tim Horton.
+
+        Guard all IPC calls related to <model> by the most appropriate platform-specific flag
+        and also ensure that those calls don't do anything unless the runtime flag is also
+        enabled.
+
+        * Modules/model-element/HTMLModelElement.cpp:
+        * Modules/model-element/HTMLModelElement.h:
+        * Modules/model-element/HTMLModelElementCocoa.mm:
+        (WebCore::HTMLModelElement::inlinePreviewDidObtainContextId):
+        * loader/EmptyClients.cpp:
+        (WebCore::EmptyChromeClient::modelElementDidCreatePreview const):
+        * loader/EmptyClients.h:
+        * page/ChromeClient.h:
+
</ins><span class="cx"> 2021-07-01  Youenn Fablet  <youenn@apple.com>
</span><span class="cx"> 
</span><span class="cx">         ReadableStream.getReader do not throw a proper exception when parameter is of wrong type
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmodelelementHTMLModelElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp  2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebCore/Modules/model-element/HTMLModelElement.cpp     2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -167,6 +167,7 @@
</span><span class="cx">     return *this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> static String& sharedModelElementCacheDirectory()
</span><span class="cx"> {
</span><span class="cx">     static NeverDestroyed<String> sharedModelElementCacheDirectory;
</span><span class="lines">@@ -182,6 +183,7 @@
</span><span class="cx"> {
</span><span class="cx">     return sharedModelElementCacheDirectory();
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> // MARK: - DOM overrides.
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmodelelementHTMLModelElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h    2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebCore/Modules/model-element/HTMLModelElement.h       2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -61,8 +61,10 @@
</span><span class="cx">     RefPtr<SharedBuffer> modelData() const;
</span><span class="cx">     RefPtr<Model> model() const;
</span><span class="cx"> 
</span><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     WEBCORE_EXPORT static void setModelElementCacheDirectory(const String&);
</span><span class="cx">     WEBCORE_EXPORT static const String& modelElementCacheDirectory();
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> #if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</span><span class="cx">     PlatformLayer* platformLayer() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmodelelementHTMLModelElementCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/model-element/HTMLModelElementCocoa.mm (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/model-element/HTMLModelElementCocoa.mm      2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebCore/Modules/model-element/HTMLModelElementCocoa.mm 2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "RenderLayer.h"
</span><span class="cx"> #include "RenderLayerModelObject.h"
</span><ins>+#include "Settings.h"
</ins><span class="cx"> #include <pal/spi/mac/SystemPreviewSPI.h>
</span><span class="cx"> #include <wtf/FileSystem.h>
</span><span class="cx"> #include <wtf/RetainPtr.h>
</span><span class="lines">@@ -107,6 +108,9 @@
</span><span class="cx"> 
</span><span class="cx"> void HTMLModelElement::inlinePreviewDidObtainContextId(const String& uuid, uint32_t contextId)
</span><span class="cx"> {
</span><ins>+    if (!document().settings().modelElementEnabled())
+        return;
+
</ins><span class="cx">     if (uuid != (String)[m_inlinePreview uuid].UUIDString) {
</span><span class="cx">         LOG(ModelElement, "HTMLModelElement::inlinePreviewDidObtainContextId() UUID mismatch, received %s but expected %s.", uuid.utf8().data(), ((String)[m_inlinePreview uuid].UUIDString).utf8().data());
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp     2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp        2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -578,16 +578,16 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
-
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx"> void EmptyChromeClient::takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID) const
</span><span class="cx"> {
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx"> void EmptyChromeClient::modelElementDidCreatePreview(WebCore::HTMLModelElement&, const URL&, const String&, const WebCore::FloatSize&) const
</span><span class="cx"> {
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> void EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction(const NavigationAction&, const ResourceRequest&, FormState*, const String&, PolicyCheckIdentifier, FramePolicyFunction&&)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.h       2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebCore/loader/EmptyClients.h  2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -216,13 +216,13 @@
</span><span class="cx">     void didAssociateFormControls(const Vector<RefPtr<Element>>&, Frame&) final { }
</span><span class="cx">     bool shouldNotifyOnFormChanges() final { return false; }
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx">     void takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID) const final;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     RefPtr<Icon> createIconForFiles(const Vector<String>& /* filenames */) final { return nullptr; }
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx">     void modelElementDidCreatePreview(WebCore::HTMLModelElement&, const URL&, const String&, const WebCore::FloatSize&) const final;
</span><span class="cx"> #endif
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ChromeClient.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ChromeClient.h 2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebCore/page/ChromeClient.h    2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> #include "MediaUsageInfo.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> class HTMLModelElement;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -600,8 +600,10 @@
</span><span class="cx">     virtual void textAutosizingUsesIdempotentModeChanged() { }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx">     virtual void takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID) const { }
</span><ins>+#endif
+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx">     virtual void modelElementDidCreatePreview(WebCore::HTMLModelElement&, const URL&, const String&, const WebCore::FloatSize&) const { };
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/ChangeLog       2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2021-07-01  Antoine Quint  <graouts@webkit.org>
+
+        [Model] Restrict IPC calls to ARKit SPI availability and runtime flag
+        https://bugs.webkit.org/show_bug.cgi?id=227581
+
+        Reviewed by Tim Horton.
+
+        Guard all IPC calls related to <model> by the most appropriate platform-specific flag
+        and also ensure that those calls don't do anything unless the runtime flag is also
+        enabled.
+
+        * Shared/WebProcessDataStoreParameters.h:
+        (WebKit::WebProcessDataStoreParameters::encode const):
+        (WebKit::WebProcessDataStoreParameters::decode):
+        * UIProcess/Cocoa/ModelElementControllerCocoa.mm:
+        (WebKit::ModelElementController::takeModelElementFullscreen):
+        (WebKit::ModelElementController::modelElementDidCreatePreview):
+        * UIProcess/ModelElementController.cpp:
+        * UIProcess/ModelElementController.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didAttachToRunningProcess):
+        (WebKit::WebPageProxy::resetState):
+        (WebKit::WebPageProxy::takeModelElementFullscreen):
+        (WebKit::WebPageProxy::modelElementDidCreatePreview):
+        (WebKit::WebPageProxy::modelElementPreviewDidObtainContextId):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/WebProcessPool.cpp:
+        (WebKit::WebProcessPool::webProcessDataStoreParameters):
+        * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
+        * UIProcess/WebsiteData/WebsiteDataStore.cpp:
+        (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
+        * UIProcess/WebsiteData/WebsiteDataStore.h:
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp:
+        (WebKit::WebsiteDataStoreConfiguration::WebsiteDataStoreConfiguration):
+        (WebKit::WebsiteDataStoreConfiguration::copy const):
+        * UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::modelElementDidCreatePreview const):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::modelElementPreviewDidObtainContextId):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::setWebsiteDataStoreParameters):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformSetWebsiteDataStoreParameters):
+
</ins><span class="cx"> 2021-07-01  Per Arne  <pvollan@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [macOS] Fix sandbox violations related to IOKit filtering
</span></span></pre></div>
<a id="trunkSourceWebKitSharedWebProcessDataStoreParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/WebProcessDataStoreParameters.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/WebProcessDataStoreParameters.h       2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/Shared/WebProcessDataStoreParameters.h  2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -51,7 +51,7 @@
</span><span class="cx">     HashSet<WebCore::RegistrableDomain> domainsWithUserInteraction;
</span><span class="cx">     HashMap<TopFrameDomain, SubResourceDomain> domainsWithStorageAccessQuirk;
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     String modelElementCacheDirectory;
</span><span class="cx">     SandboxExtension::Handle modelElementCacheDirectoryExtensionHandle;
</span><span class="cx"> #endif
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     encoder << domainsWithUserInteraction;
</span><span class="cx">     encoder << domainsWithStorageAccessQuirk;
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     encoder << modelElementCacheDirectory;
</span><span class="cx">     encoder << modelElementCacheDirectoryExtensionHandle;
</span><span class="cx"> #endif
</span><span class="lines">@@ -150,7 +150,7 @@
</span><span class="cx">     if (!domainsWithStorageAccessQuirk)
</span><span class="cx">         return std::nullopt;
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">         String modelElementCacheDirectory;
</span><span class="cx">         if (!decoder.decode(modelElementCacheDirectory))
</span><span class="cx">             return std::nullopt;
</span><span class="lines">@@ -181,7 +181,7 @@
</span><span class="cx">         WTFMove(*domainsWithUserInteraction),
</span><span class="cx">         WTFMove(*domainsWithStorageAccessQuirk),
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">         WTFMove(modelElementCacheDirectory),
</span><span class="cx">         WTFMove(*modelElementCacheDirectoryExtensionHandle),
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaModelElementControllerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm       2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/Cocoa/ModelElementControllerCocoa.mm  2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #import "config.h"
</span><span class="cx"> #import "ModelElementController.h"
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> 
</span><span class="cx"> #import "Logging.h"
</span><span class="cx"> #import "WebPageProxy.h"
</span><span class="lines">@@ -55,6 +55,9 @@
</span><span class="cx"> 
</span><span class="cx"> void ModelElementController::takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId)
</span><span class="cx"> {
</span><ins>+    if (!m_webPageProxy->preferences().modelElementEnabled())
+        return;
+
</ins><span class="cx">     if (!is<RemoteLayerTreeDrawingAreaProxy>(m_webPageProxy.drawingArea()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -123,6 +126,9 @@
</span><span class="cx"> 
</span><span class="cx"> void ModelElementController::modelElementDidCreatePreview(const WebCore::ElementContext& context, const URL& fileURL, const String& uuid, const WebCore::FloatSize& size)
</span><span class="cx"> {
</span><ins>+    if (!m_webPageProxy.preferences().modelElementEnabled())
+        return;
+
</ins><span class="cx">     auto preview = adoptNS([allocASVInlinePreviewInstance() initWithFrame:CGRectMake(0, 0, size.width(), size.height()) UUID:[[NSUUID alloc] initWithUUIDString:uuid]]);
</span><span class="cx"> 
</span><span class="cx">     LOG(ModelElement, "Created remote preview with UUID %s.", uuid.utf8().data());
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessModelElementControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ModelElementController.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ModelElementController.cpp 2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/ModelElementController.cpp    2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ModelElementController.h"
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> 
</span><span class="cx"> #include "WebPageProxy.h"
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessModelElementControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/ModelElementController.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/ModelElementController.h   2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/ModelElementController.h      2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -25,7 +25,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> 
</span><span class="cx"> #include <WebCore/ElementContext.h>
</span><span class="cx"> #include <WebCore/GraphicsLayer.h>
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx"> #if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</span><span class="cx">     void takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId);
</span><span class="cx"> #endif
</span><del>-
</del><span class="cx"> #if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</span><span class="cx">     void modelElementDidCreatePreview(const WebCore::ElementContext&, const URL&, const String&, const WebCore::FloatSize&);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/PageClient.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/PageClient.h       2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/PageClient.h  2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -132,10 +132,6 @@
</span><span class="cx"> #if HAVE(TRANSLATION_UI_SERVICES) && ENABLE(CONTEXT_MENUS)
</span><span class="cx"> struct TranslationContextMenuInfo;
</span><span class="cx"> #endif
</span><del>-
-#if ENABLE(MODEL_ELEMENT)
-struct ElementContext;
-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp   2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp      2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -1023,9 +1023,11 @@
</span><span class="cx">     m_systemPreviewController = makeUnique<SystemPreviewController>(*this);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
-    ASSERT(!m_modelElementController);
-    m_modelElementController = makeUnique<ModelElementController>(*this);
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
+    if (m_preferences->modelElementEnabled()) {
+        ASSERT(!m_modelElementController);
+        m_modelElementController = makeUnique<ModelElementController>(*this);
+    }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_AUTHN)
</span><span class="lines">@@ -7776,7 +7778,7 @@
</span><span class="cx">     m_systemPreviewController = nullptr;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     m_modelElementController = nullptr;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -10688,20 +10690,17 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
-
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx"> void WebPageProxy::takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId)
</span><span class="cx"> {
</span><del>-#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</del><span class="cx">     modelElementController()->takeModelElementFullscreen(contentLayerId);
</span><ins>+}
</ins><span class="cx"> #endif
</span><del>-}
</del><span class="cx"> 
</span><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx"> void WebPageProxy::modelElementDidCreatePreview(const WebCore::ElementContext& context, const URL& url, const String& uuid, const FloatSize& size)
</span><span class="cx"> {
</span><del>-#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</del><span class="cx">     modelElementController()->modelElementDidCreatePreview(context, url, uuid, size);
</span><del>-#endif
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPageProxy::modelElementPreviewDidObtainContextId(const WebCore::ElementContext& context, const String& uuid, uint32_t contextId)
</span><span class="lines">@@ -10709,7 +10708,6 @@
</span><span class="cx">     if (hasRunningProcess())
</span><span class="cx">         send(Messages::WebPage::ModelElementPreviewDidObtainContextId(context, uuid, contextId));
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.h     2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h        2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -189,7 +189,7 @@
</span><span class="cx"> #include "PlatformXRSystem.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> #include "ModelElementController.h"
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -573,9 +573,13 @@
</span><span class="cx">     void systemPreviewActionTriggered(const WebCore::SystemPreviewInfo&, const String&);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     ModelElementController* modelElementController() { return m_modelElementController.get(); }
</span><ins>+#endif
+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx">     void takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId);
</span><ins>+#endif
+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx">     void modelElementDidCreatePreview(const WebCore::ElementContext&, const URL&, const String&, const WebCore::FloatSize&);
</span><span class="cx">     void modelElementPreviewDidObtainContextId(const WebCore::ElementContext&, const String&, uint32_t);
</span><span class="cx"> #endif
</span><span class="lines">@@ -2608,7 +2612,7 @@
</span><span class="cx">     std::unique_ptr<SystemPreviewController> m_systemPreviewController;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     std::unique_ptr<ModelElementController> m_modelElementController;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in   2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in      2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -593,8 +593,10 @@
</span><span class="cx">     ChangeUniversalAccessZoomFocus(WebCore::IntRect viewRect, WebCore::IntRect caretRect)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx">     TakeModelElementFullscreen(uint64_t contentLayerID)
</span><ins>+#endif
+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx">     ModelElementDidCreatePreview(struct WebCore::ElementContext elementContext, URL url, String uuid, WebCore::FloatSize size)
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebProcessPoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp    2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -695,7 +695,7 @@
</span><span class="cx">     if (!javaScriptConfigurationDirectory.isEmpty())
</span><span class="cx">         SandboxExtension::createHandleWithoutResolvingPath(javaScriptConfigurationDirectory, SandboxExtension::Type::ReadWrite, javaScriptConfigurationDirectoryExtensionHandle);
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     auto modelElementCacheDirectory = websiteDataStore.resolvedModelElementCacheDirectory();
</span><span class="cx">     SandboxExtension::Handle modelElementCacheDirectoryExtensionHandle;
</span><span class="cx">     if (!modelElementCacheDirectory.isEmpty())
</span><span class="lines">@@ -718,7 +718,7 @@
</span><span class="cx">         m_domainsWithUserInteraction,
</span><span class="cx">         m_domainsWithCrossPageStorageAccessQuirk,
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">         WTFMove(modelElementCacheDirectory),
</span><span class="cx">         WTFMove(modelElementCacheDirectoryExtensionHandle),
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataCocoaWebsiteDataStoreCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm 2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm    2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx">     return tempDirectoryFileSystemRepresentation("JavaScriptCoreDebug", ShouldCreateDirectory::No);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> WTF::String WebsiteDataStore::defaultModelElementCacheDirectory()
</span><span class="cx"> {
</span><span class="cx">     return tempDirectoryFileSystemRepresentation("ModelElement", ShouldCreateDirectory::No);
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp   2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp      2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx">         m_resolvedConfiguration->setCacheStorageDirectory(resolvePathForSandboxExtension(m_configuration->cacheStorageDirectory()));
</span><span class="cx">     if (!m_configuration->hstsStorageDirectory().isEmpty() && m_resolvedConfiguration->hstsStorageDirectory().isEmpty())
</span><span class="cx">         m_resolvedConfiguration->setHSTSStorageDirectory(resolvePathForSandboxExtension(m_configuration->hstsStorageDirectory()));
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     if (!m_configuration->modelElementCacheDirectory().isEmpty())
</span><span class="cx">         m_resolvedConfiguration->setModelElementCacheDirectory(resolveAndCreateReadWriteDirectoryForSandboxExtension(m_configuration->modelElementCacheDirectory()));
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStoreh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h     2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h        2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -253,7 +253,7 @@
</span><span class="cx">     const String& resolvedServiceWorkerRegistrationDirectory() const { return m_resolvedConfiguration->serviceWorkerRegistrationDirectory(); }
</span><span class="cx">     const String& resolvedResourceLoadStatisticsDirectory() const { return m_resolvedConfiguration->resourceLoadStatisticsDirectory(); }
</span><span class="cx">     const String& resolvedHSTSStorageDirectory() const { return m_resolvedConfiguration->hstsStorageDirectory(); }
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     const String& resolvedModelElementCacheDirectory() const { return m_resolvedConfiguration->modelElementCacheDirectory(); }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -332,7 +332,7 @@
</span><span class="cx"> #if USE(GLIB)
</span><span class="cx">     static WTF::String defaultHSTSDirectory();
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     static WTF::String defaultModelElementCacheDirectory();
</span><span class="cx"> #endif
</span><span class="cx">     static WTF::String defaultIndexedDBDatabaseDirectory();
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStoreConfigurationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp      2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.cpp 2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">         setResourceLoadStatisticsDirectory(WebsiteDataStore::defaultResourceLoadStatisticsDirectory());
</span><span class="cx">         setDeviceIdHashSaltsStorageDirectory(WebsiteDataStore::defaultDeviceIdHashSaltsStorageDirectory());
</span><span class="cx">         setJavaScriptConfigurationDirectory(WebsiteDataStore::defaultJavaScriptConfigurationDirectory());
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">         setModelElementCacheDirectory(WebsiteDataStore::defaultModelElementCacheDirectory());
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><span class="lines">@@ -100,7 +100,7 @@
</span><span class="cx">     if (m_proxyConfiguration)
</span><span class="cx">         copy->m_proxyConfiguration = adoptCF(CFDictionaryCreateCopy(nullptr, this->m_proxyConfiguration.get()));
</span><span class="cx"> #endif
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     copy->m_modelElementCacheDirectory = this->m_modelElementCacheDirectory;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessWebsiteDataWebsiteDataStoreConfigurationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h        2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStoreConfiguration.h   2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx">     const String& localStorageDirectory() const { return m_localStorageDirectory; }
</span><span class="cx">     void setLocalStorageDirectory(String&& directory) { m_localStorageDirectory = WTFMove(directory); }
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     const String& modelElementCacheDirectory() const { return m_modelElementCacheDirectory; }
</span><span class="cx">     void setModelElementCacheDirectory(String&& directory) { m_modelElementCacheDirectory = WTFMove(directory); }
</span><span class="cx"> #endif
</span><span class="lines">@@ -184,7 +184,7 @@
</span><span class="cx">     String m_serviceWorkerRegistrationDirectory;
</span><span class="cx">     String m_webSQLDatabaseDirectory;
</span><span class="cx">     String m_hstsStorageDirectory;
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     String m_modelElementCacheDirectory;
</span><span class="cx"> #endif
</span><span class="cx"> #if USE(GLIB)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp        2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp   2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -1515,18 +1515,18 @@
</span><span class="cx">     m_page.didHandleOrPreventMouseDownOrMouseUpEvent();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
-
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx"> void WebChromeClient::takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId) const
</span><span class="cx"> {
</span><span class="cx">     m_page.takeModelElementFullscreen(contentLayerId);
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx"> void WebChromeClient::modelElementDidCreatePreview(WebCore::HTMLModelElement& element, const URL& url, const String& uuid, const WebCore::FloatSize& size) const
</span><span class="cx"> {
</span><span class="cx">     m_page.modelElementDidCreatePreview(element, url, uuid, size);
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h  2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h     2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -452,8 +452,10 @@
</span><span class="cx">     void enumerateImmersiveXRDevices(CompletionHandler<void(const PlatformXR::Instance::DeviceList&)>&&) final;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx">     void takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId) const final;
</span><ins>+#endif
+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx">     void modelElementDidCreatePreview(WebCore::HTMLModelElement&, const URL&, const String&, const WebCore::FloatSize&) const final;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp       2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp  2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -269,7 +269,7 @@
</span><span class="cx"> #include <WebCore/AppHighlightStorage.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> #include <WebCore/HTMLModelElement.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -7678,13 +7678,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
-
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx"> void WebPage::takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId)
</span><span class="cx"> {
</span><span class="cx">     send(Messages::WebPageProxy::TakeModelElementFullscreen(contentLayerId));
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx"> 
</span><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx"> void WebPage::modelElementDidCreatePreview(WebCore::HTMLModelElement& element, const URL& url, const String& uuid, const WebCore::FloatSize& size)
</span><span class="cx"> {
</span><span class="cx">     if (auto elementContext = contextForElement(element))
</span><span class="lines">@@ -7693,17 +7694,10 @@
</span><span class="cx"> 
</span><span class="cx"> void WebPage::modelElementPreviewDidObtainContextId(const WebCore::ElementContext& elementContext, const String& uuid, uint32_t contextId)
</span><span class="cx"> {
</span><del>-#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</del><span class="cx">     auto element = elementForContext(elementContext);
</span><span class="cx">     if (is<WebCore::HTMLModelElement>(element))
</span><span class="cx">         downcast<WebCore::HTMLModelElement>(*element).inlinePreviewDidObtainContextId(uuid, contextId);
</span><del>-#else
-    UNUSED_PARAM(elementContext);
-    UNUSED_PARAM(uuid);
-    UNUSED_PARAM(contextId);
-#endif
</del><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h 2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h    2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -210,7 +210,7 @@
</span><span class="cx"> class TextCheckingRequest;
</span><span class="cx"> class VisiblePosition;
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> class HTMLModelElement;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1465,8 +1465,10 @@
</span><span class="cx">     PlatformXRSystemProxy& xrSystemProxy();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_IOS)
</ins><span class="cx">     void takeModelElementFullscreen(WebCore::GraphicsLayer::PlatformLayerID contentLayerId);
</span><ins>+#endif
+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx">     void modelElementDidCreatePreview(WebCore::HTMLModelElement&, const URL&, const String&, const WebCore::FloatSize&);
</span><span class="cx">     void modelElementPreviewDidObtainContextId(const WebCore::ElementContext&, const String&, uint32_t);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in       2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in  2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -644,7 +644,7 @@
</span><span class="cx">     UpdateWithTextRecognitionResult(struct WebCore::TextRecognitionResult result, struct WebCore::ElementContext element, WebCore::FloatPoint location) -> (enum:uint8_t WebKit::TextRecognitionUpdateResult result) Async
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW_MAC)
</ins><span class="cx">     ModelElementPreviewDidObtainContextId(struct WebCore::ElementContext elementContext, String uuid, uint32_t contextId)
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebProcess.cpp    2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp       2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> #include <wtf/URLParser.h>
</span><span class="cx"> #include <wtf/text/StringHash.h>
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx"> #include <WebCore/HTMLModelElement.h>
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -572,7 +572,7 @@
</span><span class="cx">         WebCore::HTMLMediaElement::setMediaCacheDirectory(parameters.mediaCacheDirectory);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     if (!parameters.modelElementCacheDirectory.isEmpty())
</span><span class="cx">         WebCore::HTMLModelElement::setModelElementCacheDirectory(parameters.modelElementCacheDirectory);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (279476 => 279477)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm  2021-07-01 18:52:04 UTC (rev 279476)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm     2021-07-01 19:37:13 UTC (rev 279477)
</span><span class="lines">@@ -481,7 +481,7 @@
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.mediaCacheDirectoryExtensionHandle);
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.mediaKeyStorageDirectoryExtensionHandle);
</span><span class="cx">     SandboxExtension::consumePermanently(parameters.javaScriptConfigurationDirectoryExtensionHandle);
</span><del>-#if ENABLE(MODEL_ELEMENT)
</del><ins>+#if HAVE(ARKIT_INLINE_PREVIEW)
</ins><span class="cx">     SandboxExtension::consumePermanently(parameters.modelElementCacheDirectoryExtensionHandle);
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span></span></pre>
</div>
</div>

</body>
</html>