Changeset 183209 in webkit
- Timestamp:
- Apr 23, 2015, 2:14:56 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r183190 r183209 1 2015-04-23 Alexey Proskuryakov <ap@apple.com> 2 3 [iOS] WebKit services should inherit environment variables for home 4 https://bugs.webkit.org/show_bug.cgi?id=144078 5 rdar://problem/20571678 6 7 Reviewed by Dan Bernstein. 8 9 * wtf/spi/darwin/XPCSPI.h: Added xpc_copy_bootstrap and xpc_dictionary_apply. 10 1 11 2015-04-23 Alexey Proskuryakov <ap@apple.com> 2 12 -
trunk/Source/WTF/wtf/spi/darwin/XPCSPI.h
r183126 r183209 59 59 #if COMPILER_SUPPORTS(BLOCKS) 60 60 typedef bool (^xpc_array_applier_t)(size_t index, xpc_object_t); 61 typedef bool (^xpc_dictionary_applier_t)(const char *key, xpc_object_t value); 61 62 typedef void (^xpc_handler_t)(xpc_object_t); 62 63 #endif … … 99 100 #if COMPILER_SUPPORTS(BLOCKS) 100 101 EXTERN_C bool xpc_array_apply(xpc_object_t, xpc_array_applier_t); 102 EXTERN_C bool xpc_dictionary_apply(xpc_object_t xdict, xpc_dictionary_applier_t applier); 101 103 #endif 102 104 EXTERN_C size_t xpc_array_get_count(xpc_object_t); … … 143 145 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000 144 146 EXTERN_C void xpc_connection_set_bootstrap(xpc_connection_t, xpc_object_t bootstrap); 147 EXTERN_C xpc_object_t xpc_copy_bootstrap(void); 145 148 #endif 146 149 -
trunk/Source/WebCore/ChangeLog
r183204 r183209 1 2015-04-22 Alexey Proskuryakov <ap@apple.com> 2 3 [iOS] WebKit services should inherit environment variables for home 4 https://bugs.webkit.org/show_bug.cgi?id=144078 5 rdar://problem/20571678 6 7 Reviewed by Dan Bernstein. 8 9 Added an SPI header for a drive-by fix. 10 11 * WebCore.xcodeproj/project.pbxproj: 12 * platform/spi/cf/CFBundleSPI.h: Added. 13 1 14 2015-04-23 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r183195 r183209 5999 5999 E107400D0E77BDC00033AF24 /* JSMessageChannel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */; }; 6000 6000 E107400E0E77BDC00033AF24 /* JSMessageChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = E107400C0E77BDC00033AF24 /* JSMessageChannel.h */; }; 6001 E10A39E21AE84E7100A29AE3 /* CFBundleSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = E10A39E11AE84E7100A29AE3 /* CFBundleSPI.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6001 6002 E10B937C0B73C00A003ED890 /* JSCustomXPathNSResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */; }; 6002 6003 E10B93C30B73C291003ED890 /* JSCustomXPathNSResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */; }; … … 13605 13606 E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageChannel.cpp; sourceTree = "<group>"; }; 13606 13607 E107400C0E77BDC00033AF24 /* JSMessageChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSMessageChannel.h; sourceTree = "<group>"; }; 13608 E10A39E11AE84E7100A29AE3 /* CFBundleSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFBundleSPI.h; sourceTree = "<group>"; }; 13607 13609 E10B937B0B73C00A003ED890 /* JSCustomXPathNSResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomXPathNSResolver.h; sourceTree = "<group>"; }; 13608 13610 E10B93C20B73C291003ED890 /* JSCustomXPathNSResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomXPathNSResolver.cpp; sourceTree = "<group>"; }; … … 16492 16494 isa = PBXGroup; 16493 16495 children = ( 16496 E10A39E11AE84E7100A29AE3 /* CFBundleSPI.h */, 16494 16497 65086DA719AC1719009AF46B /* CFLocaleSPI.h */, 16495 16498 CE8245EF19B671BA00AC0122 /* CFNetworkConnectionCacheSPI.h */, … … 27156 27159 416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */, 27157 27160 2E4346530F546A8200B0F1BA /* WorkerRunLoop.h in Headers */, 27161 E10A39E21AE84E7100A29AE3 /* CFBundleSPI.h in Headers */, 27158 27162 F3820899147D35F90010BC06 /* WorkerRuntimeAgent.h in Headers */, 27159 27163 E1A643F20EC0972500779668 /* WorkerScriptController.h in Headers */, -
trunk/Source/WebKit2/ChangeLog
r183208 r183209 1 2015-04-22 Alexey Proskuryakov <ap@apple.com> 2 3 [iOS] WebKit services should inherit environment variables for home 4 https://bugs.webkit.org/show_bug.cgi?id=144078 5 rdar://problem/20571678 6 7 Reviewed by Dan Bernstein. 8 9 Pass current environment variables as XPC bootstrap. Also while at it, made 10 _CFBundleSetupXPCBootstrap not soft linked. 11 12 * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm: 13 (main): 14 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: 15 (WebKit::connectToService): 16 1 17 2015-04-23 Enrica Casucci <enrica@apple.com> 2 18 -
trunk/Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm
r174220 r183209 78 78 int main(int argc, char** argv) 79 79 { 80 #if PLATFORM(IOS) 81 auto bootstrap = adoptOSObject(xpc_copy_bootstrap()); 82 auto containerEnvironmentVariables = xpc_dictionary_get_value(bootstrap.get(), "ContainerEnvironmentVariables"); 83 xpc_dictionary_apply(containerEnvironmentVariables, ^(const char *key, xpc_object_t value) { 84 setenv(key, xpc_string_get_string_ptr(value), 1); 85 return true; 86 }); 87 #endif 88 80 89 xpc_main(XPCServiceEventHandler); 81 90 return 0; -
trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
r179732 r183209 29 29 #import "DynamicLinkerEnvironmentExtractor.h" 30 30 #import "EnvironmentVariables.h" 31 #import <WebCore/CFBundleSPI.h> 31 32 #import <WebCore/ServersSPI.h> 32 33 #import <WebCore/SoftLinking.h> … … 46 47 #import <wtf/text/WTFString.h> 47 48 48 #if PLATFORM(IOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 10100049 // FIXME: Soft linking is temporary, make this into a regular function call once this function is available everywhere we need.50 SOFT_LINK_FRAMEWORK(CoreFoundation)51 SOFT_LINK_OPTIONAL(CoreFoundation, _CFBundleSetupXPCBootstrap, void, unused, (xpc_object_t))52 #endif53 54 49 namespace WebKit { 55 50 … … 223 218 // 1.1. An important case is WebKitTestRunner, where we should use English localizations for all system frameworks. 224 219 // 2. When AppleLanguages is passed as command line argument for UI process, or set in its preferences, we should respect it in child processes. 225 if (_CFBundleSetupXPCBootstrapPtr()) { 226 auto initializationMessage = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0)); 227 _CFBundleSetupXPCBootstrapPtr()(initializationMessage.get()); 228 xpc_connection_set_bootstrap(connection.get(), initializationMessage.get()); 229 } 220 auto initializationMessage = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0)); 221 _CFBundleSetupXPCBootstrap(initializationMessage.get()); 222 #if PLATFORM(IOS) 223 // Clients that set these environment variables explicitly do not have the values automatically forwarded by libxpc. 224 auto containerEnvironmentVariables = adoptOSObject(xpc_dictionary_create(nullptr, nullptr, 0)); 225 if (const char* environmentHOME = getenv("HOME")) 226 xpc_dictionary_set_string(containerEnvironmentVariables.get(), "HOME", environmentHOME); 227 if (const char* environmentCFFIXED_USER_HOME = getenv("CFFIXED_USER_HOME")) 228 xpc_dictionary_set_string(containerEnvironmentVariables.get(), "CFFIXED_USER_HOME", environmentCFFIXED_USER_HOME); 229 if (const char* environmentTMPDIR = getenv("TMPDIR")) 230 xpc_dictionary_set_string(containerEnvironmentVariables.get(), "TMPDIR", environmentTMPDIR); 231 xpc_dictionary_set_value(initializationMessage.get(), "ContainerEnvironmentVariables", containerEnvironmentVariables.get()); 232 #endif 233 xpc_connection_set_bootstrap(connection.get(), initializationMessage.get()); 230 234 #endif 231 235
Note:
See TracChangeset
for help on using the changeset viewer.