Bug 108098

Summary: Plug-ins should initialize their sandbox at creation time
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ap, mithro, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 108182    
Bug Blocks:    
Attachments:
Description Flags
Patch andersca: review+

Description Sam Weinig 2013-01-28 11:51:23 PST
Plug-ins should initialize their sandbox at creation time
Comment 1 Sam Weinig 2013-01-28 11:58:35 PST
Created attachment 185028 [details]
Patch
Comment 2 WebKit Review Bot 2013-01-28 12:10:28 PST
Attachment 185028 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebKit2/ChangeLog', u'Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/NetworkServiceMain.Development.mm', u'Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm', u'Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm', u'Source/WebKit2/PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm', u'Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginService.32/PluginService.32.Main.mm', u'Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginService.64/PluginService.64.Main.mm', u'Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/PluginService.Development.Main.mm', u'Source/WebKit2/PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm', u'Source/WebKit2/PluginProcess/PluginProcess.cpp', u'Source/WebKit2/PluginProcess/PluginProcess.h', u'Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm', u'Source/WebKit2/Shared/ChildProcess.h', u'Source/WebKit2/Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.h', u'Source/WebKit2/Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm', u'Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceBootstrapper.Development.h', u'Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceBootstrapper.h', u'Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h', u'Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm', u'Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.cpp', u'Source/WebKit2/Shared/Plugins/PluginProcessCreationParameters.h', u'Source/WebKit2/UIProcess/Launcher/ProcessLauncher.h', u'Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm', u'Source/WebKit2/UIProcess/Plugins/PluginProcessProxy.cpp', u'Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm', u'Source/WebKit2/WebKit2.xcodeproj/project.pbxproj', u'Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm', u'Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm', u'Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm']" exit_code: 1
Source/WebKit2/Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:47:  The parameter name "identifier" adds no information, so it should be removed.  [readability/parameter_name] [5]
Total errors found: 1 in 26 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Adam Barth 2013-01-28 12:13:41 PST
@mithro: I'm not sure we want to be showing the whole command.  (See previous comment for context.)
Comment 4 Anders Carlsson 2013-01-28 14:37:01 PST
Comment on attachment 185028 [details]
Patch

I think you should use the name "extraInitializationData" instead of "extraData". Looks great otherwise!
Comment 5 Alexey Proskuryakov 2013-01-28 18:16:31 PST
Comment on attachment 185028 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=185028&action=review

Very nice!

> Source/WebKit2/PluginProcess/mac/PluginProcessMac.mm:348
> +    NSDictionary *defaults = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithBool:YES], @"AppleMagnifiedMode", nil];

This is moved code, but a RetainPtr would be nice.

> Source/WebKit2/UIProcess/Launcher/mac/ProcessLauncherMac.mm:270
> +        connectToService(launchOptions, true, that, didFinishLaunchingProcessFunction, instanceUUID.get());

"true that"!

> Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm:142
> +    // FIXME: We should rip this out once we have a good place to install plug-in
> +    // sandbox profiles.

No need to wrap this short line.

> Source/WebKit2/UIProcess/Plugins/mac/PluginProcessProxyMac.mm:143
> +    NSString* sandboxProfileDirectoryPath = [[NSUserDefaults standardUserDefaults] stringForKey:WebKit2PlugInSandboxProfileDirectoryPathKey];

Misplaced star.
Comment 6 Sam Weinig 2013-01-28 21:59:39 PST
Committed r141051: <http://trac.webkit.org/changeset/141051>