WebCore:
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2008 03:36:14 +0000 (03:36 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Jan 2008 03:36:14 +0000 (03:36 +0000)
        Reviewed by Sam.

        - remove SecurityOriginData and fold its functionality into SecurityOrigin

        * GNUmakefile.am:
        * WebCore.base.exp:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::postMessage):
        * dom/Document.cpp:
        (WebCore::Document::domain):
        * page/Chrome.cpp:
        (WebCore::Chrome::requestQuotaIncreaseForNewDatabase):
        (WebCore::Chrome::requestQuotaIncreaseForDatabaseOperation):
        * page/Chrome.h:
        * page/ChromeClient.h:
        * platform/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::copy):
        (WebCore::SecurityOrigin::createFromIdentifier):
        (WebCore::SecurityOrigin::stringIdentifier):
        * platform/SecurityOrigin.h:
        (WebCore::SecurityOrigin::host):
        (WebCore::SecurityOrigin::protocol):
        (WebCore::SecurityOrigin::port):
        (WebCore::SecurityOrigin::equal):
        * platform/SecurityOriginData.cpp: Removed.
        * platform/SecurityOriginData.h: Removed.
        * storage/Database.cpp:
        (WebCore::Database::openDatabase):
        (WebCore::Database::Database):
        (WebCore::Database::securityOriginCopy):
        * storage/Database.h:
        * storage/DatabaseTracker.cpp:
        (WebCore::SecurityOriginHash::hash):
        (WebCore::SecurityOriginHash::equal):
        (WebCore::SecurityOriginTraits::deletedValue):
        (WebCore::SecurityOriginTraits::emptyValue):
        (WebCore::DatabaseTracker::canEstablishDatabase):
        (WebCore::DatabaseTracker::hasEntryForOrigin):
        (WebCore::DatabaseTracker::hasEntryForDatabase):
        (WebCore::DatabaseTracker::establishEntryForOrigin):
        (WebCore::DatabaseTracker::fullPathForDatabase):
        (WebCore::DatabaseTracker::populateOrigins):
        (WebCore::DatabaseTracker::origins):
        (WebCore::DatabaseTracker::databaseNamesForOrigin):
        (WebCore::DatabaseTracker::detailsForNameAndOrigin):
        (WebCore::DatabaseTracker::setDatabaseDetails):
        (WebCore::DatabaseTracker::usageForDatabase):
        (WebCore::DatabaseTracker::usageForOrigin):
        (WebCore::DatabaseTracker::quotaForOrigin):
        (WebCore::DatabaseTracker::setQuota):
        (WebCore::DatabaseTracker::addDatabase):
        (WebCore::DatabaseTracker::deleteAllDatabases):
        (WebCore::DatabaseTracker::deleteDatabasesWithOrigin):
        (WebCore::DatabaseTracker::deleteDatabase):
        (WebCore::DatabaseTracker::deleteDatabaseFile):
        (WebCore::notificationQueue):
        (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
        (WebCore::DatabaseTracker::notifyDatabasesChanged):
        * storage/DatabaseTracker.h:
        * storage/DatabaseTrackerClient.h:
        * storage/SQLTransaction.cpp:
        (WebCore::SQLTransaction::openTransactionAndPreflight):
        (WebCore::SQLTransaction::runStatements):
        (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
        (WebCore::SQLTransaction::postflightAndCommit):
        (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
        * svg/graphics/SVGImageEmptyClients.h:
        (WebCore::SVGEmptyChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebCore::SVGEmptyChromeClient::requestQuotaIncreaseForDatabaseOperation):

WebKit/gtk:

        Reviewed by Sam.

        - remove SecurityOriginData and fold its functionality into SecurityOrigin

        * WebCoreSupport/ChromeClientGtk.cpp:
        (WebKit::ChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebKit::ChromeClient::requestQuotaIncreaseForDatabaseOperation):
        * WebCoreSupport/ChromeClientGtk.h:

WebKit/mac:

        Reviewed by Sam.

        - remove SecurityOriginData and fold its functionality into SecurityOrigin

        * Storage/WebDatabaseManager.mm:
        (-[WebDatabaseManager origins]):
        (-[WebDatabaseManager databasesWithOrigin:]):
        (-[WebDatabaseManager detailsForDatabase:withOrigin:]):
        (-[WebDatabaseManager deleteDatabasesWithOrigin:]):
        (-[WebDatabaseManager deleteDatabase:withOrigin:]):
        * Storage/WebDatabaseTrackerClient.h:
        * Storage/WebDatabaseTrackerClient.mm:
        (WebDatabaseTrackerClient::dispatchDidModifyOrigin):
        (WebDatabaseTrackerClient::dispatchDidModifyDatabase):
        * Storage/WebSecurityOrigin.mm:
        (-[WebSecurityOrigin initWithProtocol:domain:port:]):
        (-[WebSecurityOrigin protocol]):
        (-[WebSecurityOrigin domain]):
        (-[WebSecurityOrigin port]):
        (-[WebSecurityOrigin usage]):
        (-[WebSecurityOrigin quota]):
        (-[WebSecurityOrigin setQuota:]):
        (-[WebSecurityOrigin isEqual:]):
        (-[WebSecurityOrigin dealloc]):
        (-[WebSecurityOrigin finalize]):
        (-[WebSecurityOrigin _initWithWebCoreSecurityOrigin:]):
        (-[WebSecurityOrigin _core]):
        * Storage/WebSecurityOriginInternal.h:
        * WebCoreSupport/WebChromeClient.h:
        * WebCoreSupport/WebChromeClient.mm:
        (WebChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebChromeClient::requestQuotaIncreaseForDatabaseOperation):

WebKit/qt:

        Reviewed by Sam.

        - remove SecurityOriginData and fold its functionality into SecurityOrigin

        * WebCoreSupport/ChromeClientQt.cpp:
        (WebCore::ChromeClientQt::requestQuotaIncreaseForNewDatabase):
        (WebCore::ChromeClientQt::requestQuotaIncreaseForDatabaseOperation):
        * WebCoreSupport/ChromeClientQt.h:

WebKit/win:

        Reviewed by Sam.

        - remove SecurityOriginData and fold its functionality into SecurityOrigin

        * WebChromeClient.cpp:
        (WebChromeClient::requestQuotaIncreaseForNewDatabase):
        (WebChromeClient::requestQuotaIncreaseForDatabaseOperation):
        * WebChromeClient.h:
        * WebDatabaseManager.cpp:
        (WebDatabaseManager::origins):
        (WebDatabaseManager::databasesWithOrigin):
        (WebDatabaseManager::detailsForDatabaseWithOrigin):
        (WebDatabaseManager::deleteDatabasesWithOrigin):
        (WebDatabaseManager::deleteDatabaseWithOrigin):
        (WebDatabaseManager::dispatchDidModifyOrigin):
        (WebDatabaseManager::dispatchDidModifyDatabase):
        * WebDatabaseManager.h:
        * WebSecurityOrigin.cpp:
        (WebSecurityOrigin::createInstance):
        (WebSecurityOrigin::WebSecurityOrigin):
        (WebSecurityOrigin::protocol):
        (WebSecurityOrigin::domain):
        (WebSecurityOrigin::port):
        (WebSecurityOrigin::usage):
        (WebSecurityOrigin::quota):
        (WebSecurityOrigin::setQuota):
        * WebSecurityOrigin.h:

WebKit/wx:

        Reviewed by Sam.

        - remove SecurityOriginData and fold its functionality into SecurityOrigin

        * WebKitSupport/ChromeClientWx.cpp:
        (WebCore::ChromeClientWx::requestQuotaIncreaseForNewDatabase):
        (WebCore::ChromeClientWx::requestQuotaIncreaseForDatabaseOperation):
        * WebKitSupport/ChromeClientWx.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

47 files changed:
WebCore/ChangeLog
WebCore/GNUmakefile.am
WebCore/WebCore.base.exp
WebCore/WebCore.pro
WebCore/WebCore.vcproj/WebCore.vcproj
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/WebCoreSources.bkl
WebCore/bindings/js/JSDOMWindowCustom.cpp
WebCore/dom/Document.cpp
WebCore/page/Chrome.cpp
WebCore/page/Chrome.h
WebCore/page/ChromeClient.h
WebCore/platform/SecurityOrigin.cpp
WebCore/platform/SecurityOrigin.h
WebCore/platform/SecurityOriginData.cpp [deleted file]
WebCore/platform/SecurityOriginData.h [deleted file]
WebCore/storage/Database.cpp
WebCore/storage/Database.h
WebCore/storage/DatabaseTracker.cpp
WebCore/storage/DatabaseTracker.h
WebCore/storage/DatabaseTrackerClient.h
WebCore/storage/SQLTransaction.cpp
WebCore/svg/graphics/SVGImageEmptyClients.h
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
WebKit/mac/ChangeLog
WebKit/mac/Storage/WebDatabaseManager.mm
WebKit/mac/Storage/WebDatabaseTrackerClient.h
WebKit/mac/Storage/WebDatabaseTrackerClient.mm
WebKit/mac/Storage/WebSecurityOrigin.mm
WebKit/mac/Storage/WebSecurityOriginInternal.h
WebKit/mac/WebCoreSupport/WebChromeClient.h
WebKit/mac/WebCoreSupport/WebChromeClient.mm
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
WebKit/qt/WebCoreSupport/ChromeClientQt.h
WebKit/win/ChangeLog
WebKit/win/WebChromeClient.cpp
WebKit/win/WebChromeClient.h
WebKit/win/WebDatabaseManager.cpp
WebKit/win/WebDatabaseManager.h
WebKit/win/WebSecurityOrigin.cpp
WebKit/win/WebSecurityOrigin.h
WebKit/wx/ChangeLog
WebKit/wx/WebKitSupport/ChromeClientWx.cpp
WebKit/wx/WebKitSupport/ChromeClientWx.h

index bebb9e757fa58e8d58bb5d48986ef0b780f3ce22..089845090bd3e3749f356a136ddd2f51e41dee26 100644 (file)
@@ -1,3 +1,79 @@
+2008-01-10  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Sam.
+
+        - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+        * GNUmakefile.am:
+        * WebCore.base.exp:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * WebCoreSources.bkl:
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::JSDOMWindow::postMessage):
+        * dom/Document.cpp:
+        (WebCore::Document::domain):
+        * page/Chrome.cpp:
+        (WebCore::Chrome::requestQuotaIncreaseForNewDatabase):
+        (WebCore::Chrome::requestQuotaIncreaseForDatabaseOperation):
+        * page/Chrome.h:
+        * page/ChromeClient.h:
+        * platform/SecurityOrigin.cpp:
+        (WebCore::SecurityOrigin::copy):
+        (WebCore::SecurityOrigin::createFromIdentifier):
+        (WebCore::SecurityOrigin::stringIdentifier):
+        * platform/SecurityOrigin.h:
+        (WebCore::SecurityOrigin::host):
+        (WebCore::SecurityOrigin::protocol):
+        (WebCore::SecurityOrigin::port):
+        (WebCore::SecurityOrigin::equal):
+        * platform/SecurityOriginData.cpp: Removed.
+        * platform/SecurityOriginData.h: Removed.
+        * storage/Database.cpp:
+        (WebCore::Database::openDatabase):
+        (WebCore::Database::Database):
+        (WebCore::Database::securityOriginCopy):
+        * storage/Database.h:
+        * storage/DatabaseTracker.cpp:
+        (WebCore::SecurityOriginHash::hash):
+        (WebCore::SecurityOriginHash::equal):
+        (WebCore::SecurityOriginTraits::deletedValue):
+        (WebCore::SecurityOriginTraits::emptyValue):
+        (WebCore::DatabaseTracker::canEstablishDatabase):
+        (WebCore::DatabaseTracker::hasEntryForOrigin):
+        (WebCore::DatabaseTracker::hasEntryForDatabase):
+        (WebCore::DatabaseTracker::establishEntryForOrigin):
+        (WebCore::DatabaseTracker::fullPathForDatabase):
+        (WebCore::DatabaseTracker::populateOrigins):
+        (WebCore::DatabaseTracker::origins):
+        (WebCore::DatabaseTracker::databaseNamesForOrigin):
+        (WebCore::DatabaseTracker::detailsForNameAndOrigin):
+        (WebCore::DatabaseTracker::setDatabaseDetails):
+        (WebCore::DatabaseTracker::usageForDatabase):
+        (WebCore::DatabaseTracker::usageForOrigin):
+        (WebCore::DatabaseTracker::quotaForOrigin):
+        (WebCore::DatabaseTracker::setQuota):
+        (WebCore::DatabaseTracker::addDatabase):
+        (WebCore::DatabaseTracker::deleteAllDatabases):
+        (WebCore::DatabaseTracker::deleteDatabasesWithOrigin):
+        (WebCore::DatabaseTracker::deleteDatabase):
+        (WebCore::DatabaseTracker::deleteDatabaseFile):
+        (WebCore::notificationQueue):
+        (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
+        (WebCore::DatabaseTracker::notifyDatabasesChanged):
+        * storage/DatabaseTracker.h:
+        * storage/DatabaseTrackerClient.h:
+        * storage/SQLTransaction.cpp:
+        (WebCore::SQLTransaction::openTransactionAndPreflight):
+        (WebCore::SQLTransaction::runStatements):
+        (WebCore::SQLTransaction::deliverQuotaIncreaseCallback):
+        (WebCore::SQLTransaction::postflightAndCommit):
+        (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
+        * svg/graphics/SVGImageEmptyClients.h:
+        (WebCore::SVGEmptyChromeClient::requestQuotaIncreaseForNewDatabase):
+        (WebCore::SVGEmptyChromeClient::requestQuotaIncreaseForDatabaseOperation):
+
 2008-01-10  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam.
index f6f7c9094e9a152c7436dabd537b94082acf82c0..e2297afcbebff41c34fdfeb042dd0488a6257232 100644 (file)
@@ -829,7 +829,6 @@ webcore_sources += \
        WebCore/platform/text/RegularExpression.cpp \
        WebCore/platform/ScrollBar.cpp \
        WebCore/platform/SecurityOrigin.cpp \
-       WebCore/platform/SecurityOriginData.cpp \
        WebCore/platform/text/SegmentedString.cpp \
        WebCore/platform/SharedBuffer.cpp \
        WebCore/platform/text/String.cpp \
index f2ae5acd7069acd2fd89cdedf9f613246c6f474f..4fcfdfb170c39ac9b2ac0e064d53a325a9d9a4ad 100644 (file)
@@ -266,6 +266,7 @@ __ZN7WebCore14DragController14placeDragCaretERKNS_8IntPointE
 __ZN7WebCore14DragController9dragEndedEv
 __ZN7WebCore14ResourceHandle12releaseProxyEv
 __ZN7WebCore14ResourceLoader14cancelledErrorEv
+__ZN7WebCore14SecurityOrigin6createERKNS_6StringES3_tPS0_
 __ZN7WebCore15BackForwardList10removeItemEPNS_11HistoryItemE
 __ZN7WebCore15BackForwardList10setEnabledEb
 __ZN7WebCore15BackForwardList11currentItemEv
@@ -290,17 +291,17 @@ __ZN7WebCore15BackForwardList9goForwardEv
 __ZN7WebCore15BackForwardListC1EPNS_4PageE
 __ZN7WebCore15BackForwardListD1Ev
 __ZN7WebCore15ContextMenuItem26releasePlatformDescriptionEv
-__ZN7WebCore15DatabaseTracker14deleteDatabaseERKNS_18SecurityOriginDataERKNS_6StringE
-__ZN7WebCore15DatabaseTracker14quotaForOriginERKNS_18SecurityOriginDataE
-__ZN7WebCore15DatabaseTracker14usageForOriginERKNS_18SecurityOriginDataE
+__ZN7WebCore15DatabaseTracker14deleteDatabaseEPNS_14SecurityOriginERKNS_6StringE
+__ZN7WebCore15DatabaseTracker14quotaForOriginEPNS_14SecurityOriginE
+__ZN7WebCore15DatabaseTracker14usageForOriginEPNS_14SecurityOriginE
 __ZN7WebCore15DatabaseTracker15setDatabasePathERKNS_6StringE
 __ZN7WebCore15DatabaseTracker18deleteAllDatabasesEv
-__ZN7WebCore15DatabaseTracker22databaseNamesForOriginERKNS_18SecurityOriginDataERN3WTF6VectorINS_6StringELm0EEE
-__ZN7WebCore15DatabaseTracker23detailsForNameAndOriginERKNS_6StringERKNS_18SecurityOriginDataE
-__ZN7WebCore15DatabaseTracker25deleteDatabasesWithOriginERKNS_18SecurityOriginDataE
-__ZN7WebCore15DatabaseTracker7originsERN3WTF6VectorINS_18SecurityOriginDataELm0EEE
+__ZN7WebCore15DatabaseTracker22databaseNamesForOriginEPNS_14SecurityOriginERN3WTF6VectorINS_6StringELm0EEE
+__ZN7WebCore15DatabaseTracker23detailsForNameAndOriginERKNS_6StringEPNS_14SecurityOriginE
+__ZN7WebCore15DatabaseTracker25deleteDatabasesWithOriginEPNS_14SecurityOriginE
+__ZN7WebCore15DatabaseTracker7originsERN3WTF6VectorINS1_6RefPtrINS_14SecurityOriginEEELm0EEE
 __ZN7WebCore15DatabaseTracker7trackerEv
-__ZN7WebCore15DatabaseTracker8setQuotaERKNS_18SecurityOriginDataEy
+__ZN7WebCore15DatabaseTracker8setQuotaEPNS_14SecurityOriginEy
 __ZN7WebCore15DatabaseTracker9setClientEPNS_21DatabaseTrackerClientE
 __ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
 __ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
@@ -329,7 +330,6 @@ __ZN7WebCore16NavigationActionC1ERKNS_4KURLENS_14NavigationTypeE
 __ZN7WebCore16NavigationActionC1Ev
 __ZN7WebCore16colorFromNSColorEP7NSColor
 __ZN7WebCore18PlatformMouseEventC1EP7NSEvent
-__ZN7WebCore18SecurityOriginDataC1ERKNS_6StringES3_t
 __ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri
 __ZN7WebCore19InspectorController11showConsoleEv
 __ZN7WebCore19InspectorController12attachWindowEv
index 79b23547692d1015f664461579e22340524b49f6..afa46fbe7aa5f8a13e70d5c1de6429ae8d116c61 100644 (file)
@@ -761,7 +761,6 @@ SOURCES += \
     platform/ScrollBar.cpp \
 #    platform/SearchPopupMenu.cpp \
     platform/SecurityOrigin.cpp \
-    platform/SecurityOriginData.cpp \
     platform/text/SegmentedString.cpp \
     platform/SharedBuffer.cpp \
     platform/text/String.cpp \
index b015fcab8bcaf8c6c0650f4d0672d90ad86a2338..5305f55f05c1a5c9c60c93dfabc72dcf7c800b63 100644 (file)
                                RelativePath="..\platform\SecurityOrigin.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\platform\SecurityOriginData.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath="..\platform\SecurityOriginData.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\platform\SharedBuffer.cpp"\r
                                >\r
index 5da896acd66177d00aede1f9e6af423510fa917e..887de343db16c505123a3a1c46cefa76f7265bbf 100644 (file)
                4E19592E0A39DACC00220FE5 /* MediaQueryExp.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1959280A39DACC00220FE5 /* MediaQueryExp.h */; };
                510184690B08602A004A825F /* CachedPage.h in Headers */ = {isa = PBXBuildFile; fileRef = 510184670B08602A004A825F /* CachedPage.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5101846A0B08602A004A825F /* CachedPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510184680B08602A004A825F /* CachedPage.cpp */; };
-               51079DD50CED2A820077247D /* SecurityOriginData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51079DD40CED2A820077247D /* SecurityOriginData.cpp */; };
                5116D9770CF177BD00C2B84D /* DatabaseDetails.h in Headers */ = {isa = PBXBuildFile; fileRef = 5116D9750CF177BD00C2B84D /* DatabaseDetails.h */; settings = {ATTRIBUTES = (Private, ); }; };
                5126E6BB0A2E3B12005C29FA /* IconDatabase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */; };
                5126E6BC0A2E3B12005C29FA /* IconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5126E6BA0A2E3B12005C29FA /* IconDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               512F2F450CEC3516006537E3 /* SecurityOriginData.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F2F440CEC3516006537E3 /* SecurityOriginData.h */; settings = {ATTRIBUTES = (Private, ); }; };
                513F14530AB634C400094DDF /* IconLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 513F14510AB634C400094DDF /* IconLoader.cpp */; };
                513F14540AB634C400094DDF /* IconLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 513F14520AB634C400094DDF /* IconLoader.h */; };
                514185EE0CD65F0400763C99 /* ChangeVersionWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 514185EC0CD65F0400763C99 /* ChangeVersionWrapper.h */; };
                4E1959280A39DACC00220FE5 /* MediaQueryExp.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MediaQueryExp.h; sourceTree = "<group>"; };
                510184670B08602A004A825F /* CachedPage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedPage.h; sourceTree = "<group>"; };
                510184680B08602A004A825F /* CachedPage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedPage.cpp; sourceTree = "<group>"; };
-               51079DD40CED2A820077247D /* SecurityOriginData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SecurityOriginData.cpp; sourceTree = "<group>"; };
                5116D9750CF177BD00C2B84D /* DatabaseDetails.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseDetails.h; sourceTree = "<group>"; };
                5126E6B90A2E3B12005C29FA /* IconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IconDatabase.cpp; sourceTree = "<group>"; };
                5126E6BA0A2E3B12005C29FA /* IconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IconDatabase.h; sourceTree = "<group>"; };
-               512F2F440CEC3516006537E3 /* SecurityOriginData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecurityOriginData.h; sourceTree = "<group>"; };
                513F14510AB634C400094DDF /* IconLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = IconLoader.cpp; sourceTree = "<group>"; };
                513F14520AB634C400094DDF /* IconLoader.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = IconLoader.h; sourceTree = "<group>"; };
                514185EC0CD65F0400763C99 /* ChangeVersionWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChangeVersionWrapper.h; sourceTree = "<group>"; };
                                AB7170880B3118080017123E /* SearchPopupMenu.h */,
                                BC014C720CC5579D009C4B20 /* SecurityOrigin.cpp */,
                                BC014C730CC5579D009C4B20 /* SecurityOrigin.h */,
-                               51079DD40CED2A820077247D /* SecurityOriginData.cpp */,
-                               512F2F440CEC3516006537E3 /* SecurityOriginData.h */,
                                1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */,
                                1A4A954C0B4EDCCB002D8C3C /* SharedBuffer.h */,
                                93309EA0099EB78C0056E581 /* SharedTimer.h */,
                                BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
                                AB7170890B3118080017123E /* SearchPopupMenu.h in Headers */,
                                BC014C750CC5579D009C4B20 /* SecurityOrigin.h in Headers */,
-                               512F2F450CEC3516006537E3 /* SecurityOriginData.h in Headers */,
                                B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */,
                                93309E0C099E64920056E581 /* Selection.h in Headers */,
                                93309E0E099E64920056E581 /* SelectionController.h in Headers */,
                                9353676B09AED88B00D35CD6 /* ScrollViewMac.mm in Sources */,
                                AB7170A00B31193B0017123E /* SearchPopupMenuMac.mm in Sources */,
                                BC014C740CC5579D009C4B20 /* SecurityOrigin.cpp in Sources */,
-                               51079DD50CED2A820077247D /* SecurityOriginData.cpp in Sources */,
                                B2C3DA2E0D006C1D00EF6F26 /* SegmentedString.cpp in Sources */,
                                93309E0B099E64920056E581 /* Selection.cpp in Sources */,
                                93309E0D099E64920056E581 /* SelectionController.cpp in Sources */,
index 6b4e376a762125577a50d54f4b46ea4325f5e669..7f4b8cbaf66116302571f5c8aa761999161a0e5c 100644 (file)
@@ -584,7 +584,6 @@ This file contains the list of files needed to build WebCore.
         platform/text/RegularExpression.cpp
         platform/ScrollBar.cpp
         platform/SecurityOrigin.cpp
-        platform/SecurityOriginData.cpp
         platform/text/SegmentedString.cpp
         platform/SharedBuffer.cpp
         platform/text/String.cpp
index 790f69971e5c65ecfd9f73cabaac0b86ff5210e6..a4c99b7bb1ec664b94f51805a8ce57bc6b9d991e 100644 (file)
@@ -118,7 +118,7 @@ KJS::JSValue* JSDOMWindow::postMessage(KJS::ExecState* exec, const KJS::List& ar
     DOMWindow* window = impl();
     
     DOMWindow* source = static_cast<JSDOMWindow*>(exec->dynamicGlobalObject())->impl();
-    String domain = source->document()->securityOrigin()->domain();
+    String domain = source->document()->securityOrigin()->host();
     String uri = source->document()->documentURI();
     String message = args[0]->toString(exec);
     
index a5437839332d1773a990d144e867d63a0582fead..cb2841ff6517dc98c0ea424565da0336bd8b55d8 100644 (file)
@@ -2601,7 +2601,7 @@ String Document::referrer() const
 
 String Document::domain() const
 {
-    return m_securityOrigin->domain();
+    return m_securityOrigin->host();
 }
 
 void Document::setDomain(const String& newDomain)
index 2b3be2139f1bbbe894452df597bd7ae041c9e809..1ee24df2aa4d30a901545ccb476fb23c0756677d 100644 (file)
@@ -37,6 +37,7 @@
 #include "WindowFeatures.h"
 #include "kjs_window.h"
 #include "PausedTimeouts.h"
+#include "SecurityOrigin.h"
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
@@ -342,12 +343,12 @@ void Chrome::print(Frame* frame)
     m_client->print(frame);
 }
 
-unsigned long long Chrome::requestQuotaIncreaseForNewDatabase(Frame* frame, const SecurityOriginData& origin, const String& databaseDisplayName, unsigned long long estimatedSize)
+unsigned long long Chrome::requestQuotaIncreaseForNewDatabase(Frame* frame, SecurityOrigin* origin, const String& databaseDisplayName, unsigned long long estimatedSize)
 {
     return m_client->requestQuotaIncreaseForNewDatabase(frame, origin, databaseDisplayName, estimatedSize);
 }
 
-unsigned long long Chrome::requestQuotaIncreaseForDatabaseOperation(Frame* frame, const SecurityOriginData& origin, const String& databaseIdentifier, unsigned long long proposedNewQuota)
+unsigned long long Chrome::requestQuotaIncreaseForDatabaseOperation(Frame* frame, SecurityOrigin* origin, const String& databaseIdentifier, unsigned long long proposedNewQuota)
 {
     return m_client->requestQuotaIncreaseForDatabaseOperation(frame, origin, databaseIdentifier, proposedNewQuota);
 }
index 38d44388541d010e040c7cd1821b6a2dccb7c1d7..b0b0df12288726baa8d5f53e25f034fa891fa7a5 100644 (file)
@@ -40,7 +40,7 @@ namespace WebCore {
     class HitTestResult;
     class IntRect;
     class Page;
-    class SecurityOriginData;
+    class SecurityOrigin;
     class String;
     
     struct FrameLoadRequest;
@@ -126,8 +126,8 @@ namespace WebCore {
 
         void print(Frame*);
 
-        unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData& origin, const String& databaseDisplayName, unsigned long long estimatedSize);
-        unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData& origin, const String& databaseIdentifier, unsigned long long proposedNewQuota);
+        unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin*, const String& databaseDisplayName, unsigned long long estimatedSize);
+        unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin* origin, const String& databaseIdentifier, unsigned long long proposedNewQuota);
         
 #if PLATFORM(MAC)
         void focusNSView(NSView*);
index c26cade982cd1bc659dc05a5405de6e5bcdec77f..90f849f8638425b72a1a360808fce1ec0a979c4b 100644 (file)
@@ -30,7 +30,7 @@ namespace WebCore {
     class HitTestResult;
     class IntRect;
     class Page;
-    class SecurityOriginData;
+    class SecurityOrigin;
     class String;
     
     struct FrameLoadRequest;
@@ -104,8 +104,8 @@ namespace WebCore {
 
         virtual void print(Frame*) = 0;
 
-        virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData& origin, const String& databaseDisplayName, unsigned long long estimatedSize) = 0;
-        virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData& origin, const String& databaseIdentifier, unsigned long long proposedNewQuota) = 0;
+        virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin* origin, const String& databaseDisplayName, unsigned long long estimatedSize) = 0;
+        virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin* origin, const String& databaseIdentifier, unsigned long long proposedNewQuota) = 0;
 };
 
 }
index dd60c9315487f7371fcb01ea4e89dd497b86d85e..efc8aa982db48edcd33a0e66c308331e353287c1 100644 (file)
@@ -35,7 +35,6 @@
 #include "FrameTree.h"
 #include "KURL.h"
 #include "PlatformString.h"
-#include "SecurityOriginData.h"
 
 namespace WebCore {
 
@@ -94,6 +93,12 @@ PassRefPtr<SecurityOrigin> SecurityOrigin::createForFrame(Frame* frame)
     return create(url.protocol(), url.host(), url.port(), ownerFrameOrigin);
 }
 
+PassRefPtr<SecurityOrigin> SecurityOrigin::copy()
+{
+    return create(m_protocol.copy(), m_host.copy(), m_port, 0);
+}
+
+
 void SecurityOrigin::setDomainFromDOM(const String& newDomain)
 {
     m_domainWasSetInDOM = true;
@@ -159,9 +164,44 @@ String SecurityOrigin::toString() const
     return m_protocol + ":" + m_host + ":" + String::number(m_port);
 }
 
-SecurityOriginData SecurityOrigin::securityOriginData() const
+static const char SeparatorCharacter = '_';
+
+PassRefPtr<SecurityOrigin> SecurityOrigin::createFromIdentifier(const String& stringIdentifier)
+{ 
+    // Make sure there's a first separator
+    int separator1 = stringIdentifier.find(SeparatorCharacter);
+    if (separator1 == -1)
+        return create("", "", 0, 0);
+        
+    // Make sure there's a second separator
+    int separator2 = stringIdentifier.find(SeparatorCharacter, separator1 + 1);
+    if (separator2 == -1)
+        return create("", "", 0, 0);
+        
+    // Make sure there's not a third separator
+    if (stringIdentifier.reverseFind(SeparatorCharacter) != separator2)
+        return create("", "", 0, 0);
+        
+    // Make sure the port section is a valid port number or doesn't exist
+    bool portOkay;
+    int port = stringIdentifier.right(stringIdentifier.length() - separator2 - 1).toInt(&portOkay);
+    if (!portOkay && separator2 + 1 == static_cast<int>(stringIdentifier.length()))
+        return create("", "", 0, 0);
+    
+    if (port < 0 || port > 65535)
+        return create("", "", 0, 0);
+        
+    // Split out the 3 sections of data
+    String protocol = stringIdentifier.substring(0, separator1);
+    String host = stringIdentifier.substring(separator1 + 1, separator2 - separator1 - 1);
+    return create(protocol, host, port, 0);
+}
+    
+    
+String SecurityOrigin::stringIdentifier() const 
 {
-    return SecurityOriginData(m_protocol, m_host, m_port);
+    static String separatorString = String(&SeparatorCharacter, 1);
+    return m_protocol + separatorString + m_host + separatorString + String::number(m_port); 
 }
 
 } // namespace WebCore
index eb0c5e66d87b747b3e3f4e7c3bf5cd7efff197b9..9d303dd0171924726bf2ef3187a8b0ca492d70ed 100644 (file)
@@ -38,23 +38,30 @@ namespace WebCore {
 
     class Frame;
     class KURL;
-    class SecurityOriginData;
     
     class SecurityOrigin : public RefCounted<SecurityOrigin> {
     public:
         static PassRefPtr<SecurityOrigin> createForFrame(Frame*);
+        static PassRefPtr<SecurityOrigin> createFromIdentifier(const String&);
         static PassRefPtr<SecurityOrigin> create(const String& protocol, const String& host, unsigned short port, SecurityOrigin* ownerFrameOrigin);
 
-        void setDomainFromDOM(const String& newDomain);
-        String domain() const { return m_host; }
+        PassRefPtr<SecurityOrigin> copy();
 
+        void setDomainFromDOM(const String& newDomain);
+        String host() const { return m_host; }
+        String protocol() const { return m_protocol; }
+        unsigned short port() const { return m_port; }
+        
         bool canAccess(const SecurityOrigin*) const;
         bool isSecureTransitionTo(const KURL&) const;
 
         bool isEmpty() const;
         String toString() const;
         
-        SecurityOriginData securityOriginData() const;
+        String stringIdentifier() const;
+
+        // do not use this for access checks, it's there only for using this as a hashtable key
+        bool equal(SecurityOrigin* other) const { return m_protocol == other->m_protocol && m_host == other->m_host && m_port == other->m_port; }
         
     private:
         SecurityOrigin(const String& protocol, const String& host, unsigned short port);
diff --git a/WebCore/platform/SecurityOriginData.cpp b/WebCore/platform/SecurityOriginData.cpp
deleted file mode 100644 (file)
index a4129b3..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#include "config.h"
-#include "SecurityOriginData.h"
-
-static const char SeparatorCharacter = '_';
-
-namespace WebCore {
-
-SecurityOriginData::SecurityOriginData()
-    : m_port(0)
-{
-}
-
-SecurityOriginData::SecurityOriginData(const String& protocol, const String& host, unsigned short port)
-    : m_protocol(protocol)
-    , m_host(host)
-    , m_port(port)
-{
-}    
-
-SecurityOriginData::SecurityOriginData(const String& stringIdentifier)
-    : m_port(0)
-{ 
-    // Make sure there's a first separator
-    int separator1 = stringIdentifier.find(SeparatorCharacter);
-    if (separator1 == -1)
-        return;
-            
-    // Make sure there's a second separator
-    int separator2 = stringIdentifier.find(SeparatorCharacter, separator1 + 1);
-    if (separator2 == -1)
-        return;
-        
-    // Make sure there's not a third separator
-    if (stringIdentifier.reverseFind(SeparatorCharacter) != separator2)
-        return;
-        
-    // Make sure the port section is a valid port number or doesn't exist
-    bool portOkay;
-    int port = stringIdentifier.right(stringIdentifier.length() - separator2 - 1).toInt(&portOkay);
-    if (!portOkay && separator2 + 1 == static_cast<int>(stringIdentifier.length()))
-        return;
-
-    if (port < 0 || port > 65535)
-        return;
-            
-    // Split out the 3 sections of data
-    m_protocol = stringIdentifier.substring(0, separator1);
-    m_host = stringIdentifier.substring(separator1 + 1, separator2 - separator1 - 1);
-    m_port = port;
-}
-
-SecurityOriginData SecurityOriginData::copy() const
-{
-    return SecurityOriginData(m_protocol.copy(), m_host.copy(), m_port);
-}
-
-String SecurityOriginData::stringIdentifier() const 
-{
-    static String separatorString = String(&SeparatorCharacter, 1);
-    return m_protocol + separatorString + m_host + separatorString + String::number(m_port); 
-}
-
-} // namespace WebCore
diff --git a/WebCore/platform/SecurityOriginData.h b/WebCore/platform/SecurityOriginData.h
deleted file mode 100644 (file)
index dc21f82..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (C) 2007 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- *     its contributors may be used to endorse or promote products derived
- *     from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef SecurityOriginData_h
-#define SecurityOriginData_h
-
-#include "PlatformString.h"
-
-namespace WebCore {
-
-class SecurityOriginData {
-public:
-    SecurityOriginData();
-    SecurityOriginData(const String& protocol, const String& host, unsigned short port);
-    SecurityOriginData(const String& stringIdentifier);
-    
-    const String& protocol() const { return m_protocol; }
-    const String& host() const { return m_host; }
-    unsigned short port() const { return m_port; }
-
-    // Needed to make a deep copy of the object for thread safety when crossing a thread boundary
-    SecurityOriginData copy() const;
-
-    String stringIdentifier() const;
-private:
-    String m_protocol;
-    String m_host;
-    unsigned short m_port;
-};
-    
-inline bool operator==(const SecurityOriginData& a, const SecurityOriginData& b) { return a.protocol() == b.protocol() && a.host() == b.host() && a.port() == b.port(); }
-inline bool operator!=(const SecurityOriginData& a, const SecurityOriginData& b) { return !(a == b); }
-
-} // namespace WebCore
-
-#endif // SecurityOriginData_h
index 828d867457357788f351a4982aff66975b51db22..556fd42626e18db2545ce84b1b6def5bf0e1fb05 100644 (file)
@@ -43,7 +43,6 @@
 #include "Logging.h"
 #include "NotImplemented.h"
 #include "Page.h"
-#include "SecurityOriginData.h"
 #include "SQLiteDatabase.h"
 #include "SQLiteStatement.h"
 #include "SQLResultSet.h"
@@ -109,7 +108,7 @@ PassRefPtr<Database> Database::openDatabase(Document* document, const String& na
        return 0;
     }
     
-    DatabaseTracker::tracker().setDatabaseDetails(document->securityOrigin()->securityOriginData(), name, displayName, estimatedSize);
+    DatabaseTracker::tracker().setDatabaseDetails(document->securityOrigin(), name, displayName, estimatedSize);
 
     document->setHasOpenDatabases();
 
@@ -151,7 +150,7 @@ Database::Database(Document* document, const String& name, const String& expecte
     m_databaseThread = document->databaseThread();
     ASSERT(m_databaseThread);
 
-    m_filename = DatabaseTracker::tracker().fullPathForDatabase(m_securityOrigin->securityOriginData(), m_name);
+    m_filename = DatabaseTracker::tracker().fullPathForDatabase(m_securityOrigin.get(), m_name);
 }
 
 Database::~Database()
@@ -550,10 +549,9 @@ void Database::setExpectedVersion(const String& version)
     m_expectedVersion = version.copy();
 }
 
-SecurityOriginData Database::securityOriginData() const
+PassRefPtr<SecurityOrigin> Database::securityOriginCopy() const
 {
-    // Return a deep copy for ref counting thread safety
-    return m_securityOrigin->securityOriginData().copy();
+    return m_securityOrigin->copy();
 }
 
 String Database::stringIdentifier() const
index 1b5e8203012baa4435976edc7b034fd58be3f223..72ad64e0653fb4be0f5dabb0b38db1a16612421d 100644 (file)
@@ -50,7 +50,6 @@ namespace WebCore {
 class DatabaseAuthorizer;
 class DatabaseThread;
 class Document;
-class SecurityOriginData;
 class SQLResultSet;
 class SQLTransactionCallback;
 class SQLTransactionErrorCallback;
@@ -83,7 +82,7 @@ public:
     Vector<String> tableNames();
 
     Document* document() const { return m_document; }
-    SecurityOriginData securityOriginData() const;
+    PassRefPtr<SecurityOrigin> securityOriginCopy() const;
     String stringIdentifier() const;
     
     bool getVersionFromDatabase(String&);
index cdecc2e4ff2673562ce62be41ab11a30713e828c..21906d954c1ab7fad4b589e41f16890c28c1dc34 100644 (file)
@@ -33,7 +33,7 @@
 #include "Document.h"
 #include "FileSystem.h"
 #include "Page.h"
-#include "SecurityOriginData.h"
+#include "SecurityOrigin.h"
 #include "SQLiteStatement.h"
 
 namespace WebCore {
@@ -41,37 +41,40 @@ namespace WebCore {
 // HTML5 SQL Storage spec suggests 5MB as the default quota per origin
 static const unsigned DefaultOriginQuota = 5242880;
 
-struct SecurityOriginDataHash {
-    static unsigned hash(const SecurityOriginData& data)
+struct SecurityOriginHash {
+    static unsigned hash(RefPtr<SecurityOrigin> origin)
     {
         unsigned hashCodes[3] = {
-            data.protocol().impl() ? data.protocol().impl()->hash() : 0,
-            data.host().impl() ? data.host().impl()->hash() : 0,
-            data.port()
+            origin->protocol().impl() ? origin->protocol().impl()->hash() : 0,
+            origin->host().impl() ? origin->host().impl()->hash() : 0,
+            origin->port()
         };
         return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), 3 * sizeof(unsigned) / sizeof(UChar));
     }
          
-    static bool equal(const SecurityOriginData& a, const SecurityOriginData& b)
+    static bool equal(RefPtr<SecurityOrigin> a, RefPtr<SecurityOrigin> b)
     {
-        return a == b;
+        if (a == 0 || b == 0)
+            return a == b;
+        return a->equal(b.get());
     }
 
     static const bool safeToCompareToEmptyOrDeleted = true;
 };
 
-struct SecurityOriginDataTraits : WTF::GenericHashTraits<SecurityOriginData> {
-    static const SecurityOriginData& deletedValue()
-    {
+
+struct SecurityOriginTraits : WTF::GenericHashTraits<RefPtr<SecurityOrigin> > {
+    static const bool emptyValueIsZero = true;
+    static const RefPtr<SecurityOrigin>& deletedValue() 
+    { 
         // Okay deleted value because file: protocols should always have port 0
-        static SecurityOriginData key("file", "", 1);
-        return key;
+        static const RefPtr<SecurityOrigin> securityOriginDeletedValue = SecurityOrigin::create("file", "", 1, 0);    
+        return securityOriginDeletedValue; 
     }
-    static const SecurityOriginData& emptyValue()
-    {
-        // Okay empty value because file: protocols should always have port 0
-        static SecurityOriginData key("file", "", 2);
-        return key;
+
+    static SecurityOrigin* emptyValue() 
+    { 
+        return 0;
     }
 };
 
@@ -125,19 +128,19 @@ void DatabaseTracker::openTrackerDatabase()
 
 bool DatabaseTracker::canEstablishDatabase(Document* document, const String& name, const String& displayName, unsigned long estimatedSize)
 {
-    SecurityOriginData originData = document->securityOrigin()->securityOriginData();
+    SecurityOrigin* origin = document->securityOrigin();
     
     // If this origin has no databases yet, establish an entry in the tracker database with the default quota
-    if (!hasEntryForOrigin(originData))
-        establishEntryForOrigin(originData);
+    if (!hasEntryForOrigin(origin))
+        establishEntryForOrigin(origin);
     
     // If a database already exists, you can always establish a handle to it
-    if (hasEntryForDatabase(originData, name))
+    if (hasEntryForDatabase(origin, name))
         return true;
         
     // If the new database will fit as-is, allow its creation
-    unsigned long long usage = usageForOrigin(originData);
-    if (usage + estimatedSize < quotaForOrigin(originData))
+    unsigned long long usage = usageForOrigin(origin);
+    if (usage + estimatedSize < quotaForOrigin(origin))
         return true;
     
     // Otherwise, ask the UI Delegate for a new quota
@@ -146,46 +149,46 @@ bool DatabaseTracker::canEstablishDatabase(Document* document, const String& nam
         return false;
     
     // If no displayName was specified, pass the standard (required) name instead
-    unsigned long long newQuota = page->chrome()->requestQuotaIncreaseForNewDatabase(document->frame(), originData, displayName.length() > 0 ? displayName : name, estimatedSize);
-    setQuota(originData, newQuota);
+    unsigned long long newQuota = page->chrome()->requestQuotaIncreaseForNewDatabase(document->frame(), origin, displayName.length() > 0 ? displayName : name, estimatedSize);
+    setQuota(origin, newQuota);
     
     return usage + estimatedSize <= newQuota;
 }
 
-bool DatabaseTracker::hasEntryForOrigin(const SecurityOriginData& origin)
+bool DatabaseTracker::hasEntryForOrigin(SecurityOrigin* origin)
 {
     populateOrigins();
     return m_originQuotaMap->contains(origin);
 }
 
-bool DatabaseTracker::hasEntryForDatabase(const SecurityOriginData& origin, const String& databaseIdentifier)
+bool DatabaseTracker::hasEntryForDatabase(SecurityOrigin* origin, const String& databaseIdentifier)
 {
     SQLiteStatement statement(m_database, "SELECT guid FROM Databases WHERE origin=? AND name=?;");
 
     if (statement.prepare() != SQLResultOk)
         return false;
 
-    statement.bindText(1, origin.stringIdentifier());
+    statement.bindText(1, origin->stringIdentifier());
     statement.bindText(2, databaseIdentifier);
 
     return statement.step() == SQLResultRow;
 }
 
-void DatabaseTracker::establishEntryForOrigin(const SecurityOriginData& origin)
+void DatabaseTracker::establishEntryForOrigin(SecurityOrigin* origin)
 {
     ASSERT(!hasEntryForOrigin(origin));
     
     SQLiteStatement statement(m_database, "INSERT INTO Origins VALUES (?, ?)");
     if (statement.prepare() != SQLResultOk) {
-        LOG_ERROR("Unable to establish origin %s in the tracker", origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to establish origin %s in the tracker", origin->stringIdentifier().ascii().data());
         return;
     }
         
-    statement.bindText(1, origin.stringIdentifier());
+    statement.bindText(1, origin->stringIdentifier());
     statement.bindInt64(2, m_defaultQuota);
     
     if (statement.step() != SQLResultDone) {
-        LOG_ERROR("Unable to establish origin %s in the tracker", origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to establish origin %s in the tracker", origin->stringIdentifier().ascii().data());
         return;
     }
 
@@ -196,9 +199,9 @@ void DatabaseTracker::establishEntryForOrigin(const SecurityOriginData& origin)
         m_client->dispatchDidModifyOrigin(origin);
 }
 
-String DatabaseTracker::fullPathForDatabase(const SecurityOriginData& origin, const String& name, bool createIfNotExists)
+String DatabaseTracker::fullPathForDatabase(SecurityOrigin* origin, const String& name, bool createIfNotExists)
 {
-    String originIdentifier = origin.stringIdentifier();
+    String originIdentifier = origin->stringIdentifier();
     String originPath = pathByAppendingComponent(m_databasePath, originIdentifier);
     
     // Make sure the path for this SecurityOrigin exists
@@ -222,7 +225,7 @@ String DatabaseTracker::fullPathForDatabase(const SecurityOriginData& origin, co
         return "";
         
     if (result != SQLResultDone) {
-        LOG_ERROR("Failed to retrieve filename from Database Tracker for origin %s, name %s", origin.stringIdentifier().ascii().data(), name.ascii().data());
+        LOG_ERROR("Failed to retrieve filename from Database Tracker for origin %s, name %s", origin->stringIdentifier().ascii().data(), name.ascii().data());
         return "";
     }
     statement.finalize();
@@ -260,7 +263,7 @@ void DatabaseTracker::populateOrigins()
     if (m_originQuotaMap)
         return;
 
-    m_originQuotaMap.set(new HashMap<SecurityOriginData, unsigned long long, SecurityOriginDataHash, SecurityOriginDataTraits>);
+    m_originQuotaMap.set(new HashMap<RefPtr<SecurityOrigin>, unsigned long long, SecurityOriginHash, SecurityOriginTraits>);
 
     if (!m_database.isOpen())
         return;
@@ -271,8 +274,9 @@ void DatabaseTracker::populateOrigins()
         return;
 
     int result;
+    RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromIdentifier(statement.getColumnText16(0));
     while ((result = statement.step()) == SQLResultRow)
-        m_originQuotaMap->set(statement.getColumnText16(0), statement.getColumnInt64(1));
+        m_originQuotaMap->set(origin.get(), statement.getColumnInt64(1));
 
     if (result != SQLResultDone)
         LOG_ERROR("Failed to read in all origins from the database");
@@ -280,7 +284,7 @@ void DatabaseTracker::populateOrigins()
     return;
 }
 
-void DatabaseTracker::origins(Vector<SecurityOriginData>& result)
+void DatabaseTracker::origins(Vector<RefPtr<SecurityOrigin> >& result)
 {
     if (!m_originQuotaMap)
         populateOrigins();
@@ -288,7 +292,7 @@ void DatabaseTracker::origins(Vector<SecurityOriginData>& result)
     copyKeysToVector(*(m_originQuotaMap.get()), result);
 }
 
-bool DatabaseTracker::databaseNamesForOrigin(const SecurityOriginData& origin, Vector<String>& resultVector)
+bool DatabaseTracker::databaseNamesForOrigin(SecurityOrigin* origin, Vector<String>& resultVector)
 {
     if (!m_database.isOpen())
         return false;
@@ -298,23 +302,23 @@ bool DatabaseTracker::databaseNamesForOrigin(const SecurityOriginData& origin, V
     if (statement.prepare() != SQLResultOk)
         return false;
 
-    statement.bindText(1, origin.stringIdentifier());
+    statement.bindText(1, origin->stringIdentifier());
 
     int result;
     while ((result = statement.step()) == SQLResultRow)
         resultVector.append(statement.getColumnText16(0));
 
     if (result != SQLResultDone) {
-        LOG_ERROR("Failed to retrieve all database names for origin %s", origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Failed to retrieve all database names for origin %s", origin->stringIdentifier().ascii().data());
         return false;
     }
 
     return true;
 }
 
-DatabaseDetails DatabaseTracker::detailsForNameAndOrigin(const String& name, const SecurityOriginData& origin)
+DatabaseDetails DatabaseTracker::detailsForNameAndOrigin(const String& name, SecurityOrigin* origin)
 {
-    String originIdentifier = origin.stringIdentifier();
+    String originIdentifier = origin->stringIdentifier();
         
     SQLiteStatement statement(m_database, "SELECT displayName, estimatedSize FROM Databases WHERE origin=? AND name=?");
     if (statement.prepare() != SQLResultOk)
@@ -335,9 +339,9 @@ DatabaseDetails DatabaseTracker::detailsForNameAndOrigin(const String& name, con
     return DatabaseDetails(name, statement.getColumnText(0), statement.getColumnInt64(1), usageForDatabase(name, origin));
 }
 
-void DatabaseTracker::setDatabaseDetails(const SecurityOriginData& origin, const String& name, const String& displayName, unsigned long estimatedSize)
+void DatabaseTracker::setDatabaseDetails(SecurityOrigin* origin, const String& name, const String& displayName, unsigned long estimatedSize)
 {
-    String originIdentifier = origin.stringIdentifier();
+    String originIdentifier = origin->stringIdentifier();
     int64_t guid = 0;
     
     SQLiteStatement statement(m_database, "SELECT guid FROM Databases WHERE origin=? AND name=?");
@@ -382,7 +386,7 @@ void DatabaseTracker::setDatabaseDetails(const SecurityOriginData& origin, const
         m_client->dispatchDidModifyDatabase(origin, name);
 }
 
-unsigned long long DatabaseTracker::usageForDatabase(const String& name, const SecurityOriginData& origin)
+unsigned long long DatabaseTracker::usageForDatabase(const String& name, SecurityOrigin* origin)
 {
     String path = fullPathForDatabase(origin, name, false);
     if (path.isEmpty())
@@ -392,7 +396,7 @@ unsigned long long DatabaseTracker::usageForDatabase(const String& name, const S
     return fileSize(path, size) ? size : 0;
 }
 
-unsigned long long DatabaseTracker::usageForOrigin(const SecurityOriginData& origin)
+unsigned long long DatabaseTracker::usageForOrigin(SecurityOrigin* origin)
 {
     Vector<String> names;
     databaseNamesForOrigin(origin, names);
@@ -404,13 +408,13 @@ unsigned long long DatabaseTracker::usageForOrigin(const SecurityOriginData& ori
     return result;
 }
 
-unsigned long long DatabaseTracker::quotaForOrigin(const SecurityOriginData& origin)
+unsigned long long DatabaseTracker::quotaForOrigin(SecurityOrigin* origin)
 {
     populateOrigins();
     return m_originQuotaMap->get(origin);
 }
 
-void DatabaseTracker::setQuota(const SecurityOriginData& origin, unsigned long long quota)
+void DatabaseTracker::setQuota(SecurityOrigin* origin, unsigned long long quota)
 {
     populateOrigins();
     if (!m_originQuotaMap->contains(origin))
@@ -423,19 +427,19 @@ void DatabaseTracker::setQuota(const SecurityOriginData& origin, unsigned long l
     bool error = statement.prepare() != SQLResultOk;
     if (!error) {
         statement.bindInt64(1, quota);
-        statement.bindText(2, origin.stringIdentifier());
+        statement.bindText(2, origin->stringIdentifier());
         
         error = !statement.executeCommand();
     }
         
     if (error)
-        LOG_ERROR("Failed to set quota %llu in tracker database for origin %s", quota, origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Failed to set quota %llu in tracker database for origin %s", quota, origin->stringIdentifier().ascii().data());
     
     if (m_client)
         m_client->dispatchDidModifyOrigin(origin);
 }
     
-bool DatabaseTracker::addDatabase(const SecurityOriginData& origin, const String& name, const String& path)
+bool DatabaseTracker::addDatabase(SecurityOrigin* origin, const String& name, const String& path)
 {
     if (!m_database.isOpen())
         return false;
@@ -448,12 +452,12 @@ bool DatabaseTracker::addDatabase(const SecurityOriginData& origin, const String
     if (statement.prepare() != SQLResultOk)
         return false;
 
-    statement.bindText(1, origin.stringIdentifier());
+    statement.bindText(1, origin->stringIdentifier());
     statement.bindText(2, name);
     statement.bindText(3, path);
 
     if (!statement.executeCommand()) {
-        LOG_ERROR("Failed to add database %s to origin %s: %s\n", name.ascii().data(), origin.stringIdentifier().ascii().data(), statement.lastErrorMsg());
+        LOG_ERROR("Failed to add database %s to origin %s: %s\n", name.ascii().data(), origin->stringIdentifier().ascii().data(), statement.lastErrorMsg());
         return false;
     }
     
@@ -467,38 +471,38 @@ void DatabaseTracker::deleteAllDatabases()
 {
     populateOrigins();
     
-    HashMap<SecurityOriginData, unsigned long long, SecurityOriginDataHash, SecurityOriginDataTraits>::const_iterator iter = m_originQuotaMap->begin();
-    HashMap<SecurityOriginData, unsigned long long, SecurityOriginDataHash, SecurityOriginDataTraits>::const_iterator end = m_originQuotaMap->end();
+    HashMap<RefPtr<SecurityOrigin>, unsigned long long, SecurityOriginHash, SecurityOriginTraits>::const_iterator iter = m_originQuotaMap->begin();
+    HashMap<RefPtr<SecurityOrigin>, unsigned long long, SecurityOriginHash, SecurityOriginTraits>::const_iterator end = m_originQuotaMap->end();
 
     for (; iter != end; ++iter)
-        deleteDatabasesWithOrigin(iter->first);
+        deleteDatabasesWithOrigin(iter->first.get());
 }
 
-void DatabaseTracker::deleteDatabasesWithOrigin(const SecurityOriginData& origin)
+void DatabaseTracker::deleteDatabasesWithOrigin(SecurityOrigin* origin)
 {
     Vector<String> databaseNames;
     if (!databaseNamesForOrigin(origin, databaseNames)) {
-        LOG_ERROR("Unable to retrieve list of database names for origin %s", origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to retrieve list of database names for origin %s", origin->stringIdentifier().ascii().data());
         return;
     }
     
     for (unsigned i = 0; i < databaseNames.size(); ++i) {
         if (!deleteDatabaseFile(origin, databaseNames[i])) {
-            LOG_ERROR("Unable to delete file for database %s in origin %s", databaseNames[i].ascii().data(), origin.stringIdentifier().ascii().data());
+            LOG_ERROR("Unable to delete file for database %s in origin %s", databaseNames[i].ascii().data(), origin->stringIdentifier().ascii().data());
             return;
         }
     }
     
     SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=?");
     if (statement.prepare() != SQLResultOk) {
-        LOG_ERROR("Unable to prepare deletion of databases from origin %s from tracker", origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to prepare deletion of databases from origin %s from tracker", origin->stringIdentifier().ascii().data());
         return;
     }
         
-    statement.bindText(1, origin.stringIdentifier());
+    statement.bindText(1, origin->stringIdentifier());
     
     if (!statement.executeCommand()) {
-        LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to execute deletion of databases from origin %s from tracker", origin->stringIdentifier().ascii().data());
         return;
     }
     
@@ -509,24 +513,24 @@ void DatabaseTracker::deleteDatabasesWithOrigin(const SecurityOriginData& origin
     }
 }
 
-void DatabaseTracker::deleteDatabase(const SecurityOriginData& origin, const String& name)
+void DatabaseTracker::deleteDatabase(SecurityOrigin* origin, const String& name)
 {
     if (!deleteDatabaseFile(origin, name)) {
-        LOG_ERROR("Unable to delete file for database %s in origin %s", name.ascii().data(), origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to delete file for database %s in origin %s", name.ascii().data(), origin->stringIdentifier().ascii().data());
         return;
     }
     
     SQLiteStatement statement(m_database, "DELETE FROM Databases WHERE origin=? AND name=?");
     if (statement.prepare() != SQLResultOk) {
-        LOG_ERROR("Unable to prepare deletion of database %s from origin %s from tracker", name.ascii().data(), origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to prepare deletion of database %s from origin %s from tracker", name.ascii().data(), origin->stringIdentifier().ascii().data());
         return;
     }
         
-    statement.bindText(1, origin.stringIdentifier());
+    statement.bindText(1, origin->stringIdentifier());
     statement.bindText(2, name);
     
     if (!statement.executeCommand()) {
-        LOG_ERROR("Unable to execute deletion of database %s from origin %s from tracker", name.ascii().data(), origin.stringIdentifier().ascii().data());
+        LOG_ERROR("Unable to execute deletion of database %s from origin %s from tracker", name.ascii().data(), origin->stringIdentifier().ascii().data());
         return;
     }
     
@@ -536,7 +540,7 @@ void DatabaseTracker::deleteDatabase(const SecurityOriginData& origin, const Str
     }
 }
 
-bool DatabaseTracker::deleteDatabaseFile(const SecurityOriginData& origin, const String& name)
+bool DatabaseTracker::deleteDatabaseFile(SecurityOrigin* origin, const String& name)
 {
     String fullPath = fullPathForDatabase(origin, name, false);
     if (fullPath.isEmpty())
@@ -566,17 +570,17 @@ static Mutex& notificationMutex()
     return mutex;
 }
 
-static Vector<pair<SecurityOriginData, String> >& notificationQueue()
+static Vector<pair<SecurityOrigin*, String> >& notificationQueue()
 {
-    static Vector<pair<SecurityOriginData, String> > queue;
+    static Vector<pair<SecurityOrigin*, String> > queue;
     return queue;
 }
 
-void DatabaseTracker::scheduleNotifyDatabaseChanged(const SecurityOriginData& origin, const String& name)
+void DatabaseTracker::scheduleNotifyDatabaseChanged(SecurityOrigin* origin, const String& name)
 {
     MutexLocker locker(notificationMutex());
 
-    notificationQueue().append(pair<SecurityOriginData, String>(origin.copy(), name.copy()));
+    notificationQueue().append(pair<SecurityOrigin*, String>(origin, name.copy()));
     scheduleForNotification();
 }
 
@@ -598,7 +602,7 @@ void DatabaseTracker::notifyDatabasesChanged()
     // mechanism to inclue which tracker the notification goes out on, as well
     DatabaseTracker& theTracker(tracker());
 
-    Vector<pair<SecurityOriginData, String> > notifications;
+    Vector<pair<SecurityOrigin*, String> > notifications;
     {
         MutexLocker locker(notificationMutex());
 
index 9bd1fac395fbb4d08f2cd0397749088d3110b3a8..8fedd062559d00b6bb1ba5d325770602c76216c1 100644 (file)
@@ -39,33 +39,33 @@ namespace WebCore {
 
 class DatabaseTrackerClient;
 class Document;
-class SecurityOriginData;
+class SecurityOrigin;
 
-struct SecurityOriginDataHash;
-struct SecurityOriginDataTraits;
+struct SecurityOriginHash;
+struct SecurityOriginTraits;
 
 class DatabaseTracker {
 public:
     void setDatabasePath(const String&);
     const String& databasePath();
 
-    bool canEstablishDatabase(Document* document, const String& name, const String& displayName, unsigned long estimatedSize);
-    void setDatabaseDetails(const SecurityOriginData& origin, const String& name, const String& displayName, unsigned long estimatedSize);
-    String fullPathForDatabase(const SecurityOriginData& origin, const String& name, bool createIfNotExists = true);
+    bool canEstablishDatabase(Document*, const String& name, const String& displayName, unsigned long estimatedSize);
+    void setDatabaseDetails(SecurityOrigin*, const String& name, const String& displayName, unsigned long estimatedSize);
+    String fullPathForDatabase(SecurityOrigin*, const String& name, bool createIfNotExists = true);
 
-    void origins(Vector<SecurityOriginData>& result);
-    bool databaseNamesForOrigin(const SecurityOriginData& origin, Vector<String>& result);
+    void origins(Vector<RefPtr<SecurityOrigin> >& result);
+    bool databaseNamesForOrigin(SecurityOrigin*, Vector<String>& result);
 
-    DatabaseDetails detailsForNameAndOrigin(const String&, const SecurityOriginData&);
+    DatabaseDetails detailsForNameAndOrigin(const String&, SecurityOrigin*);
     
-    unsigned long long usageForDatabase(const String&, const SecurityOriginData&);
-    unsigned long long usageForOrigin(const SecurityOriginData&);
-    unsigned long long quotaForOrigin(const SecurityOriginData&);
-    void setQuota(const SecurityOriginData&, unsigned long long);
+    unsigned long long usageForDatabase(const String&, SecurityOrigin*);
+    unsigned long long usageForOrigin(SecurityOrigin*);
+    unsigned long long quotaForOrigin(SecurityOrigin*);
+    void setQuota(SecurityOrigin*, unsigned long long);
     
     void deleteAllDatabases();
-    void deleteDatabasesWithOrigin(const SecurityOriginData& origin);
-    void deleteDatabase(const SecurityOriginData& origin, const String& name);
+    void deleteDatabasesWithOrigin(SecurityOrigin*);
+    void deleteDatabase(SecurityOrigin*, const String& name);
 
     void setClient(DatabaseTrackerClient*);
     
@@ -73,7 +73,7 @@ public:
     unsigned long long defaultOriginQuota() const;
     
     // From a secondary thread, must be thread safe with its data
-    void scheduleNotifyDatabaseChanged(const SecurityOriginData&, const String& name);
+    void scheduleNotifyDatabaseChanged(SecurityOrigin*, const String& name);
     
     static DatabaseTracker& tracker();
 private:
@@ -81,17 +81,17 @@ private:
 
     void openTrackerDatabase();
     
-    bool hasEntryForOrigin(const SecurityOriginData&);
-    bool hasEntryForDatabase(const SecurityOriginData&, const String& databaseIdentifier);
-    void establishEntryForOrigin(const SecurityOriginData&);
+    bool hasEntryForOrigin(SecurityOrigin*);
+    bool hasEntryForDatabase(SecurityOrigin*, const String& databaseIdentifier);
+    void establishEntryForOrigin(SecurityOrigin*);
     
-    bool addDatabase(const SecurityOriginData& origin, const String& name, const String& path);
+    bool addDatabase(SecurityOrigin*, const String& name, const String& path);
     void populateOrigins();
     
-    bool deleteDatabaseFile(const SecurityOriginData& origin, const String& name);
+    bool deleteDatabaseFile(SecurityOrigin*, const String& name);
 
     SQLiteDatabase m_database;
-    mutable OwnPtr<HashMap<SecurityOriginData, unsigned long long, SecurityOriginDataHash, SecurityOriginDataTraits> > m_originQuotaMap;
+    mutable OwnPtr<HashMap<RefPtr<SecurityOrigin>, unsigned long long, SecurityOriginHash, SecurityOriginTraits> > m_originQuotaMap;
 
     String m_databasePath;
     
index bf26d14b9f142b7ec60c029ddc99caa82c43a06f..f9b0f70ba53f35e122fc5f8cbedde5e302a6712b 100644 (file)
 
 namespace WebCore {
 
-class SecurityOriginData;
+class SecurityOrigin;
 class String;
 
 class DatabaseTrackerClient {
 public:
     virtual ~DatabaseTrackerClient() { }
-    virtual void dispatchDidModifyOrigin(const SecurityOriginData&) = 0;
-    virtual void dispatchDidModifyDatabase(const SecurityOriginData&, const String& databaseName) = 0;
+    virtual void dispatchDidModifyOrigin(SecurityOrigin*) = 0;
+    virtual void dispatchDidModifyDatabase(SecurityOrigin*, const String& databaseName) = 0;
 };
 
 } // namespace WebCore
index c1a6bd11a9c6b44683828be240cf42c70f0ed935..f7f0acf850aa207d00c46d53e0ba5755bc150bee 100644 (file)
@@ -36,7 +36,7 @@
 #include "Logging.h"
 #include "Page.h"
 #include "PlatformString.h"
-#include "SecurityOriginData.h"
+#include "SecurityOrigin.h"
 #include "SQLError.h"
 #include "SQLiteTransaction.h"
 #include "SQLResultSet.h"
@@ -118,7 +118,7 @@ void SQLTransaction::openTransactionAndPreflight()
     // An efficient way to track the size of individual databases in an origin will need to be developed
     // before we can know
     // <rdar://problem/5628468> tracks this task
-    m_database->m_sqliteDatabase.setMaximumSize(DatabaseTracker::tracker().quotaForOrigin(m_database->securityOriginData()));
+    m_database->m_sqliteDatabase.setMaximumSize(DatabaseTracker::tracker().quotaForOrigin(m_database->securityOriginCopy().get()));
     
     ASSERT(!m_sqliteTransaction);
     m_sqliteTransaction.set(new SQLiteTransaction(m_database->m_sqliteDatabase));
@@ -188,7 +188,7 @@ void SQLTransaction::runStatements()
             // See ::openTransactionAndPreflight() for discussion
             
             // Reset the maximum size here, as it was increased to allow us to retry this statement
-            m_database->m_sqliteDatabase.setMaximumSize(DatabaseTracker::tracker().quotaForOrigin(m_database->securityOriginData()));
+            m_database->m_sqliteDatabase.setMaximumSize(DatabaseTracker::tracker().quotaForOrigin(m_database->securityOriginCopy().get()));
         } else {
             // If the current statement has already been run, failed due to quota constraints, and we're not retrying it,
             // that means it ended in an error.  Handle it now
@@ -291,12 +291,12 @@ void SQLTransaction::deliverQuotaIncreaseCallback()
     Page* page = m_database->document()->page();
     ASSERT(page);
     
-    SecurityOriginData originData = m_database->securityOriginData();
+    RefPtr<SecurityOrigin> origin = m_database->securityOriginCopy();
     
-    unsigned long long currentQuota = DatabaseTracker::tracker().quotaForOrigin(originData);
-    unsigned long long newQuota = page->chrome()->requestQuotaIncreaseForDatabaseOperation(m_database->document()->frame(), originData, m_database->stringIdentifier(), currentQuota + DefaultQuotaSizeIncrease);
+    unsigned long long currentQuota = DatabaseTracker::tracker().quotaForOrigin(origin.get());
+    unsigned long long newQuota = page->chrome()->requestQuotaIncreaseForDatabaseOperation(m_database->document()->frame(), origin.get(), m_database->stringIdentifier(), currentQuota + DefaultQuotaSizeIncrease);
     
-    DatabaseTracker::tracker().setQuota(originData, newQuota);
+    DatabaseTracker::tracker().setQuota(origin.get(), newQuota);
     
     // If the new quota ended up being larger than the old quota, we will retry the statement.
     if (newQuota > currentQuota)
@@ -334,7 +334,7 @@ void SQLTransaction::postflightAndCommit()
     
     // The commit was successful, notify the delegates if the transaction modified this database
     if (m_modifiedDatabase)
-        DatabaseTracker::tracker().scheduleNotifyDatabaseChanged(m_database->m_securityOrigin->securityOriginData(), m_database->m_name);
+        DatabaseTracker::tracker().scheduleNotifyDatabaseChanged(m_database->m_securityOrigin.get(), m_database->m_name);
     
     // Transaction Step 10 - End transaction steps
     // There is no next step
@@ -391,7 +391,7 @@ void SQLTransaction::cleanupAfterTransactionErrorCallback()
             m_sqliteTransaction->rollback();
         } else if (m_modifiedDatabase) {
             // But if the commit was successful, notify the delegates if the transaction modified this database
-            DatabaseTracker::tracker().scheduleNotifyDatabaseChanged(m_database->m_securityOrigin->securityOriginData(), m_database->m_name);
+            DatabaseTracker::tracker().scheduleNotifyDatabaseChanged(m_database->m_securityOrigin.get(), m_database->m_name);
         }
         
         m_sqliteTransaction.clear();
index 69ba92634fa29f8fe390262b7a8e1248b0a0b78c..c943d466b29b10d33f5fd29075266b86d9f3b408 100644 (file)
@@ -116,8 +116,8 @@ public:
 
     virtual void print(Frame*) { }
 
-    virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData&, const String&, unsigned long long) { return 0; }
-    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData&, const String&, unsigned long long) { return 0; }
+    virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin*, const String&, unsigned long long) { return 0; }
+    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin*, const String&, unsigned long long) { return 0; }
 };
 
 class SVGEmptyFrameLoaderClient : public FrameLoaderClient {
index d748009cd8a2e2cfcfc6d4510a3d045c6199085a..5ac4ad4ed347046d343621903b0120b6aec0b1e9 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-10  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Sam.
+
+        - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+        * WebCoreSupport/ChromeClientGtk.cpp:
+        (WebKit::ChromeClient::requestQuotaIncreaseForNewDatabase):
+        (WebKit::ChromeClient::requestQuotaIncreaseForDatabaseOperation):
+        * WebCoreSupport/ChromeClientGtk.h:
+
 2008-01-09  Luca Bruno  <lethalman88@gmail.com>
 
         Reviewed by Alp Toker.
index b852886c3da416d17f354d2ce5dc2841eb5d1f12..d17e523a5cb56864f6885ca1842d52768b9a9551 100644 (file)
@@ -293,13 +293,13 @@ void ChromeClient::print(Frame* frame)
     webkit_web_frame_print(kit(frame));
 }
 
-unsigned long long ChromeClient::requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData&, const String&, unsigned long long)
+unsigned long long ChromeClient::requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin*, const String&, unsigned long long)
 {
     notImplemented();
     return 0;
 }
 
-unsigned long long ChromeClient::requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData&, const String&, unsigned long long)
+unsigned long long ChromeClient::requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin*, const String&, unsigned long long)
 {
     notImplemented();
     return 0;
index 1c96b420ddab68b93d3aca1cd0327b6c702bfe87..07c742520cd8aef58c9b6070f9e439f533329d88 100644 (file)
@@ -93,8 +93,8 @@ namespace WebKit {
 
         virtual void print(WebCore::Frame*);
 
-        virtual unsigned long long requestQuotaIncreaseForNewDatabase(WebCore::Frame*, const WebCore::SecurityOriginData&, const WebCore::String&, unsigned long long);
-        virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(WebCore::Frame*, const WebCore::SecurityOriginData&, const WebCore::String&, unsigned long long);
+        virtual unsigned long long requestQuotaIncreaseForNewDatabase(WebCore::Frame*, WebCore::SecurityOrigin*, const WebCore::String&, unsigned long long);
+        virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(WebCore::Frame*, WebCore::SecurityOrigin*, const WebCore::String&, unsigned long long);
 
     private:
         WebKitWebView* m_webView;
index 1df06ada27c25224a61e15ed4c54aa3ceae6c9df..bc6f1c64fe072ce7571de8e28875392fc7cdf975 100644 (file)
@@ -1,3 +1,38 @@
+2008-01-10  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Sam.
+
+        - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+        * Storage/WebDatabaseManager.mm:
+        (-[WebDatabaseManager origins]):
+        (-[WebDatabaseManager databasesWithOrigin:]):
+        (-[WebDatabaseManager detailsForDatabase:withOrigin:]):
+        (-[WebDatabaseManager deleteDatabasesWithOrigin:]):
+        (-[WebDatabaseManager deleteDatabase:withOrigin:]):
+        * Storage/WebDatabaseTrackerClient.h:
+        * Storage/WebDatabaseTrackerClient.mm:
+        (WebDatabaseTrackerClient::dispatchDidModifyOrigin):
+        (WebDatabaseTrackerClient::dispatchDidModifyDatabase):
+        * Storage/WebSecurityOrigin.mm:
+        (-[WebSecurityOrigin initWithProtocol:domain:port:]):
+        (-[WebSecurityOrigin protocol]):
+        (-[WebSecurityOrigin domain]):
+        (-[WebSecurityOrigin port]):
+        (-[WebSecurityOrigin usage]):
+        (-[WebSecurityOrigin quota]):
+        (-[WebSecurityOrigin setQuota:]):
+        (-[WebSecurityOrigin isEqual:]):
+        (-[WebSecurityOrigin dealloc]):
+        (-[WebSecurityOrigin finalize]):
+        (-[WebSecurityOrigin _initWithWebCoreSecurityOrigin:]):
+        (-[WebSecurityOrigin _core]):
+        * Storage/WebSecurityOriginInternal.h:
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::requestQuotaIncreaseForNewDatabase):
+        (WebChromeClient::requestQuotaIncreaseForDatabaseOperation):
+
 2008-01-10  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Anders Carlsson.
index 5a6acbac01f4a791ec0fe4bccda4c2a8f4f1bd69..95cfdb50cb8ddac426a7035e1adcf0d4d69c5c8b 100644 (file)
@@ -57,12 +57,12 @@ NSString *WebDatabaseIdentifierKey = @"WebDatabaseIdentifierKey";
 
 - (NSArray *)origins
 {
-    Vector<WebCoreSecurityOriginData> coreOrigins;
+    Vector<RefPtr<SecurityOrigin> > coreOrigins;
     DatabaseTracker::tracker().origins(coreOrigins);
     NSMutableArray *webOrigins = [[NSMutableArray alloc] initWithCapacity:coreOrigins.size()];
 
     for (unsigned i = 0; i < coreOrigins.size(); ++i) {
-        WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOriginData:&coreOrigins[i]];
+        WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:coreOrigins[i].get()];
         [webOrigins addObject:webOrigin];
         [webOrigin release];
     }
@@ -73,7 +73,7 @@ NSString *WebDatabaseIdentifierKey = @"WebDatabaseIdentifierKey";
 - (NSArray *)databasesWithOrigin:(WebSecurityOrigin *)origin
 {
     Vector<String> nameVector;
-    if (!DatabaseTracker::tracker().databaseNamesForOrigin(*[origin _core], nameVector))
+    if (!DatabaseTracker::tracker().databaseNamesForOrigin([origin _core], nameVector))
         return nil;
     
     NSMutableArray *names = [[NSMutableArray alloc] initWithCapacity:nameVector.size()];
@@ -88,7 +88,7 @@ NSString *WebDatabaseIdentifierKey = @"WebDatabaseIdentifierKey";
 {
     static id keys[3] = {WebDatabaseDisplayNameKey, WebDatabaseExpectedSizeKey, WebDatabaseUsageKey};
     
-    DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseIdentifier, *[origin _core]);
+    DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(databaseIdentifier, [origin _core]);
     if (!details.isValid())
         return nil;
         
@@ -113,12 +113,12 @@ NSString *WebDatabaseIdentifierKey = @"WebDatabaseIdentifierKey";
 
 - (void)deleteDatabasesWithOrigin:(WebSecurityOrigin *)origin
 {
-    DatabaseTracker::tracker().deleteDatabasesWithOrigin(*[origin _core]);
+    DatabaseTracker::tracker().deleteDatabasesWithOrigin([origin _core]);
 }
 
 - (void)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin
 {
-    DatabaseTracker::tracker().deleteDatabase(*[origin _core], databaseIdentifier);
+    DatabaseTracker::tracker().deleteDatabase([origin _core], databaseIdentifier);
 }
 
 @end
index 0e192d07f83cdbc9545b169a24c5b6b97ce2bef3..5db444c77f5413279b0e0d8c9e71814fa4f14638 100644 (file)
  */
 
 #import <WebCore/DatabaseTrackerClient.h>
-#import <WebCore/SecurityOriginData.h>
 
 class WebDatabaseTrackerClient : public WebCore::DatabaseTrackerClient {
 public:
     static WebDatabaseTrackerClient* sharedWebDatabaseTrackerClient();
     
     virtual ~WebDatabaseTrackerClient();
-    virtual void dispatchDidModifyOrigin(const WebCore::SecurityOriginData&);
-    virtual void dispatchDidModifyDatabase(const WebCore::SecurityOriginData&, const WebCore::String& databaseIdentifier);
+    virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*);
+    virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WebCore::String& databaseIdentifier);
 private:
     WebDatabaseTrackerClient();
 };
index 118293e232930eff2585185c11f2190f82755d5c..7a2c8093a51f5e306603d2ff405b773dd266befb 100644 (file)
@@ -32,6 +32,7 @@
 #import "WebSecurityOriginPrivate.h"
 #import "WebSecurityOriginInternal.h"
 #import <wtf/RetainPtr.h>
+#import <WebCore/SecurityOrigin.h>
 
 using namespace WebCore;
 
@@ -49,17 +50,17 @@ WebDatabaseTrackerClient::~WebDatabaseTrackerClient()
 {
 }
     
-void WebDatabaseTrackerClient::dispatchDidModifyOrigin(const SecurityOriginData& origin)
+void WebDatabaseTrackerClient::dispatchDidModifyOrigin(SecurityOrigin* origin)
 {
-     RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOriginData:&origin]);
+     RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]);
 
     [[NSNotificationCenter defaultCenter] postNotificationName:WebDatabaseDidModifyOriginNotification 
                                                         object:webSecurityOrigin.get()];
 }
 
-void WebDatabaseTrackerClient::dispatchDidModifyDatabase(const SecurityOriginData& origin, const String& databaseIdentifier)
+void WebDatabaseTrackerClient::dispatchDidModifyDatabase(SecurityOrigin* origin, const String& databaseIdentifier)
 {
-    RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOriginData:&origin]);
+    RetainPtr<WebSecurityOrigin> webSecurityOrigin(AdoptNS, [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin]);
     RetainPtr<NSDictionary> userInfo(AdoptNS, [[NSDictionary alloc] 
                                                initWithObjectsAndKeys:(NSString *)databaseIdentifier, WebDatabaseIdentifierKey, nil]);
     
index d7ffdb003564787a564a54782e6d5a10d774cc87..c980744abe44707239c1a3cf9060fa3a93b7abbb 100644 (file)
@@ -30,7 +30,7 @@
 #import "WebSecurityOriginInternal.h"
 
 #import <WebCore/DatabaseTracker.h>
-#import <WebCore/SecurityOriginData.h>
+#import <WebCore/SecurityOrigin.h>
 
 using namespace WebCore;
 
@@ -47,35 +47,36 @@ using namespace WebCore;
     if (!self)
         return nil;
     
-    WebCoreSecurityOriginData *originData = new WebCoreSecurityOriginData(protocol, domain, port);  
-    _private = reinterpret_cast<WebSecurityOriginPrivate*>(originData);
+    RefPtr<SecurityOrigin> origin = SecurityOrigin::create(protocol, domain, port, 0);
+    origin->ref();
+    _private = reinterpret_cast<WebSecurityOriginPrivate*>(origin.get());
 
     return self;
 }
 
 - (NSString*)protocol
 {
-    return reinterpret_cast<WebCoreSecurityOriginData*>(_private)->protocol();
+    return reinterpret_cast<SecurityOrigin*>(_private)->protocol();
 }
 
 - (NSString*)domain
 {
-    return reinterpret_cast<WebCoreSecurityOriginData*>(_private)->host();
+    return reinterpret_cast<SecurityOrigin*>(_private)->host();
 }
 
 - (unsigned short)port
 {
-    return reinterpret_cast<WebCoreSecurityOriginData*>(_private)->port();
+    return reinterpret_cast<SecurityOrigin*>(_private)->port();
 }
 
 - (unsigned long long)usage
 {
-    return DatabaseTracker::tracker().usageForOrigin(*reinterpret_cast<WebCoreSecurityOriginData*>(_private));
+    return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
 }
 
 - (unsigned long long)quota
 {
-    return DatabaseTracker::tracker().quotaForOrigin(*reinterpret_cast<WebCoreSecurityOriginData*>(_private));
+    return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private));
 }
 
 // Sets the storage quota (in bytes)
@@ -83,7 +84,7 @@ using namespace WebCore;
 // This will simply prevent new data from being added to databases in that origin
 - (void)setQuota:(unsigned long long)quota
 {
-    DatabaseTracker::tracker().setQuota(*reinterpret_cast<WebCoreSecurityOriginData*>(_private), quota);
+    DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota);
 }
 
 - (BOOL)isEqual:(id)anObject
@@ -92,18 +93,20 @@ using namespace WebCore;
         return NO;
     }
     
-    return *[self _core] == *[anObject _core];
+    return [self _core]->equal([anObject _core]);
 }
 
 - (void)dealloc
 {
-    delete reinterpret_cast<WebCoreSecurityOriginData*>(_private);
+    if (_private)
+        reinterpret_cast<SecurityOrigin*>(_private)->deref();
     [super dealloc];
 }
 
 - (void)finalize
 {
-    delete reinterpret_cast<WebCoreSecurityOriginData*>(_private);
+    if (_private)
+        reinterpret_cast<SecurityOrigin*>(_private)->deref();
     [super finalize];
 }
 
@@ -111,22 +114,22 @@ using namespace WebCore;
 
 @implementation WebSecurityOrigin (WebInternal)
 
-- (id)_initWithWebCoreSecurityOriginData:(const WebCoreSecurityOriginData *)securityOriginData
+- (id)_initWithWebCoreSecurityOrigin:(SecurityOrigin*)origin
 {
-    ASSERT(securityOriginData);
+    ASSERT(origin);
     self = [super init];
     if (!self)
         return nil;
 
-    WebCoreSecurityOriginData *originData = new WebCoreSecurityOriginData(*securityOriginData);  
-    _private = reinterpret_cast<WebSecurityOriginPrivate*>(originData);
+    origin->ref();
+    _private = reinterpret_cast<WebSecurityOriginPrivate*>(origin);
 
     return self;
 }
 
-- (WebCoreSecurityOriginData *)_core
+- (SecurityOrigin *)_core
 {
-    return reinterpret_cast<WebCoreSecurityOriginData*>(_private);
+    return reinterpret_cast<SecurityOrigin*>(_private);
 }
 
 @end
index c721d12b09b8f4a1dc87d30157df77bbec60220d..d60f52b596a72475949818df6a945533db1cedca 100644 (file)
  */
 
 namespace WebCore {
-    class SecurityOriginData;
+    class SecurityOrigin;
 }
 
-typedef WebCore::SecurityOriginData WebCoreSecurityOriginData;
+typedef WebCore::SecurityOrigin WebCoreSecurityOrigin;
 
 @interface WebSecurityOrigin (WebInternal)
 
-- (id)_initWithWebCoreSecurityOriginData:(const WebCoreSecurityOriginData *)securityOriginData;
-- (WebCoreSecurityOriginData *)_core;
+- (id)_initWithWebCoreSecurityOrigin:(WebCoreSecurityOrigin *)origin;
+- (WebCoreSecurityOrigin *)_core;
 
 @end
index 41de8053d90d2a8807a0864d71b645e5da8392fa..eca17c628f4defd5a1c5d200826a56b3bddc5a13 100644 (file)
@@ -100,8 +100,8 @@ public:
 
     virtual void print(WebCore::Frame*);
 
-    virtual unsigned long long requestQuotaIncreaseForNewDatabase(WebCore::Frame*, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseDisplayName, unsigned long long estimatedSize);
-    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(WebCore::Frame*, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseIdentifier, unsigned long long proposedNewQuota);
+    virtual unsigned long long requestQuotaIncreaseForNewDatabase(WebCore::Frame*, WebCore::SecurityOrigin* origin, const WebCore::String& databaseDisplayName, unsigned long long estimatedSize);
+    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(WebCore::Frame*, WebCore::SecurityOrigin* origin, const WebCore::String& databaseIdentifier, unsigned long long proposedNewQuota);
 
 private:
     WebView *m_webView;
index f871b6498aca7fd0c929238e477bd6537faf693c..7f304582dc1965c078b046c8eee07f9d4e638bf6 100644 (file)
@@ -412,17 +412,17 @@ void WebChromeClient::print(Frame* frame)
     CallUIDelegate(m_webView, @selector(webView:printFrameView:), frameView);
 }
 
-unsigned long long WebChromeClient::requestQuotaIncreaseForNewDatabase(WebCore::Frame* frame, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseDisplayName, unsigned long long estimatedSize)
+unsigned long long WebChromeClient::requestQuotaIncreaseForNewDatabase(WebCore::Frame* frame, WebCore::SecurityOrigin* origin, const WebCore::String& databaseDisplayName, unsigned long long estimatedSize)
 {
-    WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOriginData:reinterpret_cast<const WebCoreSecurityOriginData*>(&origin)];
+    WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin];
     unsigned long long result = CallUIDelegateReturningUnsignedLongLong(m_webView, @selector(webView:frame:quotaForSecurityOrigin:toCreateDatabase:withEstimatedSize:), kit(frame), webOrigin, (NSString *)databaseDisplayName, estimatedSize);
     [webOrigin release];
     return result;
 }
 
-unsigned long long WebChromeClient::requestQuotaIncreaseForDatabaseOperation(WebCore::Frame* frame, const WebCore::SecurityOriginData& origin, const WebCore::String& databaseIdentifier, unsigned long long proposedNewQuota)
+unsigned long long WebChromeClient::requestQuotaIncreaseForDatabaseOperation(WebCore::Frame* frame, WebCore::SecurityOrigin* origin, const WebCore::String& databaseIdentifier, unsigned long long proposedNewQuota)
 {
-    WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOriginData:reinterpret_cast<const WebCoreSecurityOriginData*>(&origin)];
+    WebSecurityOrigin *webOrigin = [[WebSecurityOrigin alloc] _initWithWebCoreSecurityOrigin:origin];
     unsigned long long result = CallUIDelegateReturningUnsignedLongLong(m_webView, @selector(webView:frame:quotaForSecurityOrigin:fromProposedQuota:database:), kit(frame), webOrigin, proposedNewQuota, (NSString *)databaseIdentifier);
     [webOrigin release];
     return result;
index 68b527e296dfb2addcf986f16b28c06111688570..57cb4cf36ee3d9e8ac845783140d48e15d3a41ff 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-10  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Sam.
+
+        - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+        * WebCoreSupport/ChromeClientQt.cpp:
+        (WebCore::ChromeClientQt::requestQuotaIncreaseForNewDatabase):
+        (WebCore::ChromeClientQt::requestQuotaIncreaseForDatabaseOperation):
+        * WebCoreSupport/ChromeClientQt.h:
+
 2008-01-10  Lars Knoll  <lars@trolltech.com>
 
         Reviewed by Simon.
index 13fc3c70cf68d8497b275c4d53611ede804f8f01..4af98156091d78e7cc7ba2837b2ddc93f4fb2659 100644 (file)
@@ -335,13 +335,13 @@ void ChromeClientQt::print(Frame*)
     notImplemented();
 }
 
-unsigned long long ChromeClientQt::requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData&, const String&, unsigned long long)
+unsigned long long ChromeClientQt::requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin*, const String&, unsigned long long)
 {
     notImplemented();
     return 0;
 }
 
-unsigned long long ChromeClientQt::requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData&, const String&, unsigned long long)
+unsigned long long ChromeClientQt::requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin*, const String&, unsigned long long)
 {
     notImplemented();
     return 0;
index aa49cdc52d9f9b5f216398456367e43306788d63..9b795f41d8aee63a9e3c2307f471aad3a9023559 100644 (file)
@@ -107,8 +107,8 @@ namespace WebCore {
 
         virtual void print(Frame*);
 
-        virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData&, const String&, unsigned long long);
-        virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData&, const String&, unsigned long long);
+        virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin*, const String&, unsigned long long);
+        virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin*, const String&, unsigned long long);
 
         QWebPage* m_webPage;
     };
index d2776144c6789ad2ffd1759a9b204c1134312b3f..db2e611f46fa6931bb012da69f15cdf1b83fbc7c 100644 (file)
@@ -1,3 +1,33 @@
+2008-01-10  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Sam.
+
+        - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+        * WebChromeClient.cpp:
+        (WebChromeClient::requestQuotaIncreaseForNewDatabase):
+        (WebChromeClient::requestQuotaIncreaseForDatabaseOperation):
+        * WebChromeClient.h:
+        * WebDatabaseManager.cpp:
+        (WebDatabaseManager::origins):
+        (WebDatabaseManager::databasesWithOrigin):
+        (WebDatabaseManager::detailsForDatabaseWithOrigin):
+        (WebDatabaseManager::deleteDatabasesWithOrigin):
+        (WebDatabaseManager::deleteDatabaseWithOrigin):
+        (WebDatabaseManager::dispatchDidModifyOrigin):
+        (WebDatabaseManager::dispatchDidModifyDatabase):
+        * WebDatabaseManager.h:
+        * WebSecurityOrigin.cpp:
+        (WebSecurityOrigin::createInstance):
+        (WebSecurityOrigin::WebSecurityOrigin):
+        (WebSecurityOrigin::protocol):
+        (WebSecurityOrigin::domain):
+        (WebSecurityOrigin::port):
+        (WebSecurityOrigin::usage):
+        (WebSecurityOrigin::quota):
+        (WebSecurityOrigin::setQuota):
+        * WebSecurityOrigin.h:
+
 2008-01-10  David Kilzer  <ddkilzer@apple.com>
 
         dftables should be rewritten as a script
index b1d3049e43c46a44f580b77f193ba3c00a29c518..a44d26485c79143c5b44ffbde31d2c19d3cf7127 100644 (file)
@@ -457,9 +457,9 @@ void WebChromeClient::print(Frame* frame)
             uiDelegate2->printFrame(m_webView, kit(frame));
 }
 
-unsigned long long WebChromeClient::requestQuotaIncreaseForNewDatabase(Frame* frame, const SecurityOriginData& originData, const String& databaseDisplayName, unsigned long long estimatedSize)
+unsigned long long WebChromeClient::requestQuotaIncreaseForNewDatabase(Frame* frame, SecurityOrigin* origin, const String& databaseDisplayName, unsigned long long estimatedSize)
 {
-    COMPtr<WebSecurityOrigin> webOrigin(AdoptCOM, WebSecurityOrigin::createInstance(originData));
+    COMPtr<WebSecurityOrigin> webOrigin(AdoptCOM, WebSecurityOrigin::createInstance(origin));
     unsigned long long result = 0;
     COMPtr<IWebUIDelegate> uiDelegate;
     if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
@@ -473,9 +473,9 @@ unsigned long long WebChromeClient::requestQuotaIncreaseForNewDatabase(Frame* fr
     return result;
 }
 
-unsigned long long WebChromeClient::requestQuotaIncreaseForDatabaseOperation(Frame* frame, const SecurityOriginData& originData, const String& databaseIdentifier, unsigned long long proposedNewQuota)
+unsigned long long WebChromeClient::requestQuotaIncreaseForDatabaseOperation(Frame* frame, SecurityOrigin* origin, const String& databaseIdentifier, unsigned long long proposedNewQuota)
 {
-    COMPtr<WebSecurityOrigin> webOrigin(AdoptCOM, WebSecurityOrigin::createInstance(originData));
+    COMPtr<WebSecurityOrigin> webOrigin(AdoptCOM, WebSecurityOrigin::createInstance(origin));
     unsigned long long result = 0;
     COMPtr<IWebUIDelegate> uiDelegate;
     if (SUCCEEDED(m_webView->uiDelegate(&uiDelegate))) {
index 7fe7798c00900d666d981aadcb279fccedc38277..693821b89caaecdebb3c57db801a01f4910d6e4f 100644 (file)
@@ -98,8 +98,8 @@ public:
 
     virtual void print(WebCore::Frame*);
 
-    virtual unsigned long long requestQuotaIncreaseForNewDatabase(WebCore::Frame*, const WebCore::SecurityOriginData&, const WebCore::String&, unsigned long long);
-    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(WebCore::Frame*, const WebCore::SecurityOriginData&, const WebCore::String&, unsigned long long);
+    virtual unsigned long long requestQuotaIncreaseForNewDatabase(WebCore::Frame*, WebCore::SecurityOrigin*, const WebCore::String&, unsigned long long);
+    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(WebCore::Frame*, WebCore::SecurityOrigin*, const WebCore::String&, unsigned long long);
 
     virtual WebView* webView() const { return m_webView; }
 
index b535b1258a78c8694fd283ff60d69cf8b781e5b7..5616d96ae71a1f209a9606353dfa5a07b4e84734 100644 (file)
@@ -39,7 +39,7 @@
 #include <WebCore/COMPtr.h>\r
 #include <WebCore/DatabaseTracker.h>\r
 #include <WebCore/FileSystem.h>\r
-#include <WebCore/SecurityOriginData.h>\r
+#include <WebCore/SecurityOrigin.h>\r
 \r
 using namespace WebCore;\r
 \r
@@ -187,7 +187,7 @@ ULONG STDMETHODCALLTYPE WebDatabaseManager::Release()
     return newRef;\r
 }\r
 \r
-template<> struct COMVariantSetter<SecurityOriginData> : COMIUnknownVariantSetter<WebSecurityOrigin, SecurityOriginData> {};\r
+template<> struct COMVariantSetter<SecurityOrigin*> : COMIUnknownVariantSetter<WebSecurityOrigin, SecurityOrigin*> {};\r
 \r
 // IWebDatabaseManager -------------------------------------------------------------\r
 HRESULT STDMETHODCALLTYPE WebDatabaseManager::sharedWebDatabaseManager( \r
@@ -212,9 +212,9 @@ HRESULT STDMETHODCALLTYPE WebDatabaseManager::origins(
     if (this != s_sharedWebDatabaseManager)\r
         return E_FAIL;\r
 \r
-    Vector<SecurityOriginData> origins;\r
+    Vector<RefPtr<SecurityOrigin> > origins;\r
     DatabaseTracker::tracker().origins(origins);\r
-    COMPtr<COMEnumVariant<Vector<SecurityOriginData> > > enumVariant(AdoptCOM, COMEnumVariant<Vector<SecurityOriginData> >::adopt(origins));\r
+        COMPtr<COMEnumVariant<Vector<RefPtr<SecurityOrigin> > > > enumVariant(AdoptCOM, COMEnumVariant<Vector<RefPtr<SecurityOrigin> > >::adopt(origins));\r
 \r
     *result = enumVariant.releaseRef();\r
     return S_OK;\r
@@ -237,7 +237,7 @@ HRESULT STDMETHODCALLTYPE WebDatabaseManager::databasesWithOrigin(
         return E_FAIL;\r
 \r
     Vector<String> databaseNames;\r
-    DatabaseTracker::tracker().databaseNamesForOrigin(webSecurityOrigin->securityOriginData(), databaseNames);\r
+    DatabaseTracker::tracker().databaseNamesForOrigin(webSecurityOrigin->securityOrigi(), databaseNames);\r
 \r
     COMPtr<COMEnumVariant<Vector<String> > > enumVariant(AdoptCOM, COMEnumVariant<Vector<String> >::adopt(databaseNames));\r
 \r
@@ -263,7 +263,7 @@ HRESULT STDMETHODCALLTYPE WebDatabaseManager::detailsForDatabaseWithOrigin(
         return E_FAIL;\r
 \r
     DatabaseDetails details = DatabaseTracker::tracker().detailsForNameAndOrigin(String(databaseName, SysStringLen(databaseName)),\r
-        webSecurityOrigin->securityOriginData());\r
+        webSecurityOrigin->securityOrigin());\r
 \r
     if (!details.isValid())\r
         return E_INVALIDARG;\r
@@ -295,7 +295,7 @@ HRESULT STDMETHODCALLTYPE WebDatabaseManager::deleteDatabasesWithOrigin(
     if (!webSecurityOrigin)\r
         return E_FAIL;\r
 \r
-    DatabaseTracker::tracker().deleteDatabasesWithOrigin(webSecurityOrigin->securityOriginData());\r
+    DatabaseTracker::tracker().deleteDatabasesWithOrigin(webSecurityOrigin->securityOrigin());\r
 \r
     return S_OK;\r
 }\r
@@ -317,12 +317,12 @@ HRESULT STDMETHODCALLTYPE WebDatabaseManager::deleteDatabaseWithOrigin(
     if (!webSecurityOrigin)\r
         return E_FAIL;\r
 \r
-    DatabaseTracker::tracker().deleteDatabase(webSecurityOrigin->securityOriginData(), String(databaseName, SysStringLen(databaseName)));\r
+    DatabaseTracker::tracker().deleteDatabase(webSecurityOrigin->securityOrigin(), String(databaseName, SysStringLen(databaseName)));\r
 \r
     return S_OK;\r
 }\r
 \r
-void WebDatabaseManager::dispatchDidModifyOrigin(const SecurityOriginData& origin)
+void WebDatabaseManager::dispatchDidModifyOrigin(SecurityOrigin* origin)
 {
     static BSTR databaseDidModifyOriginName = SysAllocString(WebDatabaseDidModifyOriginNotification);
     IWebNotificationCenter* notifyCenter = WebNotificationCenter::defaultCenterInternal();
@@ -331,7 +331,7 @@ void WebDatabaseManager::dispatchDidModifyOrigin(const SecurityOriginData& origi
     notifyCenter->postNotificationName(databaseDidModifyOriginName, securityOrigin.get(), 0);
 }
 
-void WebDatabaseManager::dispatchDidModifyDatabase(const SecurityOriginData& origin, const String& databaseName)
+void WebDatabaseManager::dispatchDidModifyDatabase(SecurityOrigin* origin, const String& databaseName)
 {
     static BSTR databaseDidModifyOriginName = SysAllocString(WebDatabaseDidModifyDatabaseNotification);
     IWebNotificationCenter* notifyCenter = WebNotificationCenter::defaultCenterInternal();
index 243e774d7bf65de44f3ab8cc8e11bb67c119e0af..60a3654974c4eccfab1800a979f3655ff4f684ef 100644 (file)
@@ -71,8 +71,8 @@ public:
         /* [in] */ IWebSecurityOrigin* origin);\r
 \r
     // DatabaseTrackerClient\r
-    virtual void dispatchDidModifyOrigin(const WebCore::SecurityOriginData&);
-    virtual void dispatchDidModifyDatabase(const WebCore::SecurityOriginData&, const WebCore::String& databaseName);
+    virtual void dispatchDidModifyOrigin(WebCore::SecurityOrigin*);
+    virtual void dispatchDidModifyDatabase(WebCore::SecurityOrigin*, const WebCore::String& databaseName);
 \r
 private:\r
     WebDatabaseManager();\r
index 3c3d05299edf3e476e8c3c0be2f63e6e270a4a0d..bb9267d227a937a905ae0eb2775e46728aa16eb1 100644 (file)
 using namespace WebCore;\r
 \r
 // WebSecurityOrigin ---------------------------------------------------------------\r
-WebSecurityOrigin* WebSecurityOrigin::createInstance(const SecurityOriginData& securityOriginData)\r
+WebSecurityOrigin* WebSecurityOrigin::createInstance(SecurityOrigin* securityOrigin)\r
 {\r
-    WebSecurityOrigin* origin = new WebSecurityOrigin(securityOriginData);\r
+    WebSecurityOrigin* origin = new WebSecurityOrigin(securityOrigin);\r
     origin->AddRef();\r
     return origin;\r
 }\r
 \r
-WebSecurityOrigin::WebSecurityOrigin(const SecurityOriginData& securityOriginData)\r
+WebSecurityOrigin::WebSecurityOrigin(SecurityOrigin* securityOrigin)\r
     : m_refCount(0)\r
-    , m_securityOriginData(securityOriginData)\r
+    , m_securityOrigin(securityOrigin)\r
 {\r
     gClassCount++;\r
 }\r
@@ -94,7 +94,7 @@ HRESULT STDMETHODCALLTYPE WebSecurityOrigin::protocol(
     if (!result)\r
         return E_POINTER;\r
 \r
-    *result = BString(m_securityOriginData.protocol()).release();\r
+    *result = BString(m_securityOrigin->protocol()).release();\r
 \r
     return S_OK;\r
 }\r
@@ -105,7 +105,7 @@ HRESULT STDMETHODCALLTYPE WebSecurityOrigin::domain(
     if (!result)\r
         return E_POINTER;\r
 \r
-    *result = BString(m_securityOriginData.host()).release();\r
+    *result = BString(m_securityOrigin->host()).release();\r
 \r
     return S_OK;\r
 }\r
@@ -116,7 +116,7 @@ HRESULT STDMETHODCALLTYPE WebSecurityOrigin::port(
     if (!result)\r
         return E_POINTER;\r
 \r
-    *result = m_securityOriginData.port();\r
+    *result = m_securityOrigin->port();\r
 \r
     return S_OK;\r
 }\r
@@ -127,7 +127,7 @@ HRESULT STDMETHODCALLTYPE WebSecurityOrigin::usage(
     if (!result)\r
         return E_POINTER;\r
 \r
-    *result = DatabaseTracker::tracker().usageForOrigin(m_securityOriginData);\r
+    *result = DatabaseTracker::tracker().usageForOrigin(m_securityOrigin.get());\r
 \r
     return S_OK;\r
 }\r
@@ -138,14 +138,14 @@ HRESULT STDMETHODCALLTYPE WebSecurityOrigin::quota(
     if (!result)\r
         return E_POINTER;\r
 \r
-    *result = DatabaseTracker::tracker().quotaForOrigin(m_securityOriginData);\r
+    *result = DatabaseTracker::tracker().quotaForOrigin(m_securityOrigin.get());\r
     return S_OK;\r
 }\r
         \r
 HRESULT STDMETHODCALLTYPE WebSecurityOrigin::setQuota( \r
     /* [in] */ unsigned long long quota) \r
 {\r
-    DatabaseTracker::tracker().setQuota(m_securityOriginData, quota);\r
+    DatabaseTracker::tracker().setQuota(m_securityOrigin.get(), quota);\r
 \r
     return S_OK;\r
 }\r
index b07dc7639169e5c64f4e2cd94d42324784c9167e..46b07c63517305e102fa6c3da9d0657553f92176 100644 (file)
 #define WebSecurityOrigin_h\r
 \r
 #include "IWebSecurityOrigin.h"\r
-#include <WebCore/SecurityOriginData.h>\r
+#include <WebCore/SecurityOrigin.h>\r
 \r
 class DECLSPEC_UUID("6EB8D98F-2723-4472-88D3-5936F9D6E631") WebSecurityOrigin : public IWebSecurityOrigin {\r
 public:\r
     // WebSecurityOrigin\r
-    static WebSecurityOrigin* createInstance(const WebCore::SecurityOriginData& securityOriginData);\r
-    const WebCore::SecurityOriginData& securityOriginData() const { return m_securityOriginData; }\r
+    static WebSecurityOrigin* createInstance(WebCore::SecurityOrigin* origin);\r
+    const WebCore::SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }\r
 \r
     // IUnknown\r
     virtual HRESULT STDMETHODCALLTYPE QueryInterface( \r
@@ -66,11 +66,11 @@ public:
     virtual HRESULT STDMETHODCALLTYPE setQuota( \r
         /* [in] */ unsigned long long quota);\r
 private:\r
-    WebSecurityOrigin(const WebCore::SecurityOriginData&);\r
+    WebSecurityOrigin(WebCore::SecurityOrigin*);\r
     ~WebSecurityOrigin();\r
 \r
     ULONG m_refCount;\r
-    WebCore::SecurityOriginData m_securityOriginData;\r
+    RefPtr<WebCore::SecurityOrigin> m_securityOrigin;\r
 };\r
 \r
 #endif // WebSecurityOrigin_h\r
index 489a37fbbfd86c1154ed05099e89ad0c6dcd0f9b..7fb67ebbf435e7c47344908c3e831ca655d7cbed 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-10  Maciej Stachowiak  <mjs@apple.com>
+
+        Reviewed by Sam.
+
+        - remove SecurityOriginData and fold its functionality into SecurityOrigin
+
+        * WebKitSupport/ChromeClientWx.cpp:
+        (WebCore::ChromeClientWx::requestQuotaIncreaseForNewDatabase):
+        (WebCore::ChromeClientWx::requestQuotaIncreaseForDatabaseOperation):
+        * WebKitSupport/ChromeClientWx.h:
+
 2007-12-16  Darin Adler  <darin@apple.com>
 
         - try to fix the build
index a528ac666a415a9ee088cc4e726cab0e4e40ad2d..e858a1ec48afd7621026e198eb5e350f88d0483b 100644 (file)
@@ -302,13 +302,13 @@ void ChromeClientWx::print(Frame*)
     notImplemented();
 }
 
-unsigned long long ChromeClientWx::requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData&, const String&, unsigned long long)
+unsigned long long ChromeClientWx::requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin*, const String&, unsigned long long)
 {
     notImplemented();
     return 0;
 }
 
-unsigned long long ChromeClientWx::requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData&, const String&, unsigned long long)
+unsigned long long ChromeClientWx::requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin*, const String&, unsigned long long)
 {
     notImplemented();
     return 0;
index 596d92562c67d407f7d04845573d225975baa1ba..6447d070d25dfed17cfdb56f40d844570a496bdd 100644 (file)
@@ -103,8 +103,8 @@ public:
 
     virtual void print(Frame*);
 
-    virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, const SecurityOriginData&, const String&, unsigned long long);
-    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, const SecurityOriginData&, const String&, unsigned long long);    
+    virtual unsigned long long requestQuotaIncreaseForNewDatabase(Frame*, SecurityOrigin*, const String&, unsigned long long);
+    virtual unsigned long long requestQuotaIncreaseForDatabaseOperation(Frame*, SecurityOrigin*, const String&, unsigned long long);    
 };
 
 }