Bug 112571

Summary: [Chromium] Create WebFileSystemType enum to allow easier filesystem refactoring
Product: WebKit Reporter: Mark Pilgrim (Google) <pilgrim>
Component: WebKit Misc.Assignee: Mark Pilgrim (Google) <pilgrim>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dglazkov, fishd, haraken, jamesr, tkent+wkapi, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 106829    
Attachments:
Description Flags
WIP Patch
none
Patch
none
Patch
none
Patch none

Description Mark Pilgrim (Google) 2013-03-18 07:19:53 PDT
[Chromium] Create WebFileSystemType enum to allow easier filesystem refactoring
Comment 1 Mark Pilgrim (Google) 2013-03-18 07:22:40 PDT
Created attachment 193557 [details]
WIP Patch
Comment 2 Mark Pilgrim (Google) 2013-03-18 07:23:26 PDT
Comment on attachment 193557 [details]
WIP Patch

Pretty sure this will break Chromium build. Still working on it.
Comment 3 WebKit Review Bot 2013-03-18 07:25:58 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 4 Mark Pilgrim (Google) 2013-03-18 10:24:58 PDT
Nope, this definitely needs to be behind a #define so we don't break Chromium.
Comment 5 Mark Pilgrim (Google) 2013-03-18 10:51:45 PDT
Created attachment 193603 [details]
Patch
Comment 6 Mark Pilgrim (Google) 2013-03-18 10:52:57 PDT
Comment on attachment 193603 [details]
Patch

OK, this version puts all changes behind #ifdefs so we can make the changes in Chromium and then turn on everything at once.
Comment 7 Adam Barth 2013-03-18 10:54:56 PDT
Comment on attachment 193603 [details]
Patch

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

> Source/Platform/chromium/public/WebFileSystemType.h:35
> +// #define USE_NEW_WEBFILESYSTEMTYPE

USE_NEW_WEBFILESYSTEMTYPE -> WEBKIT_USE_NEW_WEBFILESYSTEMTYPE

> Source/WebKit/chromium/public/WebCommonWorkerClient.h:67
> +#ifdef USE_NEW_WEBFILESYSTEMTYPE
> +    virtual void openFileSystem(WebFileSystemType, long long size, bool create, WebFileSystemCallbacks*)
> +#else
>      virtual void openFileSystem(WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*)
> +#endif

Can you use a typedef to avoid adding this ifdef everywhere?
Comment 8 Mark Pilgrim (Google) 2013-03-18 10:57:58 PDT
(In reply to comment #7)
> (From update of attachment 193603 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=193603&action=review
> 
> > Source/Platform/chromium/public/WebFileSystemType.h:35
> > +// #define USE_NEW_WEBFILESYSTEMTYPE
> 
> USE_NEW_WEBFILESYSTEMTYPE -> WEBKIT_USE_NEW_WEBFILESYSTEMTYPE

Grr.

> > Source/WebKit/chromium/public/WebCommonWorkerClient.h:67
> > +#ifdef USE_NEW_WEBFILESYSTEMTYPE
> > +    virtual void openFileSystem(WebFileSystemType, long long size, bool create, WebFileSystemCallbacks*)
> > +#else
> >      virtual void openFileSystem(WebFileSystem::Type, long long size, bool create, WebFileSystemCallbacks*)
> > +#endif
> 
> Can you use a typedef to avoid adding this ifdef everywhere?

Couldn't figure it out. Enlisted help from several C++ gurus. Enums can't define casting operators, enum names don't match because of WebKit* prefixing. The whole mess will be resolved after one Chromium patch lands, so it's not really worth any more time trying to be clever.
Comment 9 Mark Pilgrim (Google) 2013-03-18 11:01:11 PDT
Created attachment 193607 [details]
Patch
Comment 10 Mark Pilgrim (Google) 2013-03-18 11:01:45 PDT
Comment on attachment 193607 [details]
Patch

Now with WEBKIT_USE_NEW_WEBFILESYSTEMTYPE
Comment 11 Adam Barth 2013-03-18 11:53:17 PDT
Comment on attachment 193607 [details]
Patch

ok
Comment 12 Mark Pilgrim (Google) 2013-03-18 12:13:49 PDT
Comment on attachment 193607 [details]
Patch

Nope, turns out there's two more files (in DumpRenderTree) that need munging.
Comment 13 Mark Pilgrim (Google) 2013-03-18 12:22:20 PDT
Created attachment 193627 [details]
Patch
Comment 14 Mark Pilgrim (Google) 2013-03-18 12:23:01 PDT
Comment on attachment 193627 [details]
Patch

Now with necessary DumpRenderTree changes.
Comment 15 WebKit Review Bot 2013-03-18 13:28:47 PDT
Comment on attachment 193627 [details]
Patch

Clearing flags on attachment: 193627

Committed r146111: <http://trac.webkit.org/changeset/146111>
Comment 16 WebKit Review Bot 2013-03-18 13:28:52 PDT
All reviewed patches have been landed.  Closing bug.