Title: [111413] trunk/Source/WebKit2
- Revision
- 111413
- Author
- [email protected]
- Date
- 2012-03-20 11:08:15 -0700 (Tue, 20 Mar 2012)
Log Message
WebProcess should use private temporary and cache directories
https://bugs.webkit.org/show_bug.cgi?id=80876
Reviewed by Sam Weinig.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h: (WebProcessCreationParameters):
* UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess):
Always pass uiProcessBundleIdentifier to WebProcess on Mac, it's now used for more than
CFURL sessions.
* WebProcess/com.apple.WebProcess.sb.in: Limit old workaround to platforms that need it.
* WebProcess/mac/WebProcessMac.mm: (WebKit::initializeSandbox): Tell confstr to use a suffix
on user directories.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (111412 => 111413)
--- trunk/Source/WebKit2/ChangeLog 2012-03-20 18:02:25 UTC (rev 111412)
+++ trunk/Source/WebKit2/ChangeLog 2012-03-20 18:08:15 UTC (rev 111413)
@@ -1,3 +1,23 @@
+2012-03-20 Alexey Proskuryakov <[email protected]>
+
+ WebProcess should use private temporary and cache directories
+ https://bugs.webkit.org/show_bug.cgi?id=80876
+
+ Reviewed by Sam Weinig.
+
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h: (WebProcessCreationParameters):
+ * UIProcess/mac/WebContextMac.mm: (WebKit::WebContext::platformInitializeWebProcess):
+ Always pass uiProcessBundleIdentifier to WebProcess on Mac, it's now used for more than
+ CFURL sessions.
+
+ * WebProcess/com.apple.WebProcess.sb.in: Limit old workaround to platforms that need it.
+
+ * WebProcess/mac/WebProcessMac.mm: (WebKit::initializeSandbox): Tell confstr to use a suffix
+ on user directories.
+
2012-03-20 Anders Carlsson <[email protected]>
Graphic distortion effect when launching with empty page Safari after reset
Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp (111412 => 111413)
--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp 2012-03-20 18:02:25 UTC (rev 111412)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp 2012-03-20 18:08:15 UTC (rev 111413)
@@ -70,7 +70,7 @@
encoder->encode(textCheckerState);
encoder->encode(fullKeyboardAccessEnabled);
encoder->encode(defaultRequestTimeoutInterval);
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFURLSTORAGESESSIONS)
encoder->encode(uiProcessBundleIdentifier);
#endif
#if PLATFORM(MAC)
@@ -147,7 +147,7 @@
return false;
if (!decoder->decode(parameters.defaultRequestTimeoutInterval))
return false;
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFURLSTORAGESESSIONS)
if (!decoder->decode(parameters.uiProcessBundleIdentifier))
return false;
#endif
Modified: trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h (111412 => 111413)
--- trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2012-03-20 18:02:25 UTC (rev 111412)
+++ trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h 2012-03-20 18:08:15 UTC (rev 111413)
@@ -85,7 +85,7 @@
double defaultRequestTimeoutInterval;
-#if USE(CFURLSTORAGESESSIONS)
+#if PLATFORM(MAC) || USE(CFURLSTORAGESESSIONS)
String uiProcessBundleIdentifier;
#endif
Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm (111412 => 111413)
--- trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2012-03-20 18:02:25 UTC (rev 111412)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2012-03-20 18:08:15 UTC (rev 111413)
@@ -111,9 +111,7 @@
// FIXME: This should really be configurable; we shouldn't just blindly allow read access to the UI process bundle.
parameters.uiProcessBundleResourcePath = [[NSBundle mainBundle] resourcePath];
-#if USE(CFURLSTORAGESESSIONS)
parameters.uiProcessBundleIdentifier = String([[NSBundle mainBundle] bundleIdentifier]);
-#endif
// Listen for enhanced accessibility changes and propagate them to the WebProcess.
m_enhancedAccessibilityObserver = [[NSNotificationCenter defaultCenter] addObserverForName:WebKitApplicationDidChangeAccessibilityEnhancedUserInterfaceNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *note) {
Modified: trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in (111412 => 111413)
--- trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in 2012-03-20 18:02:25 UTC (rev 111412)
+++ trunk/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in 2012-03-20 18:08:15 UTC (rev 111413)
@@ -93,11 +93,14 @@
(allow file*
(subpath "/private/var/db/mds/system"))
-;; FIXME: <rdar://problem/10792047> Use private user cache directory
+#if !defined(BUILDING_ON_LION)
(if (positive? (string-length (param "DARWIN_USER_CACHE_DIR")))
+ (allow file* (subpath (param "DARWIN_USER_CACHE_DIR"))))
+#else
+(if (positive? (string-length (param "DARWIN_USER_CACHE_DIR")))
(allow file* (subpath (string-append (param "DARWIN_USER_CACHE_DIR") "/mds"))))
+#endif
-;; FIXME: <rdar://problem/10785457> Use private temporary directory
(if (positive? (string-length (param "DARWIN_USER_TEMP_DIR")))
(allow file* (subpath (param "DARWIN_USER_TEMP_DIR"))))
Modified: trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm (111412 => 111413)
--- trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm 2012-03-20 18:02:25 UTC (rev 111412)
+++ trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm 2012-03-20 18:08:15 UTC (rev 111413)
@@ -179,6 +179,18 @@
return;
}
+#if !defined(BUILDING_ON_LION)
+ // Use private temporary and cache directories.
+ String systemDirectorySuffix = "com.apple.WebProcess+" + parameters.uiProcessBundleIdentifier;
+ setenv("DIRHELPER_USER_DIR_SUFFIX", fileSystemRepresentation(systemDirectorySuffix).data(), 0);
+ static char temporaryDirectory[PATH_MAX];
+ if (!confstr(_CS_DARWIN_USER_TEMP_DIR, temporaryDirectory, sizeof(temporaryDirectory))) {
+ fprintf(stderr, "WebProcess: couldn't retrieve private temporary directory path: %d\n", errno);
+ exit(EX_NOPERM);
+ }
+ setenv("TMPDIR", temporaryDirectory, 1);
+#endif
+
Vector<const char*> sandboxParameters;
// These are read-only.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes