| Differences between
and this patch
- Source/WebCore/ChangeLog +29 lines
Lines 1-3 Source/WebCore/ChangeLog_sec1
1
2012-02-24  Mark Pilgrim  <pilgrim@chromium.org>
2
3
        Switch indexeddb to use supplemental IDL for WorkerContext
4
        https://bugs.webkit.org/show_bug.cgi?id=79508
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        No new tests. (OOPS!)
9
10
        * Modules/indexeddb/WorkerContextIndexedDB.cpp: Added.
11
        (WorkerContextIndexedDB::WorkerContextIndexedDB):
12
        (WorkerContextIndexedDB::~WorkerContextIndexedDB):
13
        (WorkerContextIndexedDB::webkitIndexedDB):
14
        * Modules/indexeddb/WorkerContextIndexedDB.h: Added.
15
        (WebCore):
16
        (WorkerContextIndexedDB):
17
        * Modules/indexeddb/WorkerContextIndexedDB.idl: Added.
18
        * WebCore.gypi:
19
        * page/DOMWindow.h:
20
        (DOMWindow):
21
        (WebCore::DOMWindow::defaultStatus):
22
        * workers/WorkerContext.cpp:
23
        (WebCore::WorkerContext::notifyObserversOfStop):
24
        * workers/WorkerContext.h:
25
        (WebCore::WorkerContext::idbFactory):
26
        (WorkerContext):
27
        (WebCore::WorkerContext::idbFactoryBackendInterface):
28
        * workers/WorkerContext.idl:
29
1
2012-02-24  Adam Klein  <adamk@chromium.org>
30
2012-02-24  Adam Klein  <adamk@chromium.org>
2
31
3
        Don't notify the inspector of Node insertions initiated by the parser
32
        Don't notify the inspector of Node insertions initiated by the parser
- Source/WebCore/WebCore.gypi +3 lines
Lines 727-732 Source/WebCore/WebCore.gypi_sec1
727
            'Modules/geolocation/PositionError.idl',
727
            'Modules/geolocation/PositionError.idl',
728
            'Modules/geolocation/PositionErrorCallback.idl',
728
            'Modules/geolocation/PositionErrorCallback.idl',
729
            'Modules/indexeddb/DOMWindowIndexedDatabase.idl',
729
            'Modules/indexeddb/DOMWindowIndexedDatabase.idl',
730
            'Modules/indexeddb/WorkerContextIndexedDB.idl',
730
            'Modules/intents/DOMWindowIntents.idl',
731
            'Modules/intents/DOMWindowIntents.idl',
731
            'Modules/intents/Intent.idl',
732
            'Modules/intents/Intent.idl',
732
            'Modules/intents/IntentResultCallback.idl',
733
            'Modules/intents/IntentResultCallback.idl',
Lines 1292-1297 Source/WebCore/WebCore.gypi_sec2
1292
            'Modules/geolocation/NavigatorGeolocation.h',
1293
            'Modules/geolocation/NavigatorGeolocation.h',
1293
            'Modules/indexeddb/DOMWindowIndexedDatabase.cpp',
1294
            'Modules/indexeddb/DOMWindowIndexedDatabase.cpp',
1294
            'Modules/indexeddb/DOMWindowIndexedDatabase.h',
1295
            'Modules/indexeddb/DOMWindowIndexedDatabase.h',
1296
            'Modules/indexeddb/WorkerContextIndexedDB.cpp',
1297
            'Modules/indexeddb/WorkerContextIndexedDB.h',
1295
            'Modules/intents/Intent.cpp',
1298
            'Modules/intents/Intent.cpp',
1296
            'Modules/intents/Intent.h',
1299
            'Modules/intents/Intent.h',
1297
            'Modules/intents/IntentRequest.cpp',
1300
            'Modules/intents/IntentRequest.cpp',
- Source/WebCore/Modules/indexeddb/WorkerContextIndexedDB.cpp +58 lines
Line 0 Source/WebCore/Modules/indexeddb/WorkerContextIndexedDB.cpp_sec1
1
/*
2
 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3
 * Copyright (C) 2012 Google Inc. All Rights Reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 *
26
 */
27
28
#include "config.h"
29
#include "WorkerContextIndexedDB.h"
30
31
#if ENABLE(WORKERS)
32
33
#if ENABLE(INDEXED_DATABASE)
34
35
#include "IDBFactory.h"
36
#include "WorkerContext.h"
37
38
WorkerContextIndexedDB::WorkerContextIndexedDB()
39
{
40
}
41
42
WorkerContextIndexedDB::~WorkerContextIndexedDB()
43
{
44
}
45
46
IDBFactory* WorkerContextIndexedDB::webkitIndexedDB(WorkerContext* worker)
47
{
48
    if (!worker->securityOrigin()->canAccessDatabase())
49
        return 0;
50
    if (!worker->idbFactoryBackendInterface())
51
        worker->setIDBFactoryBackendInterface(IDBFactoryBackendInterface::create());
52
    if (!worker->idbFactory())
53
        worker->setIDBFactory(IDBFactory::create(worker->idbFactoryBackendInterface()));
54
    return worker->idbFactory();
55
}
56
#endif // INDEXED_DATABASE
57
58
#endif // WORKERS
- Source/WebCore/Modules/indexeddb/WorkerContextIndexedDB.h +53 lines
Line 0 Source/WebCore/Modules/indexeddb/WorkerContextIndexedDB.h_sec1
1
/*
2
 * Copyright (C) 2011, Google Inc. All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions are met:
6
 *
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
14
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
 * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE
17
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
23
 * DAMAGE.
24
 */
25
26
#ifndef WorkerContextIndexedDB_h
27
#define WorkerContextIndexedDB_h
28
29
#if ENABLE(WORKERS)
30
31
#if ENABLE(INDEXED_DATABASE)
32
33
namespace WebCore {
34
35
class IDBFactory;
36
class WorkerContext;
37
38
class WorkerContextIndexedDB {
39
public:
40
    static IDBFactory* webkitIndexedDB(WorkerContext*);
41
42
private:
43
    WorkerContextIndexedDB();
44
    ~WorkerContextIndexedDB();
45
};
46
47
} // namespace WebCore
48
49
#endif // ENABLE(INDEXED_DATABASE)
50
51
#endif // ENABLE(WORKERS)
52
53
#endif // WorkerContextIndexedDB_h
- Source/WebCore/Modules/indexeddb/WorkerContextIndexedDB.idl +47 lines
Line 0 Source/WebCore/Modules/indexeddb/WorkerContextIndexedDB.idl_sec1
1
/*
2
 * Copyright (C) 2008 Apple Inc. All rights reserved.
3
 * Copyright (C) 2012 Google Inc. All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
18
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
26
27
module threads {
28
29
    interface [
30
        Conditional=INDEXED_DATABASE,
31
        Supplemental=WorkerContext
32
    ] WorkerContextIndexedDB {
33
        readonly attribute [V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
34
35
        attribute [V8EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor;
36
        attribute [V8EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase;
37
        attribute [V8EnabledAtRuntime] IDBDatabaseErrorConstructor webkitIDBDatabaseError;
38
        attribute [V8EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
39
        attribute [V8EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory;
40
        attribute [V8EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex;
41
        attribute [V8EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange;
42
        attribute [V8EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore;
43
        attribute [V8EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest;
44
        attribute [V8EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction;
45
    };
46
47
}
- Source/WebCore/page/DOMWindow.h -3 / +3 lines
Lines 21-27 Source/WebCore/page/DOMWindow.h_sec1
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 */
25
 */
26
26
27
#ifndef DOMWindow_h
27
#ifndef DOMWindow_h
Lines 219-225 namespace WebCore { Source/WebCore/page/DOMWindow.h_sec2
219
        double devicePixelRatio() const;
219
        double devicePixelRatio() const;
220
220
221
        PassRefPtr<WebKitPoint> webkitConvertPointFromPageToNode(Node*, const WebKitPoint*) const;
221
        PassRefPtr<WebKitPoint> webkitConvertPointFromPageToNode(Node*, const WebKitPoint*) const;
222
        PassRefPtr<WebKitPoint> webkitConvertPointFromNodeToPage(Node*, const WebKitPoint*) const;        
222
        PassRefPtr<WebKitPoint> webkitConvertPointFromNodeToPage(Node*, const WebKitPoint*) const;
223
223
224
        Console* console() const;
224
        Console* console() const;
225
225
Lines 474-480 namespace WebCore { Source/WebCore/page/DOMWindow.h_sec3
474
    inline String DOMWindow::defaultStatus() const
474
    inline String DOMWindow::defaultStatus() const
475
    {
475
    {
476
        return m_defaultStatus;
476
        return m_defaultStatus;
477
    } 
477
    }
478
478
479
} // namespace WebCore
479
} // namespace WebCore
480
480
- Source/WebCore/workers/WorkerContext.cpp -16 / +1 lines
Lines 21-27 Source/WebCore/workers/WorkerContext.cpp_sec1
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
 *
25
 *
26
 */
26
 */
27
27
Lines 86-93 Source/WebCore/workers/WorkerContext.cpp_sec2
86
#include "ExceptionCode.h"
86
#include "ExceptionCode.h"
87
#endif
87
#endif
88
88
89
#include "IDBFactory.h"
90
91
namespace WebCore {
89
namespace WebCore {
92
90
93
class CloseWorkerContextTask : public ScriptExecutionContext::Task {
91
class CloseWorkerContextTask : public ScriptExecutionContext::Task {
Lines 511-529 void WorkerContext::notifyObserversOfSto Source/WebCore/workers/WorkerContext.cpp_sec3
511
    }
509
    }
512
}
510
}
513
511
514
#if ENABLE(INDEXED_DATABASE)
515
IDBFactory* WorkerContext::webkitIndexedDB() const
516
{
517
    if (!securityOrigin()->canAccessDatabase())
518
        return 0;
519
    if (!m_idbFactoryBackendInterface)
520
        m_idbFactoryBackendInterface = IDBFactoryBackendInterface::create();
521
    if (!m_idbFactory)
522
        m_idbFactory = IDBFactory::create(m_idbFactoryBackendInterface.get());
523
    return m_idbFactory.get();
524
}
525
#endif
526
527
WorkerEventQueue* WorkerContext::eventQueue() const
512
WorkerEventQueue* WorkerContext::eventQueue() const
528
{
513
{
529
    return m_eventQueue.get();
514
    return m_eventQueue.get();
- Source/WebCore/workers/WorkerContext.h -2 / +5 lines
Lines 20-26 Source/WebCore/workers/WorkerContext.h_sec1
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 *
24
 *
25
 */
25
 */
26
26
Lines 170-176 namespace WebCore { Source/WebCore/workers/WorkerContext.h_sec2
170
        void unregisterObserver(Observer*);
170
        void unregisterObserver(Observer*);
171
        void notifyObserversOfStop();
171
        void notifyObserversOfStop();
172
#if ENABLE(INDEXED_DATABASE)
172
#if ENABLE(INDEXED_DATABASE)
173
        IDBFactory* webkitIndexedDB() const;
173
        IDBFactory* idbFactory() { return m_idbFactory.get(); }
174
        void setIDBFactory(PassRefPtr<IDBFactory>);
175
        IDBFactoryBackendInterface* idbFactoryBackendInterface() { return m_idbFactoryBackendInterface.get(); }
176
        void setIDBFactoryBackendInterface(PassRefPtr<IDBFactoryBackendInterface>);
174
#endif
177
#endif
175
178
176
    protected:
179
    protected:
- Source/WebCore/workers/WorkerContext.idl -19 / +5 lines
Lines 20-26 Source/WebCore/workers/WorkerContext.idl_sec1
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
20
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
23
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 *
24
 *
25
 */
25
 */
26
26
Lines 67-77 module threads { Source/WebCore/workers/WorkerContext.idl_sec2
67
67
68
68
69
        // EventTarget interface
69
        // EventTarget interface
70
        void addEventListener(in DOMString type, 
70
        void addEventListener(in DOMString type,
71
                              in EventListener listener, 
71
                              in EventListener listener,
72
                              in [Optional] boolean useCapture);
72
                              in [Optional] boolean useCapture);
73
        void removeEventListener(in DOMString type, 
73
        void removeEventListener(in DOMString type,
74
                                 in EventListener listener, 
74
                                 in EventListener listener,
75
                                 in [Optional] boolean useCapture);
75
                                 in [Optional] boolean useCapture);
76
        boolean dispatchEvent(in Event evt)
76
        boolean dispatchEvent(in Event evt)
77
            raises(EventException);
77
            raises(EventException);
Lines 127-146 module threads { Source/WebCore/workers/WorkerContext.idl_sec3
127
        attribute Float32ArrayConstructor Float32Array; // Usable with new operator
127
        attribute Float32ArrayConstructor Float32Array; // Usable with new operator
128
        attribute Float64ArrayConstructor Float64Array; // Usable with new operator
128
        attribute Float64ArrayConstructor Float64Array; // Usable with new operator
129
        attribute DataViewConstructor DataView; // Usable with new operator
129
        attribute DataViewConstructor DataView; // Usable with new operator
130
#if defined(ENABLE_INDEXED_DATABASE) && ENABLE_INDEXED_DATABASE
131
        readonly attribute [V8EnabledAtRuntime] IDBFactory webkitIndexedDB;
132
133
        attribute [V8EnabledAtRuntime] IDBCursorConstructor webkitIDBCursor;
134
        attribute [V8EnabledAtRuntime] IDBDatabaseConstructor webkitIDBDatabase;
135
        attribute [V8EnabledAtRuntime] IDBDatabaseErrorConstructor webkitIDBDatabaseError;
136
        attribute [V8EnabledAtRuntime] IDBDatabaseExceptionConstructor webkitIDBDatabaseException;
137
        attribute [V8EnabledAtRuntime] IDBFactoryConstructor webkitIDBFactory;
138
        attribute [V8EnabledAtRuntime] IDBIndexConstructor webkitIDBIndex;
139
        attribute [V8EnabledAtRuntime] IDBKeyRangeConstructor webkitIDBKeyRange;
140
        attribute [V8EnabledAtRuntime] IDBObjectStoreConstructor webkitIDBObjectStore;
141
        attribute [V8EnabledAtRuntime] IDBRequestConstructor webkitIDBRequest;
142
        attribute [V8EnabledAtRuntime] IDBTransactionConstructor webkitIDBTransaction;
143
#endif
144
    };
130
    };
145
131
146
}
132
}

Return to Bug 79508