Changeset 76034 in webkit
- Timestamp:
- Jan 18, 2011 10:11:15 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r76014 r76034 1 2011-01-18 Anders Carlsson <andersca@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 Plug-in hosting WebProcess instances appear in Activity Monitor as WebProcess 6 https://bugs.webkit.org/show_bug.cgi?id=52635 7 <rdar://problem/8731337> 8 9 * PluginProcess/PluginProcess.cpp: 10 (WebKit::PluginProcess::initialize): 11 Call platformInitialize. 12 13 * PluginProcess/PluginProcess.h: 14 Add platformInitialize. 15 16 * PluginProcess/mac/PluginProcessMac.mm: 17 (WebKit::PluginProcess::platformInitialize): 18 Set the compositing render server port and the visible application name. 19 20 * Shared/Plugins/PluginProcessCreationParameters.cpp: 21 (WebKit::PluginProcessCreationParameters::encode): 22 (WebKit::PluginProcessCreationParameters::decode): 23 Encode/decode the parent process name. 24 25 * Shared/Plugins/PluginProcessCreationParameters.h: 26 Add parentProcessName. 27 28 * Shared/WebProcessCreationParameters.cpp: 29 (WebKit::WebProcessCreationParameters::encode): 30 (WebKit::WebProcessCreationParameters::decode): 31 Encode/decode the parent process name. 32 33 * Shared/WebProcessCreationParameters.h: 34 Add parentProcessName. 35 36 * UIProcess/Launcher/mac/ProcessLauncherMac.mm: 37 (WebKit::ProcessLauncher::launchProcess): 38 Don't pass the parent process name here. 39 40 * UIProcess/Plugins/mac/PluginProcessProxyMac.mm: 41 (WebKit::PluginProcessProxy::platformInitializePluginProcess): 42 Set the visible name. 43 44 * UIProcess/mac/WebContextMac.mm: 45 (WebKit::WebContext::platformInitializeWebProcess): 46 Pass along the parent process name. 47 48 * WebProcess/mac/WebProcessMac.mm: 49 (WebKit::WebProcess::platformInitializeWebProcess): 50 Set the visible name. 51 52 * WebProcess/mac/WebProcessMainMac.mm: 53 (WebKit::WebProcessMain): 54 Don't set the visible name here. It's done in platformInitializeWebProcess. 55 1 56 2011-01-18 Balazs Kelemen <kbalazs@webkit.org> 2 57 -
trunk/Source/WebKit2/PluginProcess/PluginProcess.cpp
r74077 r76034 116 116 m_pluginPath = parameters.pluginPath; 117 117 118 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(MAC) 119 m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port(); 120 #endif 118 platformInitialize(parameters); 121 119 } 122 120 -
trunk/Source/WebKit2/PluginProcess/PluginProcess.h
r73419 r76034 73 73 void shutdownTimerFired(); 74 74 75 void platformInitialize(const PluginProcessCreationParameters&); 76 75 77 // The connection to the UI process. 76 78 RefPtr<CoreIPC::Connection> m_connection; -
trunk/Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm
r73391 r76034 25 25 26 26 #if ENABLE(PLUGIN_PROCESS) 27 28 // FIXME (WebKit2) <rdar://problem/8728860> WebKit2 needs to be localized 29 #define UI_STRING(__str, __desc) [NSString stringWithUTF8String:__str] 27 30 28 31 #include "PluginProcess.h" … … 30 33 #include "NetscapePlugin.h" 31 34 #include "PluginProcessShim.h" 35 #include "PluginProcessCreationParameters.h" 36 #include <WebKitSystemInterface.h> 32 37 #include <dlfcn.h> 33 38 … … 85 90 } 86 91 92 void PluginProcess::platformInitialize(const PluginProcessCreationParameters& parameters) 93 { 94 m_compositingRenderServerPort = parameters.acceleratedCompositingPort.port(); 95 96 NSString *applicationName = [NSString stringWithFormat:UI_STRING("%@ (%@ Internet plug-in)", 97 "visible name of the plug-in host process. The first argument is the plug-in name " 98 "and the second argument is the application name."), 99 [[(NSString *)parameters.pluginPath lastPathComponent] stringByDeletingPathExtension], 100 (NSString *)parameters.parentProcessName]; 101 102 WKSetVisibleApplicationName((CFStringRef)applicationName); 103 } 104 87 105 } // namespace WebKit 88 106 -
trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp
r71247 r76034 41 41 42 42 #if PLATFORM(MAC) 43 encoder->encode(parentProcessName); 43 44 encoder->encode(acceleratedCompositingPort); 44 45 #endif … … 51 52 52 53 #if PLATFORM(MAC) 54 if (!decoder->decode(result.parentProcessName)) 55 return false; 53 56 if (!decoder->decode(result.acceleratedCompositingPort)) 54 57 return false; -
trunk/Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h
r71247 r76034 51 51 52 52 #if PLATFORM(MAC) 53 String parentProcessName; 53 54 CoreIPC::MachPort acceleratedCompositingPort; 54 55 #endif -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.cpp
r75822 r76034 57 57 encoder->encode(textCheckerState); 58 58 #if PLATFORM(MAC) 59 encoder->encode(parentProcessName); 59 60 encoder->encode(presenterApplicationPid); 60 61 encoder->encode(nsURLCachePath); … … 96 97 97 98 #if PLATFORM(MAC) 99 if (!decoder->decode(parameters.parentProcessName)) 100 return false; 98 101 if (!decoder->decode(parameters.presenterApplicationPid)) 99 102 return false; -
trunk/Source/WebKit2/Shared/WebProcessCreationParameters.h
r75822 r76034 74 74 75 75 #if PLATFORM(MAC) 76 String parentProcessName; 77 76 78 pid_t presenterApplicationPid; 77 79 CString nsURLCachePath; -
trunk/Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm
r74219 r76034 50 50 namespace WebKit { 51 51 52 #if !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)53 static const char* processName()54 {55 return [[[NSProcessInfo processInfo] processName] fileSystemRepresentation];56 }57 #else58 // -[NSProcessInfo processName] isn't thread-safe on Leopard and Snow Leopard so we have our own implementation.59 static const char* createProcessName()60 {61 uint32_t bufferSize = MAXPATHLEN;62 char executablePath[bufferSize];63 64 if (_NSGetExecutablePath(executablePath, &bufferSize))65 return "";66 67 const char *processName = strrchr(executablePath, '/') + 1;68 return strdup(processName);69 }70 71 static const char* processName()72 {73 static const char* processName = createProcessName();74 return processName;75 }76 #endif77 78 52 static void setUpTerminationNotificationHandler(pid_t pid) 79 53 { … … 227 201 228 202 const char* path = [webProcessAppExecutablePath fileSystemRepresentation]; 229 const char* args[] = { path, bundlePath, "-type", processTypeAsString(m_launchOptions.processType), "-servicename", serviceName.data(), "-parentprocessname", processName(),0 };203 const char* args[] = { path, bundlePath, "-type", processTypeAsString(m_launchOptions.processType), "-servicename", serviceName.data(), 0 }; 230 204 231 205 // Register ourselves. -
trunk/Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm
r71247 r76034 36 36 { 37 37 #if USE(ACCELERATED_COMPOSITING) && HAVE(HOSTED_CORE_ANIMATION) 38 parameters.parentProcessName = [[NSProcessInfo processInfo] processName]; 38 39 mach_port_t renderServerPort = WKInitializeRenderServer(); 39 40 if (renderServerPort != MACH_PORT_NULL) -
trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm
r75822 r76034 75 75 76 76 NSURLCache *urlCache = [NSURLCache sharedURLCache]; 77 77 78 parameters.parentProcessName = [[NSProcessInfo processInfo] processName]; 78 79 parameters.nsURLCachePath = fileSystemRepresentation([(NSString *)cachePath.get() stringByStandardizingPath]); 79 80 parameters.nsURLCacheMemoryCapacity = [urlCache memoryCapacity]; -
trunk/Source/WebKit2/WebProcess/mac/WebProcessMac.mm
r75857 r76034 152 152 initializeSandbox(parameters); 153 153 154 if (!parameters.parentProcessName.isNull()) { 155 // FIXME (WebKit2) <rdar://problem/8728860> WebKit2 needs to be localized 156 NSString *applicationName = [NSString stringWithFormat:@"%@ Web Content", (NSString *)parameters.parentProcessName]; 157 WKSetVisibleApplicationName((CFStringRef)applicationName); 158 } 159 154 160 if (!parameters.nsURLCachePath.isNull()) { 155 161 NSUInteger cacheMemoryCapacity = parameters.nsURLCacheMemoryCapacity; -
trunk/Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm
r75814 r76034 81 81 RunLoop::initializeMainRunLoop(); 82 82 83 // Set the visible application name.84 String parentProcessName = commandLine["parentprocessname"];85 if (!parentProcessName.isNull()) {86 // FIXME: Localization!87 NSString *applicationName = [NSString stringWithFormat:@"%@ Web Content", (NSString *)parentProcessName];88 WKSetVisibleApplicationName((CFStringRef)applicationName);89 }90 91 83 // Create the connection. 92 84 WebProcess::shared().initialize(serverPort, RunLoop::main());
Note: See TracChangeset
for help on using the changeset viewer.