Bug 107182

Summary: IndexedDB: Conditionalize usage of env_idb.h to fix build for non-Chromium ports
Product: WebKit Reporter: Michael Pruett <michael>
Component: New BugsAssignee: Martin Robinson <mrobinson>
Status: RESOLVED FIXED    
Severity: Normal CC: dgrogan, jsbell, mrobinson, tony
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Michael Pruett 2013-01-17 14:48:55 PST
Currently Source/WebCore/platform/leveldb/LevelDBDatabase.cpp includes <env_idb.h>. This file is available only for the Chromium port but an implementation should be made available for other ports.
Comment 1 Martin Robinson 2013-01-17 15:47:29 PST
Created attachment 183301 [details]
Patch
Comment 2 David Grogan 2013-01-17 15:49:18 PST
Comment on attachment 183301 [details]
Patch

lgtm
Comment 3 Martin Robinson 2013-01-17 16:02:32 PST
Thanks David. I'll wait for all the bubbles to turn green before committing this.
Comment 4 Tony Chang 2013-01-17 16:13:25 PST
Comment on attachment 183301 [details]
Patch

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

> Source/WebCore/platform/leveldb/LevelDBDatabase.cpp:58
> +#if PLATFORM(CHROMIUM)
> +static leveldb::Env* defaultLevelDBEnvironment()
> +{
> +    return leveldb::IDBEnv();
> +}
> +#else
> +static leveldb::Env* defaultLevelDBEnvironment()

Nit: Why not scope the #if around the return?
Comment 5 Martin Robinson 2013-01-17 16:22:11 PST
(In reply to comment #4)
> (From update of attachment 183301 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=183301&action=review
> 
> > Source/WebCore/platform/leveldb/LevelDBDatabase.cpp:58
> > +#if PLATFORM(CHROMIUM)
> > +static leveldb::Env* defaultLevelDBEnvironment()
> > +{
> > +    return leveldb::IDBEnv();
> > +}
> > +#else
> > +static leveldb::Env* defaultLevelDBEnvironment()
> 
> Nit: Why not scope the #if around the return?

Just my preference against having conditional compilation inside functions instead of surrounding them. Michael actually suggested a way to make this patch simpler, so I'll try that.
Comment 6 Martin Robinson 2013-01-17 16:57:24 PST
Created attachment 183318 [details]
Patch
Comment 7 Martin Robinson 2013-01-17 20:05:09 PST
Committed r140099: <http://trac.webkit.org/changeset/140099>