Title: [168984] trunk/Source/WebKit2
Revision
168984
Author
[email protected]
Date
2014-05-16 16:28:40 -0700 (Fri, 16 May 2014)

Log Message

Separate enabling sandbox extensions from the WEB_PROCESS_SANDBOX flag
https://bugs.webkit.org/show_bug.cgi?id=133016

Reviewed by Alexey Proskuryakov.

Add a distinct SANDBOX_EXTENSIONS flag to guard sandbox extensions
and switch over to it in the places that extensions are used.

* Shared/SandboxExtension.h:
* Shared/mac/SandboxExtensionMac.mm:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didChooseFilesForOpenPanel):
* WebKit2Prefix.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (168983 => 168984)


--- trunk/Source/WebKit2/ChangeLog	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/ChangeLog	2014-05-16 23:28:40 UTC (rev 168984)
@@ -1,3 +1,24 @@
+2014-05-16  Oliver Hunt  <[email protected]>
+
+        Separate enabling sandbox extensions from the WEB_PROCESS_SANDBOX flag
+        https://bugs.webkit.org/show_bug.cgi?id=133016
+
+        Reviewed by Alexey Proskuryakov.
+
+        Add a distinct SANDBOX_EXTENSIONS flag to guard sandbox extensions
+        and switch over to it in the places that extensions are used.
+
+        * Shared/SandboxExtension.h:
+        * Shared/mac/SandboxExtensionMac.mm:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::didChooseFilesForOpenPanel):
+        * WebKit2Prefix.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2014-05-16  Benjamin Poulain  <[email protected]>
 
         [iOS][WK2] Add a heuristic to set the right horizontal offset on rotation for responsive websites

Modified: trunk/Source/WebKit2/Shared/SandboxExtension.h (168983 => 168984)


--- trunk/Source/WebKit2/Shared/SandboxExtension.h	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/Shared/SandboxExtension.h	2014-05-16 23:28:40 UTC (rev 168984)
@@ -32,7 +32,7 @@
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
 
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
 typedef struct __WKSandboxExtension* WKSandboxExtensionRef;
 #endif
 
@@ -62,7 +62,7 @@
 
     private:
         friend class SandboxExtension;
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
         mutable WKSandboxExtensionRef m_sandboxExtension;
 #endif
     };
@@ -81,7 +81,7 @@
         static bool decode(IPC::ArgumentDecoder&, HandleArray&);
        
     private:
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
         std::unique_ptr<Handle[]> m_data;
         size_t m_size;
 #else
@@ -104,13 +104,13 @@
 private:
     explicit SandboxExtension(const Handle&);
                      
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
     mutable WKSandboxExtensionRef m_sandboxExtension;
     size_t m_useCount;
 #endif
 };
 
-#if !ENABLE(WEB_PROCESS_SANDBOX)
+#if !ENABLE(SANDBOX_EXTENSIONS)
 inline SandboxExtension::Handle::Handle() { }
 inline SandboxExtension::Handle::~Handle() { }
 inline void SandboxExtension::Handle::encode(IPC::ArgumentEncoder&) const { }

Modified: trunk/Source/WebKit2/Shared/mac/SandboxExtensionMac.mm (168983 => 168984)


--- trunk/Source/WebKit2/Shared/mac/SandboxExtensionMac.mm	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/Shared/mac/SandboxExtensionMac.mm	2014-05-16 23:28:40 UTC (rev 168984)
@@ -26,7 +26,7 @@
 #import "config.h"
 #import "SandboxExtension.h"
 
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
 
 #import "ArgumentDecoder.h"
 #import "ArgumentEncoder.h"
@@ -322,4 +322,4 @@
 
 } // namespace WebKit
 
-#endif // ENABLE(WEB_PROCESS_SANDBOX)
+#endif // ENABLE(SANDBOX_EXTENSIONS)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (168983 => 168984)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-05-16 23:28:40 UTC (rev 168984)
@@ -3601,7 +3601,7 @@
     if (!isValid())
         return;
 
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
     // FIXME: The sandbox extensions should be sent with the DidChooseFilesForOpenPanel message. This
     // is gated on a way of passing SandboxExtension::Handles in a Vector.
     for (size_t i = 0; i < fileURLs.size(); ++i) {

Modified: trunk/Source/WebKit2/WebKit2Prefix.h (168983 => 168984)


--- trunk/Source/WebKit2/WebKit2Prefix.h	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/WebKit2Prefix.h	2014-05-16 23:28:40 UTC (rev 168984)
@@ -32,6 +32,8 @@
 
 #if PLATFORM(COCOA)
 
+#define ENABLE_SANDBOX_EXTENSIONS 1
+
 #if !PLATFORM(IOS)
 #define ENABLE_WEB_PROCESS_SANDBOX 1
 #endif

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (168983 => 168984)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-05-16 23:28:40 UTC (rev 168984)
@@ -3083,7 +3083,7 @@
     m_activeOpenPanelResultListener = 0;
 }
 
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
 void WebPage::extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle& handle)
 {
     SandboxExtension::create(handle)->consumePermanently();

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (168983 => 168984)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-05-16 23:28:40 UTC (rev 168984)
@@ -971,7 +971,7 @@
 #endif
     void didChooseFilesForOpenPanel(const Vector<String>&);
     void didCancelForOpenPanel();
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
     void extendSandboxForFileFromOpenPanel(const SandboxExtension::Handle&);
 #endif
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (168983 => 168984)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2014-05-16 23:28:40 UTC (rev 168984)
@@ -233,7 +233,7 @@
 #endif
     DidChooseFilesForOpenPanel(Vector<String> fileURLs)
     DidCancelForOpenPanel()
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
     ExtendSandboxForFileFromOpenPanel(WebKit::SandboxExtension::Handle sandboxExtensionHandle)
 #endif
 

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (168983 => 168984)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2014-05-16 22:09:51 UTC (rev 168983)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm	2014-05-16 23:28:40 UTC (rev 168984)
@@ -159,7 +159,7 @@
 
 void WebProcess::platformInitializeWebProcess(const WebProcessCreationParameters& parameters, IPC::MessageDecoder&)
 {
-#if ENABLE(WEB_PROCESS_SANDBOX)
+#if ENABLE(SANDBOX_EXTENSIONS)
     SandboxExtension::consumePermanently(parameters.uiProcessBundleResourcePathExtensionHandle);
     SandboxExtension::consumePermanently(parameters.databaseDirectoryExtensionHandle);
     SandboxExtension::consumePermanently(parameters.applicationCacheDirectoryExtensionHandle);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to