This is to add the ability to configure JavaScriptCore debug and logging from within the Web process for iOS through the presence of a configuration file.
<rdar://problem/30983159>
Created attachment 304088 [details] Patch
Attachment 304088 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h:72: The parameter name "shouldCreateDirectory" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 304088 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=304088&action=review r- while you clean up the unnecessary settings. The only setting that appears to be used is WebProcess reading a default directly from standardUserDefaults. That makes some sense (instead of using WKPreferences) because you want this to happen before initializing any pages. All of the rest (WebCore::Settings, WebKitLegacy WebPreferences, and WebKit2 WebPreferences) are unused and only partially implemented, so they should be removed. > Source/WebCore/page/Settings.in:188 > +javaScriptCoreUseConfigurationFileEnabled initial=false I don't see this WebCore::Setting getting used anywhere. Seems it can just be removed. > Source/WebKit2/Shared/WebPreferencesDefinitions.h:295 > + macro(JavaScriptCoreUseConfigurationFileEnabled, javaScriptCoreUseConfigurationFileEnabled, Bool, bool, false, "", "") \ This also looks like it is unused. > Source/WebKit2/UIProcess/API/APIWebsiteDataStore.cpp:153 > +String WebsiteDataStore::defaultJavaScriptConfigurationDirectory() This doesn't make sense to put in WebSiteDataStore. This JavaScript Configuration file is not data that a place to store data that a website produces (caches, web storage, etc). The configuration directory is just a path WebKit wants to check for a config file. Also, it appears to only be used inside of WebProcess construction so it doesn't need to leak out into other places. I realize that this already made it into WebsiteDataStore earlier with r213690. It is my understanding that WebsiteDataStore was used for its ease of getting a path within the container. That can still be used via the static WebsiteDataStore::tempDirectoryFileSystemRepresentation function. I'd suggest cleaning this up later, but it isn't critical to clean up now. > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:3151 > + settings.setJavaScriptCoreUseConfigurationFileEnabled(store.getBoolValueForKey(WebPreferencesKey::javaScriptCoreUseConfigurationFileEnabledKey())); This WebCore::Setting isn't getting used. > Source/WebKit/mac/WebView/WebPreferences.mm:449 > + [NSNumber numberWithBool:NO], WebKitJavaScriptCoreUseConfigFile, This isn't used by anything either.
Created attachment 304187 [details] Updated patch addressing the issues of the initial patch.
Attachment 304187 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/API/APIWebsiteDataStore.h:72: The parameter name "shouldCreateDirectory" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Comment on attachment 304187 [details] Updated patch addressing the issues of the initial patch. View in context: https://bugs.webkit.org/attachment.cgi?id=304187&action=review r=me > Source/WebKit2/UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:118 > + if (shouldCreateDirectory == CreateDirectory > + && (![[NSFileManager defaultManager] createDirectoryAtURL:url withIntermediateDirectories:YES attributes:nil error:nullptr])) I don't really think this is a security measure, but I guess it's nice to be able to limit logging to a specific app, so I guess this is good.
Committed r213854: <http://trac.webkit.org/changeset/213854>