Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit ded661b

Browse files
[macOS] Issue sandbox extension for icon service when attachment element is enabled
https://bugs.webkit.org/show_bug.cgi?id=217483 <rdar://problem/70099680> Reviewed by Brent Fulgham. This has previously been done on iOS, and should be done on macOS as well. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: * Shared/WebProcessCreationParameters.cpp: (WebKit::WebProcessCreationParameters::encode const): (WebKit::WebProcessCreationParameters::decode): * Shared/WebProcessCreationParameters.h: * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::creationParameters): * UIProcess/WebProcessProxy.h: * WebProcess/WebPage/WebPage.cpp: * WebProcess/com.apple.WebProcess.sb.in: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@268270 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 20e48ef commit ded661b

File tree

7 files changed

+38
-4
lines changed

7 files changed

+38
-4
lines changed

Source/WebKit/ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2020-10-09 Per Arne Vollan <[email protected]>
2+
3+
[macOS] Issue sandbox extension for icon service when attachment element is enabled
4+
https://bugs.webkit.org/show_bug.cgi?id=217483
5+
<rdar://problem/70099680>
6+
7+
Reviewed by Brent Fulgham.
8+
9+
This has previously been done on iOS, and should be done on macOS as well.
10+
11+
* Shared/WebPageCreationParameters.cpp:
12+
(WebKit::WebPageCreationParameters::encode const):
13+
(WebKit::WebPageCreationParameters::decode):
14+
* Shared/WebPageCreationParameters.h:
15+
* Shared/WebProcessCreationParameters.cpp:
16+
(WebKit::WebProcessCreationParameters::encode const):
17+
(WebKit::WebProcessCreationParameters::decode):
18+
* Shared/WebProcessCreationParameters.h:
19+
* UIProcess/WebPageProxy.cpp:
20+
(WebKit::WebPageProxy::creationParameters):
21+
* UIProcess/WebProcessProxy.h:
22+
* WebProcess/WebPage/WebPage.cpp:
23+
* WebProcess/com.apple.WebProcess.sb.in:
24+
125
2020-10-09 Alex Christensen <[email protected]>
226

327
Merge DownloadProxy::DidReceiveResponse and DownloadProxy::DecideDestinationWithSuggestedFilename into one message

Source/WebKit/Shared/WebPageCreationParameters.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const
9494
encoder << viewportConfigurationMinimumEffectiveDeviceWidth;
9595
encoder << viewportConfigurationViewSize;
9696
encoder << overrideViewportArguments;
97+
#endif
98+
99+
#if ENABLE(ATTACHMENT_ELEMENT)
97100
encoder << frontboardExtensionHandle;
98101
encoder << iconServicesExtensionHandle;
99102
#endif
@@ -322,7 +325,9 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod
322325
if (!overrideViewportArguments)
323326
return WTF::nullopt;
324327
parameters.overrideViewportArguments = WTFMove(*overrideViewportArguments);
328+
#endif
325329

330+
#if ENABLE(ATTACHMENT_ELEMENT)
326331
Optional<Optional<SandboxExtension::Handle>> frontboardExtensionHandle;
327332
decoder >> frontboardExtensionHandle;
328333
if (!frontboardExtensionHandle)

Source/WebKit/Shared/WebPageCreationParameters.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ struct WebPageCreationParameters {
156156
double viewportConfigurationMinimumEffectiveDeviceWidth;
157157
WebCore::FloatSize viewportConfigurationViewSize;
158158
Optional<WebCore::ViewportArguments> overrideViewportArguments;
159+
#endif
160+
#if ENABLE(ATTACHMENT_ELEMENT)
159161
Optional<SandboxExtension::Handle> frontboardExtensionHandle;
160162
Optional<SandboxExtension::Handle> iconServicesExtensionHandle;
161163
#endif

Source/WebKit/UIProcess/WebPageProxy.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7923,11 +7923,13 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc
79237923
parameters.themeName = pageClient().themeName();
79247924
#endif
79257925

7926-
#if ENABLE(ATTACHMENT_ELEMENT) && PLATFORM(IOS_FAMILY)
7926+
#if ENABLE(ATTACHMENT_ELEMENT) && PLATFORM(COCOA)
79277927
if (m_preferences->attachmentElementEnabled() && !m_process->hasIssuedAttachmentElementRelatedSandboxExtensions()) {
79287928
SandboxExtension::Handle handle;
7929+
#if PLATFORM(IOS_FAMILY)
79297930
SandboxExtension::createHandleForMachLookup("com.apple.frontboard.systemappservices"_s, WTF::nullopt, handle);
79307931
parameters.frontboardExtensionHandle = WTFMove(handle);
7932+
#endif
79317933
SandboxExtension::createHandleForMachLookup("com.apple.iconservices"_s, WTF::nullopt, handle);
79327934
parameters.iconServicesExtensionHandle = WTFMove(handle);
79337935
m_process->setHasIssuedAttachmentElementRelatedSandboxExtensions();

Source/WebKit/UIProcess/WebProcessProxy.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ class WebProcessProxy : public AuxiliaryProcessProxy, public ResponsivenessTimer
361361
UserMediaCaptureManagerProxy* userMediaCaptureManagerProxy() { return m_userMediaCaptureManagerProxy.get(); }
362362
#endif
363363

364-
#if ENABLE(ATTACHMENT_ELEMENT) && PLATFORM(IOS_FAMILY)
364+
#if ENABLE(ATTACHMENT_ELEMENT)
365365
bool hasIssuedAttachmentElementRelatedSandboxExtensions() const { return m_hasIssuedAttachmentElementRelatedSandboxExtensions; }
366366
void setHasIssuedAttachmentElementRelatedSandboxExtensions() { m_hasIssuedAttachmentElementRelatedSandboxExtensions = true; }
367367
#endif
@@ -581,7 +581,7 @@ class WebProcessProxy : public AuxiliaryProcessProxy, public ResponsivenessTimer
581581

582582
bool m_hasCommittedAnyProvisionalLoads { false };
583583
bool m_isPrewarmed;
584-
#if ENABLE(ATTACHMENT_ELEMENT) && PLATFORM(IOS_FAMILY)
584+
#if ENABLE(ATTACHMENT_ELEMENT)
585585
bool m_hasIssuedAttachmentElementRelatedSandboxExtensions { false };
586586
#endif
587587
#if PLATFORM(COCOA)

Source/WebKit/WebProcess/WebPage/WebPage.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters)
571571
if (!parameters.crossOriginAccessControlCheckEnabled)
572572
CrossOriginAccessControlCheckDisabler::singleton().setCrossOriginAccessControlCheckEnabled(false);
573573

574-
#if ENABLE(ATTACHMENT_ELEMENT) && PLATFORM(IOS_FAMILY)
574+
#if ENABLE(ATTACHMENT_ELEMENT)
575575
if (parameters.frontboardExtensionHandle)
576576
SandboxExtension::consumePermanently(*parameters.frontboardExtensionHandle);
577577
if (parameters.iconServicesExtensionHandle)

Source/WebKit/WebProcess/com.apple.WebProcess.sb.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,7 @@
998998
"com.apple.cfprefsd.daemon"
999999
"com.apple.containermanagerd"
10001000
"com.apple.diagnosticd"
1001+
"com.apple.iconservices"
10011002
"com.apple.tccd"
10021003
"com.apple.BluetoothServices"
10031004

0 commit comments

Comments
 (0)