Bug 27954 - [Chromium] Make it possible for FileSystem routines to work when outside the sandbox.
Summary: [Chromium] Make it possible for FileSystem routines to work when outside the ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Jeremy Orlow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-03 14:44 PDT by Jeremy Orlow
Modified: 2009-08-03 18:09 PDT (History)
3 users (show)

See Also:


Attachments
Patch v1 (11.05 KB, patch)
2009-08-03 14:50 PDT, Jeremy Orlow
no flags Details | Formatted Diff | Diff
Patch v1 (7.79 KB, patch)
2009-08-03 17:23 PDT, Jeremy Orlow
no flags Details | Formatted Diff | Diff
Patch v1 (8.77 KB, patch)
2009-08-03 17:36 PDT, Jeremy Orlow
fishd: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Orlow 2009-08-03 14:44:26 PDT
We can no longer assume that WebKit is always run within a sandbox.  Code running in the browser process should not use the VFS.  File system operations should be implementable.
Comment 1 Jeremy Orlow 2009-08-03 14:50:24 PDT
Created attachment 34005 [details]
Patch v1
Comment 2 Jeremy Orlow 2009-08-03 17:23:09 PDT
Created attachment 34029 [details]
Patch v1
Comment 3 Dumitru Daniliuc 2009-08-03 17:34:08 PDT
LGTM.

Minor: add NOTREACHED()s to SQLiteFileSystemChromium{Mac,Linux}.cpp
Comment 4 Jeremy Orlow 2009-08-03 17:36:31 PDT
Created attachment 34030 [details]
Patch v1
Comment 5 Darin Fisher (:fishd, Google) 2009-08-03 17:44:58 PDT
Comment on attachment 34030 [details]
Patch v1

> Index: WebCore/platform/chromium/ChromiumBridge.h
...
>          // File ---------------------------------------------------------------
> -        static bool getFileSize(const String& path, long long& result);
> +        static bool sandboxEnabled();

I think sandboxEnabled is not specific to file system stuff.  How about putting
this in a separate section?


> Index: WebCore/platform/sql/chromium/SQLiteFileSystemChromiumLinux.cpp
...
>      // stub for registering Chromium's SQLite VFS for Linux
> +    ASSERT_NOT_REACHED();

Isn't notImplemented() more correct?


> Index: WebCore/platform/sql/chromium/SQLiteFileSystemChromiumMac.cpp
...
>      // stub for registering Chromium's SQLite VFS for Mac
> +    ASSERT_NOT_REACHED();

ditto


> Index: WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp
...
> +    // FIXME: Make sure there aren't any unintended consequences when VFS code is called in the browser process.
> +    if (!ChromiumBridge::sandboxEnabled()) {
> +        ASSERT_NOT_REACHED();
> +        return;
> +    }

notImplemented?


These issues aren't major, so R=me
Comment 6 Jeremy Orlow 2009-08-03 17:51:54 PDT
(In reply to comment #5)
> (From update of attachment 34030 [details])
> > Index: WebCore/platform/chromium/ChromiumBridge.h
> ...
> >          // File ---------------------------------------------------------------
> > -        static bool getFileSize(const String& path, long long& result);
> > +        static bool sandboxEnabled();
> 
> I think sandboxEnabled is not specific to file system stuff.  How about putting
> this in a separate section?

I'll make this change.

> > Index: WebCore/platform/sql/chromium/SQLiteFileSystemChromiumLinux.cpp
> ...
> >      // stub for registering Chromium's SQLite VFS for Linux
> > +    ASSERT_NOT_REACHED();
> 
> Isn't notImplemented() more correct?

Not really.  notImplemented is not very noisy.  In this case, if we're hitting that code, something is very wrong.

Either way, the code should be going away as Dumi completes the implementation.
Comment 7 Jeremy Orlow 2009-08-03 18:09:08 PDT
Sending        WebCore/ChangeLog
Sending        WebCore/platform/chromium/ChromiumBridge.h
Sending        WebCore/platform/chromium/FileSystemChromium.cpp
Sending        WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp
Sending        WebCore/platform/sql/chromium/SQLiteFileSystemChromiumLinux.cpp
Sending        WebCore/platform/sql/chromium/SQLiteFileSystemChromiumMac.cpp
Sending        WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp
Transmitting file data .......
Committed revision 46741.
http://trac.webkit.org/changeset/46741