-2007-11-15 Jon Honeycutt <jhoneycutt@apple.com>
+2007-11-15 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John and Sam
+
+ Stubbing out everything required for a WebKit API for databases
+
+ Biggest change in WebCore is that we passed around SecurityOriginData as the representation
+ of a SecurityOrigin, instead of a String or a SecurityOrigin itself (which is an opaque object
+ that has a different purpose besides just hanging on to the data)
+
+ * WebCore.base.exp:
+ * WebCore.xcodeproj/project.pbxproj:
+
+ * platform/SecurityOrigin.cpp:
+ * platform/SecurityOrigin.h:
+ * platform/SecurityOriginData.h: Added. Simple object to encapsulate the 3
+ pieces of data in the SecurityOrigin tuple
+ (WebCore::SecurityOriginData::SecurityOriginData):
+ (WebCore::SecurityOriginData::protocol):
+ (WebCore::SecurityOriginData::host):
+ (WebCore::SecurityOriginData::port):
+ (WebCore::SecurityOriginData::toString): Simple concatenation of the 3 components,
+ colon separated
+
+ * storage/Database.cpp:
+ (WebCore::Database::Database): Use SecurityOriginData instead
+
+ * storage/DatabaseTracker.cpp:
+ (WebCore::DatabaseTracker::fullPathForDatabase):
+ (WebCore::DatabaseTracker::databaseNamesForOrigin):
+ (WebCore::DatabaseTracker::deleteDatabasesWithOrigin):
+ (WebCore::DatabaseTracker::deleteDatabase):
+ * storage/DatabaseTracker.h:
+
+ * storage/DatabaseTrackerClient.h: Added. For dispatching notifications up to WebKit
+ (WebCore::DatabaseTrackerClient::~DatabaseTrackerClient):2007-11-15 Jon Honeycutt <jhoneycutt@apple.com>
Reviewed by Anders.
__ZN7WebCore12EventHandler20sendContextMenuEventERKNS_18PlatformMouseEventE
__ZN7WebCore12EventHandler27capsLockStateMayHaveChangedEv
__ZN7WebCore12EventHandler7mouseUpEP7NSEvent
-__ZN7WebCore12EventHandler8keyEventERKNS_21PlatformKeyboardEventE
__ZN7WebCore12EventHandler8keyEventEP7NSEvent
+__ZN7WebCore12EventHandler8keyEventERKNS_21PlatformKeyboardEventE
__ZN7WebCore12EventHandler9mouseDownEP7NSEvent
__ZN7WebCore12IconDatabase10setEnabledEb
__ZN7WebCore12IconDatabase11defaultIconERKNS_7IntSizeE
__ZN7WebCore15BackForwardListC1EPNS_4PageE
__ZN7WebCore15BackForwardListD1Ev
__ZN7WebCore15ContextMenuItem26releasePlatformDescriptionEv
-__ZN7WebCore15DatabaseTracker14deleteDatabaseERKNS_6StringES3_
+__ZN7WebCore15DatabaseTracker14deleteDatabaseERKNS_18SecurityOriginDataERKNS_6StringE
__ZN7WebCore15DatabaseTracker15setDatabasePathERKNS_6StringE
__ZN7WebCore15DatabaseTracker18deleteAllDatabasesEv
-__ZN7WebCore15DatabaseTracker22databaseNamesForOriginERKNS_6StringERN3WTF6VectorIS1_Lm0EEE
-__ZN7WebCore15DatabaseTracker27deleteAllDatabasesForOriginERKNS_6StringE
+__ZN7WebCore15DatabaseTracker25deleteDatabasesWithOriginERKNS_18SecurityOriginDataE
__ZN7WebCore15DatabaseTracker7originsEv
__ZN7WebCore15DatabaseTracker7trackerEv
+__ZN7WebCore15DatabaseTracker9setClientEPNS_21DatabaseTrackerClientE
__ZN7WebCore15FocusController15setFocusedFrameEN3WTF10PassRefPtrINS_5FrameEEE
__ZN7WebCore15FocusController15setInitialFocusENS_14FocusDirectionEPNS_13KeyboardEventE
__ZN7WebCore15FocusController18focusedOrMainFrameEv
__ZN7WebCore20JavaScriptStatistics21shouldPrintExceptionsEv
__ZN7WebCore20JavaScriptStatistics24setShouldPrintExceptionsEb
__ZN7WebCore20JavaScriptStatistics31garbageCollectOnAlternateThreadEb
+__ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
__ZN7WebCore21ContextMenuController16clearContextMenuEv
__ZN7WebCore21PlatformKeyboardEventC1EP7NSEventb
__ZN7WebCore21WindowsLatin1EncodingEv
__ZNK7WebCore16DeprecatedString3midEjj
__ZNK7WebCore16DeprecatedString8endsWithERKS0_
__ZNK7WebCore16ResourceResponse13nsURLResponseEv
+__ZNK7WebCore19ResourceRequestBase3urlEv
+__ZNK7WebCore19ResourceRequestBase7isEmptyEv
+__ZNK7WebCore19SelectionController17isInPasswordFieldEv
__ZNK7WebCore20ResourceResponseBase14httpStatusCodeEv
__ZNK7WebCore20ResourceResponseBase16httpHeaderFieldsEv
+__ZNK7WebCore20ResourceResponseBase16httpHeaderFieldsEv
__ZNK7WebCore20ResourceResponseBase16textEncodingNameEv
__ZNK7WebCore20ResourceResponseBase17suggestedFilenameEv
-__ZN7WebCore20ResourceResponseBase24setExpectedContentLengthEx
__ZNK7WebCore20ResourceResponseBase3urlEv
__ZNK7WebCore20ResourceResponseBase8mimeTypeEv
-__ZNK7WebCore20ResourceResponseBase16httpHeaderFieldsEv
-__ZNK7WebCore19ResourceRequestBase3urlEv
-__ZNK7WebCore19ResourceRequestBase7isEmptyEv
-__ZNK7WebCore19SelectionController17isInPasswordFieldEv
__ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
__ZNK7WebCore4Font11primaryFontEv
__ZNK7WebCore4KURL17lastPathComponentEv
5101846A0B08602A004A825F /* CachedPage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510184680B08602A004A825F /* CachedPage.cpp */; };
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 */; };
51EC92680CE90DD400F90308 /* JSCustomSQLTransactionCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EC92600CE90DD400F90308 /* JSCustomSQLTransactionCallback.h */; };
51EC92690CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51EC92610CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.cpp */; };
51EC926A0CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 51EC92620CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.h */; };
+ 51FAFE340CECBF2D00BB3F24 /* DatabaseTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FAFE330CECBF2D00BB3F24 /* DatabaseTrackerClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
650F53DC09D15DDA00C9B0C8 /* CSSGrammar.h in Headers */ = {isa = PBXBuildFile; fileRef = 650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */; };
510184680B08602A004A825F /* CachedPage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedPage.cpp; 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>"; };
51EC92620CE90DD400F90308 /* JSCustomSQLTransactionErrorCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomSQLTransactionErrorCallback.h; sourceTree = "<group>"; };
51F6A3D50663BF04004D2919 /* HTMLCanvasElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLCanvasElement.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLCanvasElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 51FAFE330CECBF2D00BB3F24 /* DatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseTrackerClient.h; sourceTree = "<group>"; };
550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
55998A5A052B59CC0017A6C1 /* WebCoreAXObject.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreAXObject.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
519611620CAC56570010A80C /* DatabaseThread.h */,
1AD51A130CB59CD300953D11 /* DatabaseTracker.cpp */,
1AD51A120CB59CD300953D11 /* DatabaseTracker.h */,
+ 51FAFE330CECBF2D00BB3F24 /* DatabaseTrackerClient.h */,
51EC92570CE90DB400F90308 /* SQLError.h */,
51EC92580CE90DB400F90308 /* SQLError.idl */,
519611670CAC56570010A80C /* SQLResultSet.cpp */,
AB7170880B3118080017123E /* SearchPopupMenu.h */,
BC014C720CC5579D009C4B20 /* SecurityOrigin.cpp */,
BC014C730CC5579D009C4B20 /* SecurityOrigin.h */,
+ 512F2F440CEC3516006537E3 /* SecurityOriginData.h */,
BCFB2F3F097A24B500BA703D /* SegmentedString.cpp */,
BCFB2F40097A24B500BA703D /* SegmentedString.h */,
1A4A954B0B4EDCCB002D8C3C /* SharedBuffer.cpp */,
519611EA0CAC749C0010A80C /* DatabaseTask.h in Headers */,
519611780CAC56A80010A80C /* DatabaseThread.h in Headers */,
1AD51A140CB59CD300953D11 /* DatabaseTracker.h in Headers */,
+ 51FAFE340CECBF2D00BB3F24 /* DatabaseTrackerClient.h in Headers */,
1C4C8F660AD8655D009475CE /* DeleteButton.h in Headers */,
1C4C8F020AD85D87009475CE /* DeleteButtonController.h in Headers */,
93309DDF099E64920056E581 /* DeleteFromTextNodeCommand.h in Headers */,
BC6D6E2609AF943500F59759 /* ScrollView.h in Headers */,
AB7170890B3118080017123E /* SearchPopupMenu.h in Headers */,
BC014C750CC5579D009C4B20 /* SecurityOrigin.h in Headers */,
+ 512F2F450CEC3516006537E3 /* SecurityOriginData.h in Headers */,
BCFB2F42097A24B500BA703D /* SegmentedString.h in Headers */,
93309E0C099E64920056E581 /* Selection.h in Headers */,
93309E0E099E64920056E581 /* SelectionController.h in Headers */,
9305B24D098F1B6B00C28855 /* Timer.h in Headers */,
BCCFBAE80B5152ED0001F1D7 /* Tokenizer.h in Headers */,
854FE7370A2297BE0058D7AD /* Traversal.h in Headers */,
+ 1419D2C50CEA6F6100FF507A /* TreeShared.h in Headers */,
854FE7390A2297BE0058D7AD /* TreeWalker.h in Headers */,
93309E1A099E64920056E581 /* TypingCommand.h in Headers */,
85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */,
BCB16C2D0979C3BD00467741 /* loader.h in Headers */,
93309DF8099E64920056E581 /* markup.h in Headers */,
93309E1E099E64920056E581 /* visible_units.h in Headers */,
- 1419D2C50CEA6F6100FF507A /* TreeShared.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#include "FrameTree.h"
#include "KURL.h"
#include "PlatformString.h"
+#include "SecurityOriginData.h"
namespace WebCore {
return m_protocol + ":" + m_host + ":" + String::number(m_port);
}
+SecurityOriginData SecurityOrigin::securityOriginData() const
+{
+ return SecurityOriginData(m_protocol, m_host, m_port);
+}
+
} // namespace WebCore
class Frame;
class KURL;
-
+ class SecurityOriginData;
+
class SecurityOrigin {
public:
SecurityOrigin();
String toString() const;
+ SecurityOriginData securityOriginData() const;
+
private:
void clear();
bool isEmpty() const;
--- /dev/null
+/*
+ * 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(const String& protocol, const String& host, unsigned short port)
+ : m_protocol(protocol)
+ , m_host(host)
+ , m_port(port)
+ { }
+
+ const String& protocol() const { return m_protocol; }
+ const String& host() const { return m_host; }
+ unsigned short port() const { return m_port; }
+
+ String stringIdentifier() const { return m_protocol + ":" + m_host + ":" + String::number(m_port); }
+private:
+ String m_protocol;
+ String m_host;
+ unsigned short m_port;
+};
+
+} // namespace WebCore
+
+#endif // SecurityOriginData_h
#include "Logging.h"
#include "NotImplemented.h"
#include "Page.h"
+#include "SecurityOriginData.h"
#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
#include "SQLResultSet.h"
m_databaseThread = document->databaseThread();
ASSERT(m_databaseThread);
- m_filename = DatabaseTracker::tracker().fullPathForDatabase(m_securityOrigin.toString(), m_name);
+ m_filename = DatabaseTracker::tracker().fullPathForDatabase(m_securityOrigin.securityOriginData(), m_name);
}
Database::~Database()
#include "Database.h"
#include "FileSystem.h"
#include "NotImplemented.h"
+#include "SecurityOriginData.h"
#include "SQLiteStatement.h"
namespace WebCore {
}
}
-String DatabaseTracker::fullPathForDatabase(const String& origin, const String& name)
+String DatabaseTracker::fullPathForDatabase(const SecurityOriginData& origin, const String& name)
{
SQLiteStatement statement(m_database, "SELECT path FROM Databases WHERE origin=? AND name=?;");
if (result == SQLResultRow)
return pathByAppendingComponent(m_databasePath, statement.getColumnText16(0));
if (result != SQLResultDone) {
- LOG_ERROR("Failed to retrieve filename from Database Tracker for origin %s, name %s", origin.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 "";
}
sequenceStatement.finalize();
- if (!addDatabase(origin, name, String::format("%016llx.db", seq)))
+ if (!addDatabase(origin.stringIdentifier(), name, String::format("%016llx.db", seq)))
return "";
return filename;
return *(m_origins.get());
}
-bool DatabaseTracker::databaseNamesForOrigin(const String& origin, Vector<String>& resultVector)
+bool DatabaseTracker::databaseNamesForOrigin(const SecurityOriginData& origin, Vector<String>& resultVector)
{
if (!m_database.isOpen())
return false;
resultVector.append(statement.getColumnText16(0));
if (result != SQLResultDone) {
- LOG_ERROR("Failed to retrieve all database names for origin %s", origin.ascii().data());
+ LOG_ERROR("Failed to retrieve all database names for origin %s", origin.stringIdentifier().ascii().data());
return false;
}
notImplemented();
}
-void DatabaseTracker::deleteAllDatabasesForOrigin(const String& origin)
+void DatabaseTracker::deleteDatabasesWithOrigin(const SecurityOriginData& origin)
{
notImplemented();
}
-void DatabaseTracker::deleteDatabase(const String& origin, const String& name)
+void DatabaseTracker::deleteDatabase(const SecurityOriginData& origin, const String& name)
{
notImplemented();
}
+void DatabaseTracker::setClient(DatabaseTrackerClient* client)
+{
+ m_client = client;
+}
+
} // namespace WebCore
namespace WebCore {
+class DatabaseTrackerClient;
+class SecurityOriginData;
+
class DatabaseTracker {
public:
void setDatabasePath(const String&);
const String& databasePath();
- String fullPathForDatabase(const String& origin, const String& name);
+ String fullPathForDatabase(const SecurityOriginData& origin, const String& name);
const HashSet<String>& origins();
- bool databaseNamesForOrigin(const String& origin, Vector<String>& result);
+ bool databaseNamesForOrigin(const SecurityOriginData& origin, Vector<String>& result);
void deleteAllDatabases();
- void deleteAllDatabasesForOrigin(const String& origin);
- void deleteDatabase(const String& origin, const String& name);
+ void deleteDatabasesWithOrigin(const SecurityOriginData& origin);
+ void deleteDatabase(const SecurityOriginData& origin, const String& name);
+ void setClient(DatabaseTrackerClient*);
+
static DatabaseTracker& tracker();
private:
DatabaseTracker();
mutable OwnPtr<HashSet<String> > m_origins;
String m_databasePath;
+
+ DatabaseTrackerClient* m_client;
};
} // namespace WebCore
--- /dev/null
+/*
+ * 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 DatabaseTrackerClient_h
+#define DatabaseTrackerClient_h
+
+namespace WebCore {
+
+class SecurityOriginData;
+class String;
+
+class DatabaseTrackerClient {
+public:
+ virtual ~DatabaseTrackerClient() { }
+ virtual void dispatchDidModifyOrigin(const SecurityOriginData&) = 0;
+ virtual void dispatchDidModifyDatabase(const SecurityOriginData&, const String& databaseName) = 0;
+};
+
+} // namespace WebCore
+
+#endif // DatabaseTrackerClient_h
+2007-11-15 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John
+
+ Stubbing out everything required for a WebKit API for databases
+
+ * WebKit.xcodeproj/project.pbxproj:
+
2007-11-12 Adam Roben <aroben@apple.com>
* StringsNotToBeLocalized.txt: Updated.
22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; settings = {ATTRIBUTES = (); }; };
4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; };
- 5106D07F0CBC07AE00992D8C /* WebDatabaseManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5106D07D0CBC07AE00992D8C /* WebDatabaseManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 5106D0800CBC07AE00992D8C /* WebDatabaseManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5106D07E0CBC07AE00992D8C /* WebDatabaseManager.mm */; };
+ 511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */; };
+ 511F3FD60CECC88F00852565 /* WebDatabaseManagerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */; };
+ 511F3FD70CECC88F00852565 /* WebDatabaseTrackerClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */; };
+ 511F3FD80CECC88F00852565 /* WebDatabaseTrackerClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */; };
+ 512F2F670CEC3BC5006537E3 /* WebSecurityOriginInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F2F660CEC3BC5006537E3 /* WebSecurityOriginInternal.h */; };
51494CD60C7EBDE0004178C5 /* WebIconDatabaseClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51494CD40C7EBDE0004178C5 /* WebIconDatabaseClient.h */; };
51494CD70C7EBDE0004178C5 /* WebIconDatabaseClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51494CD50C7EBDE0004178C5 /* WebIconDatabaseClient.mm */; };
51494D240C7EC1B7004178C5 /* WebNSNotificationCenterExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 51494D220C7EC1B6004178C5 /* WebNSNotificationCenterExtras.h */; };
51494D250C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = 51494D230C7EC1B7004178C5 /* WebNSNotificationCenterExtras.m */; };
+ 51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */; };
51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */; };
51C714FB0B20F79F00E5E33C /* WebBackForwardListInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */; };
- 51C96BDD0CC5358E0047DF2A /* WebDatabaseManagerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C96BDC0CC5358E0047DF2A /* WebDatabaseManagerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51E9C4CB0CEC21A7004F960A /* WebSecurityOriginPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E9C4C90CEC21A7004F960A /* WebSecurityOriginPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 51E9C4CC0CEC21A7004F960A /* WebSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51E9C4CA0CEC21A7004F960A /* WebSecurityOrigin.mm */; };
51FDC4D30B0AF5C100F84EB3 /* WebHistoryItemPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
5241ADF50B1BC48A004012BD /* WebCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 5241ADF30B1BC48A004012BD /* WebCache.h */; settings = {ATTRIBUTES = (Private, ); }; };
5241ADF60B1BC48A004012BD /* WebCache.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5241ADF40B1BC48A004012BD /* WebCache.mm */; };
39446080020F50ED0ECA1767 /* WebHistoryItem.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebHistoryItem.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; };
- 5106D07D0CBC07AE00992D8C /* WebDatabaseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManager.h; sourceTree = "<group>"; };
- 5106D07E0CBC07AE00992D8C /* WebDatabaseManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseManager.mm; sourceTree = "<group>"; };
+ 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseManager.mm; sourceTree = "<group>"; };
+ 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManagerPrivate.h; sourceTree = "<group>"; };
+ 511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseTrackerClient.h; sourceTree = "<group>"; };
+ 511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDatabaseTrackerClient.mm; sourceTree = "<group>"; };
+ 512F2F660CEC3BC5006537E3 /* WebSecurityOriginInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginInternal.h; sourceTree = "<group>"; };
513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51443F9A0429392B00CA2D3A /* WebPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPolicyDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51443F9B0429392B00CA2D3A /* WebPolicyDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPolicyDelegate.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51A8B579042834F700CA2D3A /* WebView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51A8B57A042834F700CA2D3A /* WebView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51A8B57D0428353A00CA2D3A /* WebViewPrivate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebViewPrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManagerInternal.h; sourceTree = "<group>"; };
51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIconDatabaseDelegate.h; sourceTree = "<group>"; };
51C16E4006138EB400A1657B /* npfunctions.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = npfunctions.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51C714FA0B20F79F00E5E33C /* WebBackForwardListInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebBackForwardListInternal.h; sourceTree = "<group>"; };
- 51C96BDC0CC5358E0047DF2A /* WebDatabaseManagerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDatabaseManagerPrivate.h; sourceTree = "<group>"; };
51E94C3406C0321200A9B09E /* WebPDFView.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51E94C3506C0321200A9B09E /* WebPDFView.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPDFView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51E94C6806C0347500A9B09E /* WebPDFRepresentation.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPDFRepresentation.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51E94C6906C0347500A9B09E /* WebPDFRepresentation.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebPDFRepresentation.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 51E9C4C90CEC21A7004F960A /* WebSecurityOriginPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSecurityOriginPrivate.h; sourceTree = "<group>"; };
+ 51E9C4CA0CEC21A7004F960A /* WebSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSecurityOrigin.mm; sourceTree = "<group>"; };
51FDC4D20B0AF5C100F84EB3 /* WebHistoryItemPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItemPrivate.h; sourceTree = "<group>"; };
5241ADF30B1BC48A004012BD /* WebCache.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebCache.h; sourceTree = "<group>"; };
5241ADF40B1BC48A004012BD /* WebCache.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCache.mm; sourceTree = "<group>"; };
254DC334016E1D3F0ECA149E /* Misc */,
F8CA15B4029A399401000122 /* Panels */,
F5EBC45202134BB601CA1520 /* Plugins */,
+ 511F3FC30CECC7E200852565 /* Storage */,
F5B36B400281DE87018635CB /* WebCoreSupport */,
9C7CABBB0190A37C0ECA16EA /* WebView */,
1C68F63F095B5F9C00C2984E /* WebInspector */,
5241ADF40B1BC48A004012BD /* WebCache.mm */,
F59EAE3E0253C7EE018635CA /* WebCoreStatistics.h */,
F59EAE410253C8DE018635CA /* WebCoreStatistics.mm */,
- 5106D07D0CBC07AE00992D8C /* WebDatabaseManager.h */,
- 51C96BDC0CC5358E0047DF2A /* WebDatabaseManagerPrivate.h */,
- 5106D07E0CBC07AE00992D8C /* WebDatabaseManager.mm */,
6578F5DE045F817400000128 /* WebDownload.h */,
6578F5DF045F817400000128 /* WebDownload.m */,
ABDDF20C08EB0DDC001E1241 /* WebDownloadInternal.h */,
9345DDAF0365FB27008635CE /* WebNSWindowExtras.m */,
F560BEBC030DAF4401C1A526 /* WebSearchableTextView.h */,
F560BEBD030DAF4401C1A526 /* WebSearchableTextView.m */,
+ 512F2F660CEC3BC5006537E3 /* WebSecurityOriginInternal.h */,
+ 51E9C4C90CEC21A7004F960A /* WebSecurityOriginPrivate.h */,
+ 51E9C4CA0CEC21A7004F960A /* WebSecurityOrigin.mm */,
F59668C802AD2923018635CA /* WebStringTruncator.h */,
F59668C902AD2923018635CA /* WebStringTruncator.m */,
DD7CDEE60A23BA9E00069928 /* WebTypesInternal.h */,
tabWidth = 4;
usesTabs = 0;
};
+ 511F3FC30CECC7E200852565 /* Storage */ = {
+ isa = PBXGroup;
+ children = (
+ 511F3FD10CECC88F00852565 /* WebDatabaseManager.mm */,
+ 51AEDEF00CECF45700854328 /* WebDatabaseManagerInternal.h */,
+ 511F3FD20CECC88F00852565 /* WebDatabaseManagerPrivate.h */,
+ 511F3FD30CECC88F00852565 /* WebDatabaseTrackerClient.h */,
+ 511F3FD40CECC88F00852565 /* WebDatabaseTrackerClient.mm */,
+ );
+ path = Storage;
+ sourceTree = "<group>";
+ };
51E94C0706C02CA300A9B09E /* PDF */ = {
isa = PBXGroup;
children = (
9398104B0824BF01008DF038 /* WebDataSource.h in Headers */,
658A40960A14853B005E6987 /* WebDataSourceInternal.h in Headers */,
9398104C0824BF01008DF038 /* WebDataSourcePrivate.h in Headers */,
- 5106D07F0CBC07AE00992D8C /* WebDatabaseManager.h in Headers */,
- 51C96BDD0CC5358E0047DF2A /* WebDatabaseManagerPrivate.h in Headers */,
+ 511F3FD60CECC88F00852565 /* WebDatabaseManagerPrivate.h in Headers */,
+ 511F3FD70CECC88F00852565 /* WebDatabaseTrackerClient.h in Headers */,
9398104E0824BF01008DF038 /* WebDefaultContextMenuDelegate.h in Headers */,
9398108D0824BF01008DF038 /* WebDefaultEditingDelegate.h in Headers */,
9398104F0824BF01008DF038 /* WebDefaultPolicyDelegate.h in Headers */,
1C0706630A431E01001078F6 /* WebScriptDebugServer.h in Headers */,
1C07079A0A433E22001078F6 /* WebScriptDebugServerPrivate.h in Headers */,
939810260824BF01008DF038 /* WebSearchableTextView.h in Headers */,
+ 512F2F670CEC3BC5006537E3 /* WebSecurityOriginInternal.h in Headers */,
+ 51E9C4CB0CEC21A7004F960A /* WebSecurityOriginPrivate.h in Headers */,
939810270824BF01008DF038 /* WebStringTruncator.h in Headers */,
93EB178F09F88D510091F8FF /* WebSystemInterface.h in Headers */,
DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */,
9398109B0824BF01008DF038 /* WebViewInternal.h in Headers */,
939810710824BF01008DF038 /* WebViewPrivate.h in Headers */,
939810970824BF01008DF038 /* npfunctions.h in Headers */,
+ 51AEDEF10CECF45700854328 /* WebDatabaseManagerInternal.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ ED3B48DF0CC51F7E00DFF1EB /* ../StringsNotToBeLocalized.txt in Resources */,
939810BA0824BF01008DF038 /* IDNScriptWhiteList.txt in Resources */,
939810B30824BF01008DF038 /* Localizable.strings in Resources */,
- ED3B48DF0CC51F7E00DFF1EB /* ../StringsNotToBeLocalized.txt in Resources */,
939810B50824BF01008DF038 /* WebAuthenticationPanel.nib in Resources */,
939810B40824BF01008DF038 /* WebJavaScriptTextInputPanel.nib in Resources */,
939810B90824BF01008DF038 /* WebViewEditingContextMenu.nib in Resources */,
939810BF0824BF01008DF038 /* WebCoreStatistics.mm in Sources */,
9398111C0824BF01008DF038 /* WebDOMOperations.mm in Sources */,
939810ED0824BF01008DF038 /* WebDataSource.mm in Sources */,
- 5106D0800CBC07AE00992D8C /* WebDatabaseManager.mm in Sources */,
+ 511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */,
+ 511F3FD80CECC88F00852565 /* WebDatabaseTrackerClient.mm in Sources */,
939810EF0824BF01008DF038 /* WebDefaultContextMenuDelegate.mm in Sources */,
9398111B0824BF01008DF038 /* WebDefaultEditingDelegate.m in Sources */,
939810F00824BF01008DF038 /* WebDefaultPolicyDelegate.m in Sources */,
7E6FEF0908985A7200C44C3F /* WebScriptDebugDelegate.mm in Sources */,
1C07073D0A433BD8001078F6 /* WebScriptDebugServer.m in Sources */,
939810CB0824BF01008DF038 /* WebSearchableTextView.m in Sources */,
+ 51E9C4CC0CEC21A7004F960A /* WebSecurityOrigin.mm in Sources */,
939810CC0824BF01008DF038 /* WebStringTruncator.m in Sources */,
93EB178D09F88D460091F8FF /* WebSystemInterface.m in Sources */,
939810BE0824BF01008DF038 /* WebURLsWithTitles.m in Sources */,
+2007-11-15 Brady Eidson <beidson@apple.com>
+
+ Reviewed by John
+
+ Stubbing out everything required for a WebKit API for databases
+
+ These interfaces seem to provide everything we need for UI and management at the browser level
+
+ * Misc/WebDatabaseManager.h: Removed.
+ * Misc/WebDatabaseManager.mm: Removed.
+ * Misc/WebDatabaseManagerPrivate.h: Removed.
+
+ * Misc/WebSecurityOrigin.mm: Added. Object that acts as a container for the "SecurityOrigin tuple"
+ (protocol, domain, and port)
+ (-[WebSecurityOriginPrivate initWithProtocol:domain:port:]):
+ (-[WebSecurityOriginPrivate dealloc]):
+ (-[WebSecurityOrigin initWithProtocol:domain:]):
+ (-[WebSecurityOrigin initWithProtocol:domain:port:]):
+ (-[WebSecurityOrigin protocol]):
+ (-[WebSecurityOrigin domain]):
+ (-[WebSecurityOrigin port]):
+ (-[WebSecurityOrigin dealloc]):
+ (-[WebSecurityOrigin _initWithWebCoreSecurityOriginData:WebCore::]):
+ * Misc/WebSecurityOriginInternal.h: Added.
+ * Misc/WebSecurityOriginPrivate.h: Added.
+
+ * Storage/WebDatabaseManager.mm: Added.
+ (+[WebDatabaseManager sharedWebDatabaseManager]):
+ (-[WebDatabaseManager origins]): Get a list of all origins currently tracked
+ (-[WebDatabaseManager detailsForOrigin:]): Get the current usage and current quota for the given origin
+ (-[WebDatabaseManager databasesWithOrigin:]): Get all databases for a certain origin
+ (-[WebDatabaseManager detailsForDatabase:withOrigin:]): Get all details about a specific database
+ (-[WebDatabaseManager setQuota:forOrigin:]): Change origin-wide quota
+ (-[WebDatabaseManager deleteAllDatabases]):
+ (-[WebDatabaseManager deleteAllDatabasesWithOrigin:]):
+ (-[WebDatabaseManager deleteDatabase:withOrigin:]):
+ * Storage/WebDatabaseManagerPrivate.h: Added.
+ * Storage/WebDatabaseManagerInternal.h: Added.
+ (WebKitInitializeDatabasesIfNecessary): One-time initialization of database-related things
+
+ * Storage/WebDatabaseTrackerClient.h: Added. Stubbed out client for notifications
+ * Storage/WebDatabaseTrackerClient.mm: Added.
+ (WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient):
+ (WebDatabaseTrackerClient::WebDatabaseTrackerClient):
+ (WebDatabaseTrackerClient::~WebDatabaseTrackerClient):
+ (WebDatabaseTrackerClient::dispatchDidModifyOrigin):
+ (WebDatabaseTrackerClient::dispatchDidModifyDatabase):
+
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]): Do one-time initialization of
+ Database-related things here
+
2007-11-13 Geoffrey Garen <ggaren@apple.com>
Reviewed by Anders Carlsson.
--- /dev/null
+/*
+ * 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.
+ */
+#import "WebSecurityOriginPrivate.h"
+
+#import "WebSecurityOriginInternal.h"
+#import <WebCore/SecurityOriginData.h>
+
+@interface WebSecurityOriginPrivate : NSObject {
+@public
+ NSString *protocol;
+ NSString *domain;
+ unsigned short port;
+}
+- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain port:(unsigned short)port;
+@end
+
+@implementation WebSecurityOriginPrivate
+
+- (id)initWithProtocol:(NSString *)theProtocol domain:(NSString *)theDomain port:(unsigned short)thePort
+{
+ self = [super init];
+ if (!self)
+ return nil;
+
+ protocol = [theProtocol copy];
+ domain = [theDomain copy];
+ port = thePort;
+
+ return self;
+}
+
+- (void)dealloc
+{
+ [protocol release];
+ [domain release];
+ [super dealloc];
+}
+
+@end
+
+@implementation WebSecurityOrigin
+
+
+- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain
+{
+ return [self initWithProtocol:protocol domain:domain port:0];
+}
+
+- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain port:(unsigned short)port
+{
+ self = [super init];
+ if (!self)
+ return nil;
+
+ _private = [[WebSecurityOriginPrivate alloc] initWithProtocol:protocol domain:domain port:port];
+
+ return self;
+}
+
+- (NSString*)protocol
+{
+ return [[_private->protocol retain] autorelease];
+}
+
+- (NSString*)domain
+{
+ return [[_private->domain retain] autorelease];
+}
+
+- (unsigned short)port
+{
+ return _private->port;
+}
+
+- (void)dealloc
+{
+ [_private release];
+ [super dealloc];
+}
+
+@end
+
+@implementation WebSecurityOrigin (WebInternal)
+
+- (id)_initWithWebCoreSecurityOriginData:(WebCore::SecurityOriginData *)securityOriginData
+{
+ ASSERT(securityOriginData);
+ return [self initWithProtocol:securityOriginData->protocol() domain:securityOriginData->host() port:securityOriginData->port()];
+}
+
+@end
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-extern const NSString *WebDatabaseDirectoryDefaultsKey;
-extern const NSString *WebDatabaseNameKey;
-extern const NSString *WebDatabaseSizeKey;
-
-@interface WebDatabaseManager : NSObject
-{
+namespace WebCore {
+ class SecurityOriginData;
}
-+ (NSArray *)origins;
-+ (NSArray *)databasesWithOrigin:(NSString *)origin;
-+ (void)deleteAllDatabases;
-+ (void)deleteAllDatabasesWithOrigin:(NSString *)origin;
-+ (void)deleteDatabaseWithOrigin:(NSString *)origin named:(NSString *)name;
+@interface WebSecurityOrigin (WebInternal)
+
+- (id)_initWithWebCoreSecurityOriginData:(WebCore::SecurityOriginData *)securityOriginData;
@end
--- /dev/null
+/*
+ * 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.
+ */
+
+@class WebSecurityOriginPrivate;
+
+@interface WebSecurityOrigin : NSObject {
+ WebSecurityOriginPrivate *_private;
+}
+
+- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain;
+- (id)initWithProtocol:(NSString *)protocol domain:(NSString *)domain port:(unsigned short)port;
+
+- (NSString*)protocol;
+- (NSString*)domain;
+
+// Returns zero if the port is the default port for the protocol, non-zero otherwise
+- (unsigned short)port;
+@end
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebDatabaseManager.h"
#import "WebDatabaseManagerPrivate.h"
+#import "WebDatabaseManagerInternal.h"
+
+#import "WebDatabaseTrackerClient.h"
+#import "WebSecurityOriginPrivate.h"
#import <WebCore/DatabaseTracker.h>
+#import <WebCore/SecurityOriginData.h>
using namespace WebCore;
const NSString *WebDatabaseDirectoryDefaultsKey = @"WebDatabaseDirectory";
+
+const NSString *WebDatabaseOriginKey = @"WebDatabaseOriginKey";
+const NSString *WebDatabaseOriginQuotaKey = @"WebDatabaseOriginQuotaKey";
+const NSString *WebDatabaseOriginUsageKey = @"WebDatabaseOriginUsageKey";
+
const NSString *WebDatabaseNameKey = @"WebDatabaseNameKey";
-const NSString *WebDatabaseSizeKey = @"WebDatabaseSizeKey";
+const NSString *WebDatabaseDisplayNameKey = @"WebDatabaseDisplayNameKey";
+const NSString *WebDatabaseExpectedSizeKey = @"WebDatabaseExpectedSizeKey";
+const NSString *WebDatabaseUsageKey = @"WebDatabaseUsageKey";
+
+const NSString *WebDatabaseDidModifyOriginNotification = @"WebDatabaseDidModifyOriginNotification";
+const NSString *WebDatabaseDidModifyDatabaseNotification = @"WebDatabaseDidModifyDatabaseNotification";
@implementation WebDatabaseManager
-+ (NSArray *)origins
++ (WebDatabaseManager *) sharedWebDatabaseManager
{
- NSMutableArray *array = [[NSMutableArray alloc] init];
-
- const HashSet<String>& origins = DatabaseTracker::tracker().origins();
- HashSet<String>::const_iterator iter = origins.begin();
- HashSet<String>::const_iterator end = origins.end();
+ static WebDatabaseManager *sharedManager = [[WebDatabaseManager alloc] init];
+ return sharedManager;
+}
- for (; iter != end; ++iter)
- [array addObject:(NSString *)(*iter)];
+- (NSArray *)origins
+{
+ return nil;
+}
- return [array autorelease];
+- (NSDictionary *)detailsForOrigin:(WebSecurityOrigin *)origin
+{
+ return nil;
}
-+ (NSArray *)databasesWithOrigin:(NSString *)origin
+- (NSArray *)databasesWithOrigin:(WebSecurityOrigin *)origin
{
- Vector<String> result;
- if (!DatabaseTracker::tracker().databaseNamesForOrigin(origin, result))
- return nil;
+ return nil;
+}
- NSMutableArray *array = [[NSMutableArray alloc] initWithCapacity:result.size()];
+- (NSDictionary *)detailsForDatabase:(NSString *)databaseName withOrigin:(WebSecurityOrigin *)origin
+{
+ return nil;
+}
- for (unsigned i = 0; i < result.size(); ++i)
- [array addObject:(NSString *)result[i]];
+- (void)setQuota:(unsigned long long)quota forOrigin:(WebSecurityOrigin *)origin
+{
- return array;
}
-+ (void)deleteAllDatabases
+- (void)deleteAllDatabases
{
DatabaseTracker::tracker().deleteAllDatabases();
}
-+ (void)deleteAllDatabasesWithOrigin:(NSString *)origin
+- (void)deleteDatabasesWithOrigin:(WebSecurityOrigin *)origin
{
- DatabaseTracker::tracker().deleteAllDatabasesForOrigin(origin);
+ SecurityOriginData coreOrigin([origin protocol], [origin domain], [origin port]);
+
+ DatabaseTracker::tracker().deleteDatabasesWithOrigin(coreOrigin);
}
-+ (void)deleteDatabaseWithOrigin:(NSString *)origin named:(NSString *)name
+- (void)deleteDatabase:(NSString *)databaseName withOrigin:(WebSecurityOrigin *)origin
{
- DatabaseTracker::tracker().deleteDatabase(origin, name);
+ SecurityOriginData coreOrigin([origin protocol], [origin domain], [origin port]);
+
+ DatabaseTracker::tracker().deleteDatabase(coreOrigin, databaseName);
}
-
@end
-void WebKitSetWebDatabasesPathIfNecessary()
+void WebKitInitializeDatabasesIfNecessary()
{
- static BOOL pathSet = NO;
- if (pathSet)
+ static BOOL initialized = NO;
+ if (initialized)
return;
+ // Set the database root path in WebCore
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *databasesDirectory = [defaults objectForKey:WebDatabaseDirectoryDefaultsKey];
- if (!databasesDirectory)
+ if (!databasesDirectory || ![databasesDirectory isKindOfClass:[NSString class]])
databasesDirectory = @"~/Library/WebKit/Databases";
DatabaseTracker::tracker().setDatabasePath([databasesDirectory stringByStandardizingPath]);
- pathSet = YES;
+ // Set the DatabaseTrackerClient
+ DatabaseTracker::tracker().setClient(WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient());
+
+ initialized = YES;
}
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebDatabaseManager.h"
-
-void WebKitSetWebDatabasesPathIfNecessary();
+void WebKitInitializeDatabasesIfNecessary();
--- /dev/null
+/*
+ * 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.
+ */
+
+extern const NSString *WebDatabaseOriginQuotaKey;
+extern const NSString *WebDatabaseOriginUsageKey;
+
+extern const NSString *WebDatabaseNameKey;
+extern const NSString *WebDatabaseOriginKey;
+extern const NSString *WebDatabaseDisplayNameKey;
+extern const NSString *WebDatabaseExpectedSizeKey;
+extern const NSString *WebDatabaseUsageKey;
+
+// Posted with an origin is created from scratch, gets a new database, has a database deleted, has a quota change, etc
+extern const NSString *WebDatabaseDidModifyOriginNotification;
+
+// Posted when a database is created, its size increases, its display name changes, or its estimated size changes, or the database is removed
+extern const NSString *WebDatabaseDidModifyDatabaseNotification;
+
+@class WebSecurityOrigin;
+
+@interface WebDatabaseManager : NSObject
+{
+}
+
++ (WebDatabaseManager *) sharedWebDatabaseManager;
+
+// Will return an array of WebSecurityOrigins
+- (NSArray *)origins;
+
+// Will return the dictionary describing the current size and quota of the passed origin
+- (NSDictionary *)detailsForOrigin:(WebSecurityOrigin *)origin;
+
+// Will return an array of dictionaries, 1 dictionary per database in the requested origin
+- (NSArray *)databasesWithOrigin:(WebSecurityOrigin *)origin;
+
+// Will return the dictionary describing everything about the database for the passed origin and name
+- (NSDictionary *)detailsForDatabase:(NSString *)databaseName withOrigin:(WebSecurityOrigin *)origin;
+
+// Sets the storage quota (in bytes) of the specified origin
+// If the quota is set to a value lower than the current usage, that quota will "stick" but no data will be purged to meet the new quota.
+// This will simply prevent new data from being added to the origin
+- (void)setQuota:(unsigned long long)quota forOrigin:(WebSecurityOrigin *)origin;
+
+- (void)deleteAllDatabases;
+- (void)deleteDatabasesWithOrigin:(WebSecurityOrigin *)origin;
+- (void)deleteDatabase:(NSString *)databaseName withOrigin:(WebSecurityOrigin *)origin;
+
+@end
--- /dev/null
+/*
+ * 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.
+ */
+
+#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& databaseName);
+private:
+ WebDatabaseTrackerClient();
+};
--- /dev/null
+/*
+ * 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.
+ */
+
+#import "WebDatabaseTrackerClient.h"
+
+WebDatabaseTrackerClient* WebDatabaseTrackerClient::sharedWebDatabaseTrackerClient()
+{
+ static WebDatabaseTrackerClient* sharedClient = new WebDatabaseTrackerClient();
+ return sharedClient;
+}
+
+WebDatabaseTrackerClient::WebDatabaseTrackerClient()
+{
+}
+
+WebDatabaseTrackerClient::~WebDatabaseTrackerClient()
+{
+}
+
+void WebDatabaseTrackerClient::dispatchDidModifyOrigin(const WebCore::SecurityOriginData& origin)
+{
+
+}
+
+void WebDatabaseTrackerClient::dispatchDidModifyDatabase(const WebCore::SecurityOriginData& origin, const WebCore::String& databaseName)
+{
+
+}
#import "WebContextMenuClient.h"
#import "WebDOMOperationsPrivate.h"
#import "WebDashboardRegion.h"
+#import "WebDatabaseManagerInternal.h"
#import "WebDatabaseManagerPrivate.h"
#import "WebDataSourceInternal.h"
#import "WebDefaultEditingDelegate.h"
WebKitInitializeLoggingChannelsIfNecessary();
WebCore::InitializeLoggingChannelsIfNecessary();
[WebHistoryItem initWindowWatcherIfNecessary];
- WebKitSetWebDatabasesPathIfNecessary();
+ WebKitInitializeDatabasesIfNecessary();
_private->page = new Page(new WebChromeClient(self), new WebContextMenuClient(self), new WebEditorClient(self), new WebDragClient(self), new WebInspectorClient(self));
[[[WebFrameBridge alloc] initMainFrameWithPage:_private->page frameName:frameName frameView:frameView] release];