| Differences between
and this patch
- a/Source/WebCore/ChangeLog +38 lines
Lines 1-5 a/Source/WebCore/ChangeLog_sec1
1
2012-01-10  Kentaro Hara  <haraken@chromium.org>
1
2012-01-10  Kentaro Hara  <haraken@chromium.org>
2
2
3
        Use the [Supplemental] IDL in SQLDatabase
4
        https://bugs.webkit.org/show_bug.cgi?id=76004
5
6
        Reviewed by Adam Barth.
7
8
        We've been working on WebKit modularization. By using the [Supplemental] IDL,
9
        we can move SQLDatabase related code from WebCore/page/DOMWindow.{h,cpp,idl}
10
        to WebCore/storage/DOMWindowSQLDatabase.{h,cpp,idl}.
11
12
        Tests: storage/open-database-creation-callback-isolated-world.html
13
               storage/open-database-creation-callback.html
14
               storage/open-database-empty-version.html
15
               storage/open-database-over-quota.html
16
               storage/open-database-set-empty-version.html
17
               storage/open-database-while-transaction-in-progress.html
18
19
        * CMakeLists.txt: Added DOMWindowSQLDatabase.{idl,h,cpp} to the build script.
20
        * DerivedSources.make: Ditto.
21
        * DerivedSources.pri: Ditto.
22
        * GNUmakefile.list.am: Ditto.
23
        * Target.pri: Ditto.
24
        * WebCore.gypi: Ditto.
25
        * WebCore.vcproj/WebCore.vcproj: Ditto.
26
        * WebCore.xcodeproj/project.pbxproj: Ditto.
27
28
        * page/DOMWindow.cpp: Removed SQLDatabase related code.
29
        * page/DOMWindow.idl: Ditto.
30
        * page/DOMWindow.h: Ditto. Moved isCurrentlyDisplayedInFrame() from private: to public:
31
        so that DOMWindowSQLDatabase::openDatabase() can access it.
32
33
        * storage/DOMWindowSQLDatabase.cpp: Added. Moved openDatabase() from DOMWindow.cpp to here.
34
        (WebCore::DOMWindowSQLDatabase::openDatabase):
35
        * storage/DOMWindowSQLDatabase.h: Added. Moved openDatabase() from DOMWindow.h to here.
36
        * storage/DOMWindowSQLDatabase.idl: Added. Using the [Supplemental] IDL, moved openDatabase()
37
        and SQLException from DOMWindow.idl to here.
38
39
2012-01-10  Kentaro Hara  <haraken@chromium.org>
40
3
        Support the [Supplemental] IDL on methods
41
        Support the [Supplemental] IDL on methods
4
        https://bugs.webkit.org/show_bug.cgi?id=75944
42
        https://bugs.webkit.org/show_bug.cgi?id=75944
5
43
- a/Source/WebCore/CMakeLists.txt +2 lines
Lines 1349-1354 SET(WebCore_SOURCES a/Source/WebCore/CMakeLists.txt_sec1
1349
1349
1350
    storage/AbstractDatabase.cpp
1350
    storage/AbstractDatabase.cpp
1351
    storage/ChangeVersionWrapper.cpp
1351
    storage/ChangeVersionWrapper.cpp
1352
    storage/DOMWindowSQLDatabase.cpp
1352
    storage/Database.cpp
1353
    storage/Database.cpp
1353
    storage/DatabaseAuthorizer.cpp
1354
    storage/DatabaseAuthorizer.cpp
1354
    storage/DatabaseSync.cpp
1355
    storage/DatabaseSync.cpp
Lines 1468-1473 ENDIF () a/Source/WebCore/CMakeLists.txt_sec2
1468
1469
1469
IF (ENABLE_SQL_DATABASE)
1470
IF (ENABLE_SQL_DATABASE)
1470
    LIST(APPEND WebCore_IDL_FILES
1471
    LIST(APPEND WebCore_IDL_FILES
1472
        storage/DOMWindowSQLDatabase.idl
1471
        storage/Database.idl
1473
        storage/Database.idl
1472
        storage/DatabaseCallback.idl
1474
        storage/DatabaseCallback.idl
1473
        storage/DatabaseSync.idl
1475
        storage/DatabaseSync.idl
- a/Source/WebCore/DerivedSources.make +1 lines
Lines 336-341 BINDING_IDLS = \ a/Source/WebCore/DerivedSources.make_sec1
336
    $(WebCore)/plugins/DOMMimeTypeArray.idl \
336
    $(WebCore)/plugins/DOMMimeTypeArray.idl \
337
    $(WebCore)/plugins/DOMPlugin.idl \
337
    $(WebCore)/plugins/DOMPlugin.idl \
338
    $(WebCore)/plugins/DOMPluginArray.idl \
338
    $(WebCore)/plugins/DOMPluginArray.idl \
339
    $(WebCore)/storage/DOMWindowSQLDatabase.idl \
339
    $(WebCore)/storage/Database.idl \
340
    $(WebCore)/storage/Database.idl \
340
    $(WebCore)/storage/DatabaseCallback.idl \
341
    $(WebCore)/storage/DatabaseCallback.idl \
341
    $(WebCore)/storage/DatabaseSync.idl \
342
    $(WebCore)/storage/DatabaseSync.idl \
- a/Source/WebCore/DerivedSources.pri +1 lines
Lines 365-370 IDL_BINDINGS += \ a/Source/WebCore/DerivedSources.pri_sec1
365
    plugins/DOMMimeType.idl \
365
    plugins/DOMMimeType.idl \
366
    plugins/DOMPluginArray.idl \
366
    plugins/DOMPluginArray.idl \
367
    plugins/DOMMimeTypeArray.idl \
367
    plugins/DOMMimeTypeArray.idl \
368
    storage/DOMWindowSQLDatabase.idl \
368
    storage/Database.idl \
369
    storage/Database.idl \
369
    storage/DatabaseCallback.idl \
370
    storage/DatabaseCallback.idl \
370
    storage/DatabaseSync.idl \
371
    storage/DatabaseSync.idl \
- a/Source/WebCore/GNUmakefile.list.am +3 lines
Lines 3754-3759 webcore_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec1
3754
	Source/WebCore/storage/AbstractDatabase.h \
3754
	Source/WebCore/storage/AbstractDatabase.h \
3755
	Source/WebCore/storage/ChangeVersionWrapper.cpp \
3755
	Source/WebCore/storage/ChangeVersionWrapper.cpp \
3756
	Source/WebCore/storage/ChangeVersionWrapper.h \
3756
	Source/WebCore/storage/ChangeVersionWrapper.h \
3757
	Source/WebCore/storage/DOMWindowSQLDatabase.cpp \
3758
	Source/WebCore/storage/DOMWindowSQLDatabase.h \
3757
	Source/WebCore/storage/DatabaseAuthorizer.cpp \
3759
	Source/WebCore/storage/DatabaseAuthorizer.cpp \
3758
	Source/WebCore/storage/DatabaseAuthorizer.h \
3760
	Source/WebCore/storage/DatabaseAuthorizer.h \
3759
	Source/WebCore/storage/DatabaseCallback.h \
3761
	Source/WebCore/storage/DatabaseCallback.h \
Lines 4600-4605 webcore_built_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec2
4600
	DerivedSources/WebCore/JSSQLTransactionSyncCallback.h
4602
	DerivedSources/WebCore/JSSQLTransactionSyncCallback.h
4601
4603
4602
dom_binding_idls += \
4604
dom_binding_idls += \
4605
	$(WebCore)/storage/DOMWindowSQLDatabase.idl \
4603
	$(WebCore)/storage/Database.idl \
4606
	$(WebCore)/storage/Database.idl \
4604
	$(WebCore)/storage/DatabaseCallback.idl \
4607
	$(WebCore)/storage/DatabaseCallback.idl \
4605
	$(WebCore)/storage/DatabaseSync.idl \
4608
	$(WebCore)/storage/DatabaseSync.idl \
- a/Source/WebCore/Target.pri +2 lines
Lines 1279-1284 SOURCES += \ a/Source/WebCore/Target.pri_sec1
1279
    rendering/style/StyleTransformData.cpp \
1279
    rendering/style/StyleTransformData.cpp \
1280
    rendering/style/StyleVisualData.cpp \
1280
    rendering/style/StyleVisualData.cpp \
1281
    storage/AbstractDatabase.cpp \
1281
    storage/AbstractDatabase.cpp \
1282
    storage/DOMWindowSQLDatabase.cpp \
1282
    storage/Database.cpp \
1283
    storage/Database.cpp \
1283
    storage/DatabaseAuthorizer.cpp \
1284
    storage/DatabaseAuthorizer.cpp \
1284
    storage/DatabaseSync.cpp \
1285
    storage/DatabaseSync.cpp \
Lines 2473-2478 HEADERS += \ a/Source/WebCore/Target.pri_sec2
2473
    rendering/svg/SVGTextRunRenderingContext.h \
2474
    rendering/svg/SVGTextRunRenderingContext.h \
2474
    storage/AbstractDatabase.h \
2475
    storage/AbstractDatabase.h \
2475
    storage/ChangeVersionWrapper.h \
2476
    storage/ChangeVersionWrapper.h \
2477
    storage/DOMWindowSQLDatabase.h \
2476
    storage/DatabaseAuthorizer.h \
2478
    storage/DatabaseAuthorizer.h \
2477
    storage/Database.h \
2479
    storage/Database.h \
2478
    storage/DatabaseCallback.h \
2480
    storage/DatabaseCallback.h \
- a/Source/WebCore/WebCore.gypi +3 lines
Lines 1452-1457 a/Source/WebCore/WebCore.gypi_sec1
1452
            'plugins/DOMMimeTypeArray.idl',
1452
            'plugins/DOMMimeTypeArray.idl',
1453
            'plugins/DOMPlugin.idl',
1453
            'plugins/DOMPlugin.idl',
1454
            'plugins/DOMPluginArray.idl',
1454
            'plugins/DOMPluginArray.idl',
1455
            'storage/DOMWindowSQLDatabase.idl',
1455
            'storage/Database.idl',
1456
            'storage/Database.idl',
1456
            'storage/DatabaseCallback.idl',
1457
            'storage/DatabaseCallback.idl',
1457
            'storage/DatabaseSync.idl',
1458
            'storage/DatabaseSync.idl',
Lines 4917-4922 a/Source/WebCore/WebCore.gypi_sec2
4917
            'storage/AbstractDatabase.cpp',
4918
            'storage/AbstractDatabase.cpp',
4918
            'storage/ChangeVersionWrapper.cpp',
4919
            'storage/ChangeVersionWrapper.cpp',
4919
            'storage/ChangeVersionWrapper.h',
4920
            'storage/ChangeVersionWrapper.h',
4921
            'storage/DOMWindowSQLDatabase.cpp',
4922
            'storage/DOMWindowSQLDatabase.h',
4920
            'storage/Database.cpp',
4923
            'storage/Database.cpp',
4921
            'storage/DatabaseAuthorizer.cpp',
4924
            'storage/DatabaseAuthorizer.cpp',
4922
            'storage/DatabaseAuthorizer.h',
4925
            'storage/DatabaseAuthorizer.h',
- a/Source/WebCore/WebCore.vcproj/WebCore.vcproj +8 lines
Lines 70526-70531 a/Source/WebCore/WebCore.vcproj/WebCore.vcproj_sec1
70526
				>
70526
				>
70527
			</File>
70527
			</File>
70528
			<File
70528
			<File
70529
				RelativePath="..\storage\DOMWindowSQLDatabase.cpp"
70530
				>
70531
			</File>
70532
			<File
70533
				RelativePath="..\storage\DOMWindowSQLDatabase.h"
70534
				>
70535
			</File>
70536
			<File
70529
				RelativePath="..\storage\Database.cpp"
70537
				RelativePath="..\storage\Database.cpp"
70530
				>
70538
				>
70531
			</File>
70539
			</File>
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj +10 lines
Lines 4048-4053 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
4048
		A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80040A19516E00A8EF5F /* StyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
4048
		A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80040A19516E00A8EF5F /* StyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; };
4049
		A8EA800D0A19516E00A8EF5F /* StyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */; };
4049
		A8EA800D0A19516E00A8EF5F /* StyleSheet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */; };
4050
		A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80060A19516E00A8EF5F /* MediaList.h */; settings = {ATTRIBUTES = (Private, ); }; };
4050
		A8EA800E0A19516E00A8EF5F /* MediaList.h in Headers */ = {isa = PBXBuildFile; fileRef = A8EA80060A19516E00A8EF5F /* MediaList.h */; settings = {ATTRIBUTES = (Private, ); }; };
4051
		A8F457A014BC1A88000CEA59 /* DOMWindowSQLDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A8F4579D14BC13EC000CEA59 /* DOMWindowSQLDatabase.cpp */; };
4052
		A8F457A114BC1A94000CEA59 /* DOMWindowSQLDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = A8F4579E14BC13EC000CEA59 /* DOMWindowSQLDatabase.h */; };
4051
		A8F46A840CB20A9D003A9670 /* DOMSVGClipPathElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8503612C0ACE007B001F3D9E /* DOMSVGClipPathElement.h */; };
4053
		A8F46A840CB20A9D003A9670 /* DOMSVGClipPathElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 8503612C0ACE007B001F3D9E /* DOMSVGClipPathElement.h */; };
4052
		A8F46A880CB20A9D003A9670 /* DOMSVGGradientElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85C9A2EC0AD7E90300FBFF1E /* DOMSVGGradientElement.h */; };
4054
		A8F46A880CB20A9D003A9670 /* DOMSVGGradientElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 85C9A2EC0AD7E90300FBFF1E /* DOMSVGGradientElement.h */; };
4053
		A8F46A890CB20A9D003A9670 /* DOMSVGAnimateColorElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 850361280ACE007B001F3D9E /* DOMSVGAnimateColorElement.h */; };
4055
		A8F46A890CB20A9D003A9670 /* DOMSVGAnimateColorElement.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 850361280ACE007B001F3D9E /* DOMSVGAnimateColorElement.h */; };
Lines 11321-11326 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
11321
		A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheet.cpp; sourceTree = "<group>"; };
11323
		A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = StyleSheet.cpp; sourceTree = "<group>"; };
11322
		A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = "<group>"; };
11324
		A8EA80060A19516E00A8EF5F /* MediaList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaList.h; sourceTree = "<group>"; };
11323
		A8F4578F14B2B004000CEA59 /* resolve-supplemental.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = "resolve-supplemental.pl"; path = "scripts/resolve-supplemental.pl"; sourceTree = "<group>"; };
11325
		A8F4578F14B2B004000CEA59 /* resolve-supplemental.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = "resolve-supplemental.pl"; path = "scripts/resolve-supplemental.pl"; sourceTree = "<group>"; };
11326
		A8F4579D14BC13EC000CEA59 /* DOMWindowSQLDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMWindowSQLDatabase.cpp; sourceTree = "<group>"; };
11327
		A8F4579E14BC13EC000CEA59 /* DOMWindowSQLDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMWindowSQLDatabase.h; sourceTree = "<group>"; };
11328
		A8F4579F14BC13EC000CEA59 /* DOMWindowSQLDatabase.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMWindowSQLDatabase.idl; sourceTree = "<group>"; };
11324
		A8FA6E5B0E4CFDED00D5CF49 /* Pattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pattern.h; sourceTree = "<group>"; };
11329
		A8FA6E5B0E4CFDED00D5CF49 /* Pattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Pattern.h; sourceTree = "<group>"; };
11325
		A8FA6E5C0E4CFDED00D5CF49 /* Pattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Pattern.cpp; sourceTree = "<group>"; };
11330
		A8FA6E5C0E4CFDED00D5CF49 /* Pattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Pattern.cpp; sourceTree = "<group>"; };
11326
		A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMMimeType.cpp; sourceTree = "<group>"; };
11331
		A9C6E4E10D745E05006442E9 /* DOMMimeType.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DOMMimeType.cpp; sourceTree = "<group>"; };
Lines 14392-14397 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
14392
		1AE82EC90CAAE177002237AE /* storage */ = {
14397
		1AE82EC90CAAE177002237AE /* storage */ = {
14393
			isa = PBXGroup;
14398
			isa = PBXGroup;
14394
			children = (
14399
			children = (
14400
				A8F4579D14BC13EC000CEA59 /* DOMWindowSQLDatabase.cpp */,
14401
				A8F4579E14BC13EC000CEA59 /* DOMWindowSQLDatabase.h */,
14402
				A8F4579F14BC13EC000CEA59 /* DOMWindowSQLDatabase.idl */,
14395
				B5B5DC67119BB3D5002A8790 /* AbstractDatabase.cpp */,
14403
				B5B5DC67119BB3D5002A8790 /* AbstractDatabase.cpp */,
14396
				B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */,
14404
				B5B5DC68119BB3D5002A8790 /* AbstractDatabase.h */,
14397
				514185ED0CD65F0400763C99 /* ChangeVersionWrapper.cpp */,
14405
				514185ED0CD65F0400763C99 /* ChangeVersionWrapper.cpp */,
Lines 24904-24909 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
24904
				974A862314B7ADBB003FDC76 /* FrameDestructionObserver.h in Headers */,
24912
				974A862314B7ADBB003FDC76 /* FrameDestructionObserver.h in Headers */,
24905
				97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
24913
				97D2AD0414B823A60093DF32 /* DOMWindowProperty.h in Headers */,
24906
				7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */,
24914
				7AABA25A14BC613300AA9A11 /* DOMEditor.h in Headers */,
24915
				A8F457A114BC1A94000CEA59 /* DOMWindowSQLDatabase.h in Headers */,
24907
			);
24916
			);
24908
			runOnlyForDeploymentPostprocessing = 0;
24917
			runOnlyForDeploymentPostprocessing = 0;
24909
		};
24918
		};
Lines 27811-27816 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
27811
				974A862214B7ADBB003FDC76 /* FrameDestructionObserver.cpp in Sources */,
27820
				974A862214B7ADBB003FDC76 /* FrameDestructionObserver.cpp in Sources */,
27812
				97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */,
27821
				97D2AD0314B823A60093DF32 /* DOMWindowProperty.cpp in Sources */,
27813
				7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */,
27822
				7AABA25914BC613300AA9A11 /* DOMEditor.cpp in Sources */,
27823
				A8F457A014BC1A88000CEA59 /* DOMWindowSQLDatabase.cpp in Sources */,
27814
			);
27824
			);
27815
			runOnlyForDeploymentPostprocessing = 0;
27825
			runOnlyForDeploymentPostprocessing = 0;
27816
		};
27826
		};
- a/Source/WebCore/page/DOMWindow.cpp -17 lines
Lines 1381-1403 double DOMWindow::devicePixelRatio() const a/Source/WebCore/page/DOMWindow.cpp_sec1
1381
    return page->deviceScaleFactor();
1381
    return page->deviceScaleFactor();
1382
}
1382
}
1383
1383
1384
#if ENABLE(SQL_DATABASE)
1385
PassRefPtr<Database> DOMWindow::openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
1386
{
1387
    if (!isCurrentlyDisplayedInFrame())
1388
        return 0;
1389
1390
    RefPtr<Database> database = 0;
1391
    if (m_frame && AbstractDatabase::isAvailable() && m_frame->document()->securityOrigin()->canAccessDatabase())
1392
        database = Database::openDatabase(m_frame->document(), name, version, displayName, estimatedSize, creationCallback, ec);
1393
1394
    if (!database && !ec)
1395
        ec = SECURITY_ERR;
1396
1397
    return database;
1398
}
1399
#endif
1400
1401
void DOMWindow::scrollBy(int x, int y) const
1384
void DOMWindow::scrollBy(int x, int y) const
1402
{
1385
{
1403
    if (!isCurrentlyDisplayedInFrame())
1386
    if (!isCurrentlyDisplayedInFrame())
- a/Source/WebCore/page/DOMWindow.h -7 / +3 lines
Lines 355-364 namespace WebCore { a/Source/WebCore/page/DOMWindow.h_sec1
355
        DOMURL* webkitURL() const;
355
        DOMURL* webkitURL() const;
356
#endif
356
#endif
357
357
358
#if ENABLE(SQL_DATABASE)
359
        PassRefPtr<Database> openDatabase(const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
360
#endif
361
362
#if ENABLE(DEVICE_ORIENTATION)
358
#if ENABLE(DEVICE_ORIENTATION)
363
        DEFINE_ATTRIBUTE_EVENT_LISTENER(devicemotion);
359
        DEFINE_ATTRIBUTE_EVENT_LISTENER(devicemotion);
364
        DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
360
        DEFINE_ATTRIBUTE_EVENT_LISTENER(deviceorientation);
Lines 418-432 namespace WebCore { a/Source/WebCore/page/DOMWindow.h_sec2
418
        Performance* performance() const;
414
        Performance* performance() const;
419
#endif
415
#endif
420
416
421
    private:
422
        explicit DOMWindow(Frame*);
423
424
        // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e.,
417
        // FIXME: When this DOMWindow is no longer the active DOMWindow (i.e.,
425
        // when its document is no longer the document that is displayed in its
418
        // when its document is no longer the document that is displayed in its
426
        // frame), we would like to zero out m_frame to avoid being confused
419
        // frame), we would like to zero out m_frame to avoid being confused
427
        // by the document that is currently active in m_frame.
420
        // by the document that is currently active in m_frame.
428
        bool isCurrentlyDisplayedInFrame() const;
421
        bool isCurrentlyDisplayedInFrame() const;
429
422
423
    private:
424
        explicit DOMWindow(Frame*);
425
430
        virtual void refEventTarget() { ref(); }
426
        virtual void refEventTarget() { ref(); }
431
        virtual void derefEventTarget() { deref(); }
427
        virtual void derefEventTarget() { deref(); }
432
        virtual EventTargetData* eventTargetData();
428
        virtual EventTargetData* eventTargetData();
- a/Source/WebCore/page/DOMWindow.idl -7 lines
Lines 163-172 module window { a/Source/WebCore/page/DOMWindow.idl_sec1
163
                                                     in [Optional=CallWithDefaultValue] WebKitPoint p);
163
                                                     in [Optional=CallWithDefaultValue] WebKitPoint p);
164
164
165
        readonly attribute [EnabledAtRuntime] DOMApplicationCache applicationCache;
165
        readonly attribute [EnabledAtRuntime] DOMApplicationCache applicationCache;
166
#if defined(ENABLE_SQL_DATABASE) && ENABLE_SQL_DATABASE
167
        [EnabledAtRuntime] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
168
            raises(DOMException);
169
#endif
170
166
171
        readonly attribute [EnabledAtRuntime] Storage sessionStorage
167
        readonly attribute [EnabledAtRuntime] Storage sessionStorage
172
            getter raises(DOMException);
168
            getter raises(DOMException);
Lines 794-802 module window { a/Source/WebCore/page/DOMWindow.idl_sec2
794
#endif
790
#endif
795
#endif
791
#endif
796
792
797
        attribute [Conditional=SQL_DATABASE] SQLExceptionConstructor SQLException;
798
799
800
        attribute DOMFormDataConstructor FormData;
793
        attribute DOMFormDataConstructor FormData;
801
794
802
        attribute [Conditional=BLOB|FILE_SYSTEM] FileErrorConstructor FileError;
795
        attribute [Conditional=BLOB|FILE_SYSTEM] FileErrorConstructor FileError;
- a/Source/WebCore/storage/DOMWindowSQLDatabase.cpp +63 lines
Line 0 a/Source/WebCore/storage/DOMWindowSQLDatabase.cpp_sec1
1
/*
2
 * Copyright (C) 2012 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
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#include "config.h"
32
#include "DOMWindowSQLDatabase.h"
33
34
#include "AbstractDatabase.h"
35
#include "DOMWindow.h"
36
#include "Database.h"
37
#include "DatabaseCallback.h"
38
#include "Document.h"
39
#include "Frame.h"
40
#include "SecurityOrigin.h"
41
42
#if ENABLE(SQL_DATABASE)
43
44
namespace WebCore {
45
46
PassRefPtr<Database> DOMWindowSQLDatabase::openDatabase(DOMWindow* window, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode& ec)
47
{
48
    if (!window->isCurrentlyDisplayedInFrame())
49
        return 0;
50
51
    RefPtr<Database> database = 0;
52
    if (window->frame() && AbstractDatabase::isAvailable() && window->frame()->document()->securityOrigin()->canAccessDatabase())
53
        database = Database::openDatabase(window->frame()->document(), name, version, displayName, estimatedSize, creationCallback, ec);
54
55
    if (!database && !ec)
56
        ec = SECURITY_ERR;
57
58
    return database;
59
}
60
61
} // namespace WebCore
62
63
#endif // ENABLE(SQL_DATABASE)
- a/Source/WebCore/storage/DOMWindowSQLDatabase.h +61 lines
Line 0 a/Source/WebCore/storage/DOMWindowSQLDatabase.h_sec1
1
/*
2
 * Copyright (C) 2012 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
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
#ifndef DOMWindowSQLDatabase_h
32
#define DOMWindowSQLDatabase_h
33
34
#if ENABLE(SQL_DATABASE)
35
#include "ExceptionCode.h"
36
#include "PlatformString.h"
37
#include <wtf/PassRefPtr.h>
38
#include <wtf/RefCounted.h>
39
#include <wtf/RefPtr.h>
40
41
namespace WebCore {
42
43
class DOMWindow;
44
class Database;
45
class DatabaseCallback;
46
class Frame;
47
48
class DOMWindowSQLDatabase {
49
public:
50
    static PassRefPtr<Database> openDatabase(DOMWindow*, const String& name, const String& version, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback, ExceptionCode&);
51
52
private:
53
    DOMWindowSQLDatabase() { };
54
    ~DOMWindowSQLDatabase() { };
55
};
56
57
} // namespace WebCore
58
59
#endif // ENABLE(SQL_DATABASE)
60
61
#endif // DOMWindowSQLDatabase_h
- a/Source/WebCore/storage/DOMWindowSQLDatabase.idl +42 lines
Line 0 a/Source/WebCore/storage/DOMWindowSQLDatabase.idl_sec1
1
/*
2
 * Copyright (C) 2012 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
6
 * met:
7
 *
8
 *     * Redistributions of source code must retain the above copyright
9
 * notice, this list of conditions and the following disclaimer.
10
 *     * Redistributions in binary form must reproduce the above
11
 * copyright notice, this list of conditions and the following disclaimer
12
 * in the documentation and/or other materials provided with the
13
 * distribution.
14
 *     * Neither the name of Google Inc. nor the names of its
15
 * contributors may be used to endorse or promote products derived from
16
 * this software without specific prior written permission.
17
 *
18
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
 */
30
31
module window {
32
33
    interface [
34
        Conditional=SQL_DATABASE,
35
        Supplemental=DOMWindow
36
    ] DOMWindowSQLDatabase {
37
        [EnabledAtRuntime] Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize, in [Callback, Optional] DatabaseCallback creationCallback)
38
            raises(DOMException);
39
        attribute SQLExceptionConstructor SQLException;
40
    };
41
42
}

Return to Bug 76004