Bug 134000

Summary: Expose the location of website data
Product: WebKit Reporter: Anders Carlsson <andersca>
Component: New BugsAssignee: Anders Carlsson <andersca>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, mitz
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch mitz: review+

Description Anders Carlsson 2014-06-17 15:52:51 PDT
Expose the location of website data
Comment 1 Anders Carlsson 2014-06-17 15:54:45 PDT
Created attachment 233264 [details]
Patch
Comment 2 WebKit Commit Bot 2014-06-17 15:56:29 PDT
Attachment 233264 [details] did not pass style-queue:


ERROR: Source/WebKit2/Shared/mac/SandboxUtilities.cpp:39:  sandbox_container_path_for_pid is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 mitz 2014-06-17 16:08:05 PDT
Comment on attachment 233264 [details]
Patch

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

> Source/WebKit2/Shared/mac/SandboxUtilities.cpp:50
> +static bool processIsAppSandboxed(pid_t pid)

Given what this does, I think the name is wrong. There is a difference between being in a container and being app-sandboxed (which implies the former), but this checks just for the container. So I think the name should be something like processHasContainer().

> Source/WebKit2/Shared/mac/SandboxUtilities.cpp:57
> +    if (path[0] == '\0')

!path[0]

> Source/WebKit2/Shared/mac/SandboxUtilities.cpp:63
> +bool processIsAppSandboxed()

Ditto.

> Source/WebKit2/UIProcess/API/Cocoa/WKProcessPool.mm:108
> ++ (NSURL *)_websiteDataURLForContainerWithURL:(NSURL *)containerURL

The fact that the containerURL parameter isn’t used is telling. This won’t work if called from a process that doesn’t have a container and wants to find the website data location for a process with the given container.
Comment 4 Anders Carlsson 2014-06-17 16:22:41 PDT
Created attachment 233267 [details]
Patch
Comment 5 WebKit Commit Bot 2014-06-17 16:24:15 PDT
Attachment 233267 [details] did not pass style-queue:


ERROR: Source/WebKit2/Shared/mac/SandboxUtilities.cpp:39:  sandbox_container_path_for_pid is incorrectly named. Don't use underscores in your identifier names.  [readability/naming/underscores] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 6 mitz 2014-06-17 16:32:38 PDT
Comment on attachment 233267 [details]
Patch

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

> Source/WebKit2/Shared/mac/SandboxUtilities.cpp:57
> +    if (path[0] == '\0')

!path[0]
Comment 7 Anders Carlsson 2014-06-17 16:37:11 PDT
Committed r170084: <http://trac.webkit.org/changeset/170084>
Comment 8 mitz 2014-06-18 09:22:47 PDT
<rdar://problem/17350498>