Bug 169489

Summary: Add iOS plumbing to WebProcess to enable JavaScriptCore configuration and logging
Product: WebKit Reporter: Michael Saboff <msaboff>
Component: WebKit2Assignee: Michael Saboff <msaboff>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, joepeck
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
joepeck: review-
Updated patch addressing the issues of the initial patch. ggaren: review+

Michael Saboff
Reported 2017-03-10 15:49:29 PST
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.
Attachments
Patch (14.04 KB, patch)
2017-03-10 15:51 PST, Michael Saboff
joepeck: review-
Updated patch addressing the issues of the initial patch. (8.11 KB, patch)
2017-03-11 22:11 PST, Michael Saboff
ggaren: review+
Michael Saboff
Comment 1 2017-03-10 15:49:47 PST
Michael Saboff
Comment 2 2017-03-10 15:51:24 PST
WebKit Commit Bot
Comment 3 2017-03-10 16:10:23 PST
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.
Joseph Pecoraro
Comment 4 2017-03-10 17:40:10 PST
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.
Michael Saboff
Comment 5 2017-03-11 22:11:19 PST
Created attachment 304187 [details] Updated patch addressing the issues of the initial patch.
WebKit Commit Bot
Comment 6 2017-03-11 22:13:10 PST
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.
Geoffrey Garen
Comment 7 2017-03-13 10:47:40 PDT
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.
Michael Saboff
Comment 8 2017-03-13 10:51:56 PDT
Note You need to log in before you can comment on or make changes to this bug.