Changeset 61120 in webkit


Ignore:
Timestamp:
Jun 14, 2010 6:42:54 AM (14 years ago)
Author:
bulach@chromium.org
Message:

2010-06-08 Marcus Bulach <bulach@chromium.org>

Reviewed by Jeremy Orlow.

Adds IndexedDB's KeyRange.
https://bugs.webkit.org/show_bug.cgi?id=40250

  • storage/indexeddb/idb-keyrange-expected.txt: Added.
  • storage/indexeddb/idb-keyrange.html: Added.
  • storage/indexeddb/script-tests/idb-keyrange.js: Added. (checkSingleKeyRange): (checkLeftBoundKeyRange): ():

2010-06-08 Marcus Bulach <bulach@chromium.org>

Reviewed by Jeremy Orlow.

Adds IndexedDB's KeyRange.
https://bugs.webkit.org/show_bug.cgi?id=40250

Test: storage/indexeddb/idb-keyrange.html

  • Android.derived.jscbindings.mk:
  • Android.derived.v8bindings.mk:
  • Android.mk:
  • CMakeLists.txt:
  • DerivedSources.cpp:
  • DerivedSources.make:
  • GNUmakefile.am:
  • WebCore.gypi:
  • WebCore.pri:
  • WebCore.pro:
  • WebCore.vcproj/WebCore.vcproj:
  • WebCore.xcodeproj/project.pbxproj:
  • storage/IDBKeyRange.cpp: Added. (WebCore::IDBKeyRange::IDBKeyRange):
  • storage/IDBKeyRange.h: Added. (WebCore::IDBKeyRange::): (WebCore::IDBKeyRange::create): (WebCore::IDBKeyRange::~IDBKeyRange): (WebCore::IDBKeyRange::left): (WebCore::IDBKeyRange::right): (WebCore::IDBKeyRange::flags):
  • storage/IDBKeyRange.idl: Added.
  • storage/IndexedDatabaseRequest.cpp: (WebCore::IndexedDatabaseRequest::makeSingleKeyRange): (WebCore::IndexedDatabaseRequest::makeLeftBoundKeyRange): (WebCore::IndexedDatabaseRequest::makeRightBoundKeyRange): (WebCore::IndexedDatabaseRequest::makeBoundKeyRange):
  • storage/IndexedDatabaseRequest.h:
  • storage/IndexedDatabaseRequest.idl:
Location:
trunk
Files:
3 added
17 edited
3 copied

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r61117 r61120  
     12010-06-08  Marcus Bulach  <bulach@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Adds IndexedDB's KeyRange.
     6        https://bugs.webkit.org/show_bug.cgi?id=40250
     7
     8        * storage/indexeddb/idb-keyrange-expected.txt: Added.
     9        * storage/indexeddb/idb-keyrange.html: Added.
     10        * storage/indexeddb/script-tests/idb-keyrange.js: Added.
     11        (checkSingleKeyRange):
     12        (checkLeftBoundKeyRange):
     13        ():
     14
    1152010-06-14  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
    216
  • trunk/WebCore/Android.derived.jscbindings.mk

    r60624 r61120  
    366366    $(intermediates)/storage/JSIDBEvent.h \
    367367    $(intermediates)/storage/JSIDBIndexRequest.h \
     368    $(intermediates)/storage/JSIDBKeyRange.h \
    368369    $(intermediates)/storage/JSIDBRequest.h \
    369370    $(intermediates)/storage/JSIDBSuccessEvent.h \
  • trunk/WebCore/Android.derived.v8bindings.mk

    r60777 r61120  
    347347    $(intermediates)/bindings/V8IDBEvent.h \
    348348    $(intermediates)/bindings/V8IDBIndexRequest.h \
     349    $(intermediates)/bindings/V8IDBKeyRange.h \
    349350    $(intermediates)/bindings/V8IDBRequest.h \
    350351    $(intermediates)/bindings/V8IDBSuccessEvent.h \
  • trunk/WebCore/Android.mk

    r61107 r61120  
    721721        storage/IDBIndexImpl.cpp \
    722722        storage/IDBIndexRequest.cpp \
     723        storage/IDBKeyRange.cpp \
    723724        storage/IDBObjectStoreImpl.cpp \
    724725        storage/IDBObjectStoreRequest.cpp \
  • trunk/WebCore/CMakeLists.txt

    r61107 r61120  
    330330    storage/IDBEvent.idl
    331331    storage/IDBIndexRequest.idl
     332    storage/IDBKeyRange.idl
    332333    storage/IDBObjectStoreRequest.idl
    333334    storage/IDBRequest.idl
     
    13761377    storage/IDBErrorEvent.cpp
    13771378    storage/IDBEvent.cpp
     1379    storage/IDBKeyRange.cpp
    13781380    storage/IDBRequest.cpp
    13791381    storage/IDBObjectStoreImpl.cpp
  • trunk/WebCore/ChangeLog

    r61119 r61120  
     12010-06-08  Marcus Bulach  <bulach@chromium.org>
     2
     3        Reviewed by Jeremy Orlow.
     4
     5        Adds IndexedDB's KeyRange.
     6        https://bugs.webkit.org/show_bug.cgi?id=40250
     7
     8        Test: storage/indexeddb/idb-keyrange.html
     9
     10        * Android.derived.jscbindings.mk:
     11        * Android.derived.v8bindings.mk:
     12        * Android.mk:
     13        * CMakeLists.txt:
     14        * DerivedSources.cpp:
     15        * DerivedSources.make:
     16        * GNUmakefile.am:
     17        * WebCore.gypi:
     18        * WebCore.pri:
     19        * WebCore.pro:
     20        * WebCore.vcproj/WebCore.vcproj:
     21        * WebCore.xcodeproj/project.pbxproj:
     22        * storage/IDBKeyRange.cpp: Added.
     23        (WebCore::IDBKeyRange::IDBKeyRange):
     24        * storage/IDBKeyRange.h: Added.
     25        (WebCore::IDBKeyRange::):
     26        (WebCore::IDBKeyRange::create):
     27        (WebCore::IDBKeyRange::~IDBKeyRange):
     28        (WebCore::IDBKeyRange::left):
     29        (WebCore::IDBKeyRange::right):
     30        (WebCore::IDBKeyRange::flags):
     31        * storage/IDBKeyRange.idl: Added.
     32        * storage/IndexedDatabaseRequest.cpp:
     33        (WebCore::IndexedDatabaseRequest::makeSingleKeyRange):
     34        (WebCore::IndexedDatabaseRequest::makeLeftBoundKeyRange):
     35        (WebCore::IndexedDatabaseRequest::makeRightBoundKeyRange):
     36        (WebCore::IndexedDatabaseRequest::makeBoundKeyRange):
     37        * storage/IndexedDatabaseRequest.h:
     38        * storage/IndexedDatabaseRequest.idl:
     39
    1402010-06-14  Jeremy Orlow  <jorlow@chromium.org>
    241
  • trunk/WebCore/DerivedSources.cpp

    r60624 r61120  
    176176#include "JSIDBEvent.cpp"
    177177#include "JSIDBIndexRequest.cpp"
     178#include "JSIDBKeyRange.cpp"
    178179#include "JSIDBObjectStoreRequest.cpp"
    179180#include "JSIDBRequest.cpp"
  • trunk/WebCore/DerivedSources.make

    r61091 r61120  
    219219    IDBEvent \
    220220    IDBIndexRequest \
     221    IDBKeyRange \
    221222    IDBObjectStoreRequest \
    222223    IDBRequest \
  • trunk/WebCore/GNUmakefile.am

    r61107 r61120  
    25012501        WebCore/storage/IDBEvent.idl \
    25022502        WebCore/storage/IDBIndexRequest.idl \
     2503        WebCore/storage/IDBKeyRange.idl \
    25032504        WebCore/storage/IDBObjectStoreRequest.idl \
    25042505        WebCore/storage/IDBRequest.idl \
     
    25292530        WebCore/storage/IDBIndexRequest.cpp \
    25302531        WebCore/storage/IDBIndexRequest.h \
     2532        WebCore/storage/IDBKeyRange.cpp \
     2533        WebCore/storage/IDBKeyRange.h \
    25312534        WebCore/storage/IDBObjectStore.h \
    25322535        WebCore/storage/IDBObjectStoreImpl.cpp \
  • trunk/WebCore/WebCore.gypi

    r61107 r61120  
    233233            'storage/IDBEvent.idl',
    234234            'storage/IDBIndexRequest.idl',
     235            'storage/IDBKeyRange.idl',
    235236            'storage/IDBObjectStoreRequest.idl',
    236237            'storage/IDBRequest.idl',
     
    33913392            'storage/IDBIndexRequest.cpp',
    33923393            'storage/IDBIndexRequest.h',
     3394            'storage/IDBKeyRange.cpp',
     3395            'storage/IDBKeyRange.h',
    33933396            'storage/IDBObjectStore.h',
    33943397            'storage/IDBObjectStoreImpl.cpp',
  • trunk/WebCore/WebCore.pri

    r61117 r61120  
    464464    storage/IDBEvent.idl \
    465465    storage/IDBIndexRequest.idl \
     466    storage/IDBKeyRange.idl \
    466467    storage/IDBObjectStoreRequest.idl \
    467468    storage/IDBRequest.idl \
  • trunk/WebCore/WebCore.pro

    r61117 r61120  
    23612361        storage/IDBIndexImpl.h \
    23622362        storage/IDBIndexRequest.h \
     2363        storage/IDBKeyRange.h \
    23632364        storage/IDBObjectStore.h \
    23642365        storage/IDBObjectStoreImpl.h \
     
    23792380        storage/IDBIndexImpl.cpp \
    23802381        storage/IDBIndexRequest.cpp \
     2382        storage/IDBKeyRange.cpp \
    23812383        storage/IDBObjectStoreImpl.cpp \
    23822384        storage/IDBObjectStoreRequest.cpp \
  • trunk/WebCore/WebCore.vcproj/WebCore.vcproj

    r61107 r61120  
    4106541065                                </File>
    4106641066                                <File
     41067                                        RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKeyRange.cpp"
     41068                                        >
     41069                                        <FileConfiguration
     41070                                                Name="Debug|Win32"
     41071                                                ExcludedFromBuild="true"
     41072                                                >
     41073                                                <Tool
     41074                                                        Name="VCCLCompilerTool"
     41075                                                />
     41076                                        </FileConfiguration>
     41077                                        <FileConfiguration
     41078                                                Name="Release|Win32"
     41079                                                ExcludedFromBuild="true"
     41080                                                >
     41081                                                <Tool
     41082                                                        Name="VCCLCompilerTool"
     41083                                                />
     41084                                        </FileConfiguration>
     41085                                        <FileConfiguration
     41086                                                Name="Debug_Internal|Win32"
     41087                                                ExcludedFromBuild="true"
     41088                                                >
     41089                                                <Tool
     41090                                                        Name="VCCLCompilerTool"
     41091                                                />
     41092                                        </FileConfiguration>
     41093                                        <FileConfiguration
     41094                                                Name="Debug_Cairo|Win32"
     41095                                                ExcludedFromBuild="true"
     41096                                                >
     41097                                                <Tool
     41098                                                        Name="VCCLCompilerTool"
     41099                                                />
     41100                                        </FileConfiguration>
     41101                                        <FileConfiguration
     41102                                                Name="Release_Cairo|Win32"
     41103                                                ExcludedFromBuild="true"
     41104                                                >
     41105                                                <Tool
     41106                                                        Name="VCCLCompilerTool"
     41107                                                />
     41108                                        </FileConfiguration>
     41109                                        <FileConfiguration
     41110                                                Name="Debug_All|Win32"
     41111                                                ExcludedFromBuild="true"
     41112                                                >
     41113                                                <Tool
     41114                                                        Name="VCCLCompilerTool"
     41115                                                />
     41116                                        </FileConfiguration>
     41117                                </File>
     41118                                <File
     41119                                        RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBKeyRange.h"
     41120                                        >
     41121                                </File>       
     41122                                <File
    4106741123                                        RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSIDBObjectStoreRequest.cpp"
    4106841124                                        >
     
    4651346569                                >
    4651446570                        </File>
     46571                        <File
     46572                                RelativePath="..\storage\IDBKeyRange.cpp"
     46573                                >
     46574                        </File>
     46575                        <File
     46576                                RelativePath="..\storage\IDBKeyRange.h"
     46577                                >
     46578                        </File>     
    4651546579                        <File
    4651646580                                RelativePath="..\storage\IDBObjectStore.h"
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r61107 r61120  
    13721372                7AFD4A8B1131C2760035B883 /* ScriptBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */; settings = {ATTRIBUTES = (Private, ); }; };
    13731373                7AFD4FF4113277B60035B883 /* ScriptDebugListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */; settings = {ATTRIBUTES = (Private, ); }; };
     1374                816C806811BE887E009A45E9 /* IDBKeyRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 816C806611BE887E009A45E9 /* IDBKeyRange.cpp */; };
     1375                816C806911BE887E009A45E9 /* IDBKeyRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 816C806711BE887E009A45E9 /* IDBKeyRange.h */; };
     1376                816C80AF11BE990D009A45E9 /* JSIDBKeyRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 816C80AE11BE990D009A45E9 /* JSIDBKeyRange.h */; };
     1377                816C80B111BE9934009A45E9 /* JSIDBKeyRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 816C80B011BE9934009A45E9 /* JSIDBKeyRange.cpp */; };
    13741378                82B658981189E39200E052A1 /* InspectorCSSStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 82B658971189E39200E052A1 /* InspectorCSSStore.h */; settings = {ATTRIBUTES = (Private, ); }; };
    13751379                82B6589A1189E47600E052A1 /* InspectorCSSStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 82B658991189E47600E052A1 /* InspectorCSSStore.cpp */; };
     
    70397043                7AFD4A8A1131C2760035B883 /* ScriptBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptBreakpoint.h; sourceTree = "<group>"; };
    70407044                7AFD4FF3113277B60035B883 /* ScriptDebugListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptDebugListener.h; sourceTree = "<group>"; };
     7045                816C806611BE887E009A45E9 /* IDBKeyRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBKeyRange.cpp; sourceTree = "<group>"; };
     7046                816C806711BE887E009A45E9 /* IDBKeyRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBKeyRange.h; sourceTree = "<group>"; };
     7047                816C80AE11BE990D009A45E9 /* JSIDBKeyRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBKeyRange.h; sourceTree = "<group>"; };
     7048                816C80B011BE9934009A45E9 /* JSIDBKeyRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSIDBKeyRange.cpp; sourceTree = "<group>"; };
     7049                81CC114011BEAA9D00D0D856 /* IDBKeyRange.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = IDBKeyRange.idl; sourceTree = "<group>"; };
    70417050                82B658971189E39200E052A1 /* InspectorCSSStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorCSSStore.h; sourceTree = "<group>"; };
    70427051                82B658991189E47600E052A1 /* InspectorCSSStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorCSSStore.cpp; sourceTree = "<group>"; };
     
    1105311062                        isa = PBXGroup;
    1105411063                        children = (
     11064                                81CC114011BEAA9D00D0D856 /* IDBKeyRange.idl */,
     11065                                816C806611BE887E009A45E9 /* IDBKeyRange.cpp */,
     11066                                816C806711BE887E009A45E9 /* IDBKeyRange.h */,
     11067                                B6B0540711B68F10002564C5 /* IDBObjectStoreImpl.cpp */,
     11068                                B6B0540811B68F10002564C5 /* IDBObjectStoreImpl.h */,
     11069                                B6693EEF11AD63F6003F2770 /* IDBObjectStoreRequest.idl */,
     11070                                B6693EE811AD63E6003F2770 /* IDBObjectStore.h */,
     11071                                B6693EE911AD63E6003F2770 /* IDBObjectStoreRequest.cpp */,
     11072                                B6693EEA11AD63E6003F2770 /* IDBObjectStoreRequest.h */,
    1105511073                                B5B5DC67119BB3D5002A8790 /* AbstractDatabase.cpp */,
    1105611074                                B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */,
     
    1451614534                                51E0BAE80DA55D4A00A9E417 /* JSStorageEvent.cpp */,
    1451714535                                51E0BAE90DA55D4A00A9E417 /* JSStorageEvent.h */,
     14536                                816C80AE11BE990D009A45E9 /* JSIDBKeyRange.h */,
     14537                                816C80B011BE9934009A45E9 /* JSIDBKeyRange.cpp */,
    1451814538                        );
    1451914539                        name = Storage;
     
    1947419494                                97DD4D870FDF4D6E00ECF9A4 /* XSSAuditor.h in Headers */,
    1947519495                                CE172E011136E8CE0062A533 /* ZoomMode.h in Headers */,
     19496                                B6693EEC11AD63E6003F2770 /* IDBObjectStore.h in Headers */,
     19497                                B6693EEE11AD63E6003F2770 /* IDBObjectStoreRequest.h in Headers */,
     19498                                B6693EF311AD6486003F2770 /* JSIDBObjectStoreRequest.h in Headers */,
     19499                                C51DA9A511AEF2C1009799C5 /* IDBIndex.h in Headers */,
     19500                                C51DA9A711AEF2C1009799C5 /* IDBIndexImpl.h in Headers */,
     19501                                C51DA9A911AEF2C1009799C5 /* IDBIndexRequest.h in Headers */,
     19502                                C5BBC9D111AEF838007C2BFE /* JSIDBIndexRequest.h in Headers */,
     19503                                B6B0540A11B68F10002564C5 /* IDBObjectStoreImpl.h in Headers */,
     19504                                816C806911BE887E009A45E9 /* IDBKeyRange.h in Headers */,
     19505                                816C80AF11BE990D009A45E9 /* JSIDBKeyRange.h in Headers */,
    1947619506                        );
    1947719507                        runOnlyForDeploymentPostprocessing = 0;
     
    2178021810                                E1BE512D0CF6C512002EA959 /* XSLTUnicodeSort.cpp in Sources */,
    2178121811                                97DD4D860FDF4D6E00ECF9A4 /* XSSAuditor.cpp in Sources */,
     21812                                B6693EED11AD63E6003F2770 /* IDBObjectStoreRequest.cpp in Sources */,
     21813                                B6693EF211AD6486003F2770 /* JSIDBObjectStoreRequest.cpp in Sources */,
     21814                                B627FB2D11AD743500E97B72 /* IDBDatabaseImpl.cpp in Sources */,
     21815                                C51DA9A611AEF2C1009799C5 /* IDBIndexImpl.cpp in Sources */,
     21816                                C51DA9A811AEF2C1009799C5 /* IDBIndexRequest.cpp in Sources */,
     21817                                C5BBC9D011AEF838007C2BFE /* JSIDBIndexRequest.cpp in Sources */,
     21818                                B6B0540911B68F10002564C5 /* IDBObjectStoreImpl.cpp in Sources */,
     21819                                816C806811BE887E009A45E9 /* IDBKeyRange.cpp in Sources */,
     21820                                816C80B111BE9934009A45E9 /* JSIDBKeyRange.cpp in Sources */,
    2178221821                        );
    2178321822                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/WebCore/storage/IDBKeyRange.cpp

    r61119 r61120  
    2424 */
    2525
    26 module storage {
     26#include "config.h"
     27#include "IDBKeyRange.h"
    2728
    28     interface [
    29         Conditional=INDEXED_DATABASE
    30     ] IndexedDatabaseRequest {
    31         [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description);
    32     };
     29#include "IDBAny.h"
     30#include "SerializedScriptValue.h"
    3331
     32#if ENABLE(INDEXED_DATABASE)
     33
     34namespace WebCore {
     35
     36IDBKeyRange::IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags)
     37    : m_left(IDBAny::create())
     38    , m_right(IDBAny::create())
     39    , m_flags(flags)
     40{
     41    m_left->set(left);
     42    m_right->set(right);
    3443}
     44
     45} // namespace WebCore
     46
     47#endif // ENABLE(INDEXED_DATABASE)
  • trunk/WebCore/storage/IDBKeyRange.h

    r61119 r61120  
    1111 *     notice, this list of conditions and the following disclaimer in the
    1212 *     documentation and/or other materials provided with the distribution.
    13  * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
    14  *     its contributors may be used to endorse or promote products derived
    15  *     from this software without specific prior written permission.
    1613 *
    1714 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
     
    2623 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2724 */
    28 #ifndef IndexedDatabaseRequest_h
    29 #define IndexedDatabaseRequest_h
    3025
    31 #include "ExceptionCode.h"
    32 #include "IndexedDatabase.h"
    33 #include "PlatformString.h"
    34 #include <wtf/PassRefPtr.h>
    35 #include <wtf/RefCounted.h>
    36 #include <wtf/RefPtr.h>
     26#ifndef IDBKeyRange_h
     27#define IDBKeyRange_h
    3728
    3829#if ENABLE(INDEXED_DATABASE)
    3930
     31#include "IDBAny.h"
     32#include <wtf/PassRefPtr.h>
     33#include <wtf/RefCounted.h>
     34
    4035namespace WebCore {
    4136
    42 class IDBAny;
    43 class IDBRequest;
    44 class IndexedDatabase;
    45 class ScriptExecutionContext;
     37class SerializedScriptValue;
    4638
    47 class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> {
     39class IDBKeyRange : public RefCounted<IDBKeyRange> {
    4840public:
    49     static PassRefPtr<IndexedDatabaseRequest> create(IndexedDatabase* indexedDatabase)
     41    // Keep in sync with what's in the .idl file.
     42    enum Flags {
     43        SINGLE = 0,
     44        LEFT_OPEN = 1,
     45        RIGHT_OPEN = 2,
     46        LEFT_BOUND = 4,
     47        RIGHT_BOUND = 8,
     48    };
     49
     50    static PassRefPtr<IDBKeyRange> create(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags)
    5051    {
    51         return adoptRef(new IndexedDatabaseRequest(indexedDatabase));
     52        return adoptRef(new IDBKeyRange(left, right, flags));
    5253    }
    53     ~IndexedDatabaseRequest();
     54    ~IDBKeyRange() { }
    5455
    55     PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description);
     56
     57    PassRefPtr<IDBAny> left() const { return m_left; }
     58    PassRefPtr<IDBAny> right() const { return m_right; }
     59    unsigned short flags() const { return m_flags; }
    5660
    5761private:
    58     IndexedDatabaseRequest(IndexedDatabase*);
     62    IDBKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, unsigned short flags);
    5963
    60     RefPtr<IndexedDatabase> m_indexedDatabase;
    61     RefPtr<IDBAny> m_this;
     64    RefPtr<IDBAny> m_left;
     65    RefPtr<IDBAny> m_right;
     66    unsigned short m_flags;
    6267};
    6368
     
    6671#endif
    6772
    68 #endif // IndexedDatabaseRequest_h
    69 
     73#endif // IDBKeyRange_h
  • trunk/WebCore/storage/IDBKeyRange.idl

    r61119 r61120  
    2828    interface [
    2929        Conditional=INDEXED_DATABASE
    30     ] IndexedDatabaseRequest {
    31         [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description);
     30    ] IDBKeyRange {
     31        // Keep in sync with what's in the .h file.
     32        const unsigned short SINGLE = 0;
     33        const unsigned short LEFT_OPEN = 1;
     34        const unsigned short RIGHT_OPEN = 2;
     35        const unsigned short LEFT_BOUND = 4;
     36        const unsigned short RIGHT_BOUND = 8;
     37
     38        readonly attribute IDBAny left;
     39        readonly attribute IDBAny right;
     40        readonly attribute unsigned short flags;
    3241    };
    3342
  • trunk/WebCore/storage/IndexedDatabaseRequest.cpp

    r60776 r61120  
    3434#include "Frame.h"
    3535#include "IDBDatabase.h"
     36#include "IDBKeyRange.h"
    3637#include "IDBRequest.h"
    3738#include "IndexedDatabase.h"
     
    6869}
    6970
     71PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeSingleKeyRange(PassRefPtr<SerializedScriptValue> prpValue)
     72{
     73    RefPtr<SerializedScriptValue> value = prpValue;
     74    return IDBKeyRange::create(value, value, IDBKeyRange::SINGLE);
     75}
     76
     77PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open)
     78{
     79    return IDBKeyRange::create(bound, SerializedScriptValue::create(), open ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND);
     80}
     81
     82PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open)
     83{
     84    return IDBKeyRange::create(SerializedScriptValue::create(), bound, open ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND);
     85}
     86
     87PassRefPtr<IDBKeyRange> IndexedDatabaseRequest::makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft, bool openRight)
     88{
     89    unsigned short flags = openLeft ? IDBKeyRange::LEFT_OPEN : IDBKeyRange::LEFT_BOUND;
     90    flags |= openRight ? IDBKeyRange::RIGHT_OPEN : IDBKeyRange::RIGHT_BOUND;
     91    return IDBKeyRange::create(left, right, flags);
     92}
     93
    7094} // namespace WebCore
    7195
  • trunk/WebCore/storage/IndexedDatabaseRequest.h

    r61119 r61120  
    4141
    4242class IDBAny;
     43class IDBKeyRange;
    4344class IDBRequest;
    4445class IndexedDatabase;
    4546class ScriptExecutionContext;
     47class SerializedScriptValue;
    4648
    4749class IndexedDatabaseRequest : public RefCounted<IndexedDatabaseRequest> {
     
    5456
    5557    PassRefPtr<IDBRequest> open(ScriptExecutionContext*, const String& name, const String& description);
     58    PassRefPtr<IDBKeyRange> makeSingleKeyRange(PassRefPtr<SerializedScriptValue> value);
     59    PassRefPtr<IDBKeyRange> makeLeftBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false);
     60    PassRefPtr<IDBKeyRange> makeRightBoundKeyRange(PassRefPtr<SerializedScriptValue> bound, bool open = false);
     61    PassRefPtr<IDBKeyRange> makeBoundKeyRange(PassRefPtr<SerializedScriptValue> left, PassRefPtr<SerializedScriptValue> right, bool openLeft = false, bool openRight = false);
    5662
    5763private:
  • trunk/WebCore/storage/IndexedDatabaseRequest.idl

    r60776 r61120  
    3030    ] IndexedDatabaseRequest {
    3131        [CallWith=ScriptExecutionContext] IDBRequest open(in DOMString name, in DOMString description);
     32        IDBKeyRange makeSingleKeyRange(in SerializedScriptValue value);
     33        IDBKeyRange makeLeftBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open);
     34        IDBKeyRange makeRightBoundKeyRange(in SerializedScriptValue bound, in [Optional] boolean open);
     35        IDBKeyRange makeBoundKeyRange(in SerializedScriptValue left, in SerializedScriptValue right, in [Optional] boolean openLeft, in [Optional] boolean openRight);
    3236    };
    3337
Note: See TracChangeset for help on using the changeset viewer.