Changeset 273286 in webkit


Ignore:
Timestamp:
Feb 22, 2021 4:03:08 PM (3 years ago)
Author:
pvollan@apple.com
Message:

[Cocoa] Send sandbox extensions for Network Extension services in load parameters
https://bugs.webkit.org/show_bug.cgi?id=222284
<rdar://problem/74402532>

Reviewed by Brent Fulgham.

Currently, sandbox extensions for Network Extension services are sent from the UI process to the WebContent process when the
policy decision is made, but that is not soon enough in all cases. They should also be sent as part of the load parameters.

  • Shared/Cocoa/LoadParametersCocoa.mm:

(WebKit::LoadParameters::platformEncode const):
(WebKit::LoadParameters::platformDecode):

  • Shared/LoadParameters.h:
  • UIProcess/Cocoa/WebPageProxyCocoa.mm:

(WebKit::WebPageProxy::addPlatformLoadParameters):

  • WebProcess/WebPage/Cocoa/WebPageCocoa.mm:

(WebKit::WebPage::platformDidReceiveLoadParameters):

Location:
trunk/Source/WebKit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r273283 r273286  
     12021-02-22  Per Arne Vollan  <pvollan@apple.com>
     2
     3        [Cocoa] Send sandbox extensions for Network Extension services in load parameters
     4        https://bugs.webkit.org/show_bug.cgi?id=222284
     5        <rdar://problem/74402532>
     6
     7        Reviewed by Brent Fulgham.
     8
     9        Currently, sandbox extensions for Network Extension services are sent from the UI process to the WebContent process when the
     10        policy decision is made, but that is not soon enough in all cases. They should also be sent as part of the load parameters.
     11
     12        * Shared/Cocoa/LoadParametersCocoa.mm:
     13        (WebKit::LoadParameters::platformEncode const):
     14        (WebKit::LoadParameters::platformDecode):
     15        * Shared/LoadParameters.h:
     16        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
     17        (WebKit::WebPageProxy::addPlatformLoadParameters):
     18        * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
     19        (WebKit::WebPage::platformDidReceiveLoadParameters):
     20
    1212021-02-22  Chris Dumez  <cdumez@apple.com>
    222
  • trunk/Source/WebKit/Shared/Cocoa/LoadParametersCocoa.mm

    r271469 r273286  
    3838    IPC::encode(encoder, dataDetectionContext.get());
    3939
     40    encoder << networkExtensionSandboxExtensionHandles;
    4041#if PLATFORM(IOS)
    4142    encoder << contentFilterExtensionHandle;
     
    4950        return false;
    5051
     52    Optional<SandboxExtension::HandleArray> networkExtensionSandboxExtensionHandles;
     53    decoder >> networkExtensionSandboxExtensionHandles;
     54    if (!networkExtensionSandboxExtensionHandles)
     55        return false;
     56    parameters.networkExtensionSandboxExtensionHandles = WTFMove(*networkExtensionSandboxExtensionHandles);
     57   
    5158#if PLATFORM(IOS)
    5259    Optional<Optional<SandboxExtension::Handle>> contentFilterExtensionHandle;
  • trunk/Source/WebKit/Shared/LoadParameters.h

    r271469 r273286  
    7575#if PLATFORM(COCOA)
    7676    RetainPtr<NSDictionary> dataDetectionContext;
     77    SandboxExtension::HandleArray networkExtensionSandboxExtensionHandles;
    7778#endif
    7879#if PLATFORM(IOS)
  • trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm

    r273102 r273286  
    166166    loadParameters.dataDetectionContext = m_uiClient->dataDetectionContext();
    167167
     168    loadParameters.networkExtensionSandboxExtensionHandles = createNetworkExtensionsSandboxExtensions(process);
     169   
    168170#if PLATFORM(IOS)
    169171    if (!process.hasManagedSessionSandboxAccess() && [getWebFilterEvaluatorClass() isManagedSession]) {
  • trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm

    r273075 r273286  
    8282    m_dataDetectionContext = parameters.dataDetectionContext;
    8383
     84    consumeNetworkExtensionSandboxExtensions(parameters.networkExtensionSandboxExtensionHandles);
     85
    8486#if PLATFORM(IOS)
    8587    if (parameters.contentFilterExtensionHandle)
Note: See TracChangeset for help on using the changeset viewer.