[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jorlow at chromium.org jorlow at chromium.org
Wed Dec 22 13:27:48 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 2d92268deaee0398c1b73dc406e348fae687b54a
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 16 11:27:46 2010 +0000

    2010-09-15  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Steve Block.
    
            Allow the embedder to specify the base path for IndexedDB.
            https://bugs.webkit.org/show_bug.cgi?id=45815
    
            Existing tests provide coverage. Use the indexedDBPath parameter that's
            already on the group settings object. Pass this parameter into the backend
            which will use it rather than a hard coded tmp directory location. If
            nothing is specified, assume it should be an in-memory temporary database.
            (This is useful for bringup and Chromium's incognito mode.)
    
            * storage/IDBFactory.cpp:
            (WebCore::IDBFactory::open):
            * storage/IDBFactoryBackendImpl.cpp:
            (WebCore::openSQLiteDatabase):
            (WebCore::createTables):
            (WebCore::IDBFactoryBackendImpl::open):
            * storage/IDBFactoryBackendImpl.h:
            * storage/IDBFactoryBackendInterface.h:
    2010-09-15  Jeremy Orlow  <jorlow at chromium.org>
    
            Reviewed by Steve Block.
    
            Allow the embedder to specify the base path for IndexedDB.
            https://bugs.webkit.org/show_bug.cgi?id=45815
    
            Need to add the extra .open() parameter to make this all work.
    
            * public/WebIDBFactory.h:
            (WebKit::WebIDBFactory::open):
            * src/IDBFactoryBackendProxy.cpp:
            (WebCore::IDBFactoryBackendProxy::open):
            * src/IDBFactoryBackendProxy.h:
            * src/WebIDBFactoryImpl.cpp:
            (WebKit::WebIDBFactoryImpl::open):
            * src/WebIDBFactoryImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67605 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e83df77..06c2169 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-15  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Steve Block.
+
+        Allow the embedder to specify the base path for IndexedDB.
+        https://bugs.webkit.org/show_bug.cgi?id=45815
+
+        Existing tests provide coverage. Use the indexedDBPath parameter that's
+        already on the group settings object. Pass this parameter into the backend
+        which will use it rather than a hard coded tmp directory location. If
+        nothing is specified, assume it should be an in-memory temporary database.
+        (This is useful for bringup and Chromium's incognito mode.)
+
+        * storage/IDBFactory.cpp:
+        (WebCore::IDBFactory::open):
+        * storage/IDBFactoryBackendImpl.cpp:
+        (WebCore::openSQLiteDatabase):
+        (WebCore::createTables):
+        (WebCore::IDBFactoryBackendImpl::open):
+        * storage/IDBFactoryBackendImpl.h:
+        * storage/IDBFactoryBackendInterface.h:
+
 2010-09-16  Yong Li  <yoli at rim.com>
 
         Reviewed by George Staikos.
diff --git a/WebCore/storage/IDBFactory.cpp b/WebCore/storage/IDBFactory.cpp
index d3a83a5..06c06ea 100644
--- a/WebCore/storage/IDBFactory.cpp
+++ b/WebCore/storage/IDBFactory.cpp
@@ -29,16 +29,19 @@
 #include "config.h"
 #include "IDBFactory.h"
 
+#if ENABLE(INDEXED_DATABASE)
+
 #include "DOMStringList.h"
 #include "Document.h"
 #include "ExceptionCode.h"
 #include "Frame.h"
+#include "GroupSettings.h"
 #include "IDBDatabase.h"
 #include "IDBFactoryBackendInterface.h"
 #include "IDBKeyRange.h"
 #include "IDBRequest.h"
-
-#if ENABLE(INDEXED_DATABASE)
+#include "Page.h"
+#include "PageGroup.h"
 
 namespace WebCore {
 
@@ -61,11 +64,11 @@ PassRefPtr<IDBRequest> IDBFactory::open(ScriptExecutionContext* context, const S
     }
 
     Document* document = static_cast<Document*>(context);
-    if (!document->frame())
+    if (!document->frame() || !document->page())
         return 0;
 
     RefPtr<IDBRequest> request = IDBRequest::create(document, IDBAny::create(this));
-    m_factoryBackend->open(name, description, request, document->securityOrigin(), document->frame());
+    m_factoryBackend->open(name, description, request, document->securityOrigin(), document->frame(), document->page()->group().groupSettings()->indexedDBDatabasePath());
     return request;
 }
 
diff --git a/WebCore/storage/IDBFactoryBackendImpl.cpp b/WebCore/storage/IDBFactoryBackendImpl.cpp
index 76ce617..d819c92 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.cpp
+++ b/WebCore/storage/IDBFactoryBackendImpl.cpp
@@ -52,19 +52,21 @@ IDBFactoryBackendImpl::~IDBFactoryBackendImpl()
 {
 }
 
-static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name)
+static PassOwnPtr<SQLiteDatabase> openSQLiteDatabase(SecurityOrigin* securityOrigin, String name, const String& pathBase)
 {
-    String pathBase = "/tmp/temporary-indexed-db-files"; // FIXME: Write a PageGroupSettings class and have this value come from that.
-    if (!makeAllDirectories(pathBase)) {
-        // FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
-        LOG_ERROR("Unabled to create LocalStorage database path %s", pathBase.utf8().data());
-        return 0;
+    String path = ":memory:";
+    if (!pathBase.isEmpty()) {
+        if (!makeAllDirectories(pathBase)) {
+            // FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
+            LOG_ERROR("Unabled to create LocalStorage database path %s", pathBase.utf8().data());
+            return 0;
+        }
+
+        String databaseIdentifier = securityOrigin->databaseIdentifier();
+        String santizedName = encodeForFileName(name);
+        path = pathByAppendingComponent(pathBase, databaseIdentifier + "_" + santizedName + ".indexeddb");
     }
 
-    String databaseIdentifier = securityOrigin->databaseIdentifier();
-    String santizedName = encodeForFileName(name);
-    String path = pathByAppendingComponent(pathBase, databaseIdentifier + "_" + santizedName + ".indexeddb");
-    
     OwnPtr<SQLiteDatabase> sqliteDatabase = adoptPtr(new SQLiteDatabase());
     if (!sqliteDatabase->open(path)) {
         // FIXME: Is there any other thing we could possibly do to recover at this point? If so, do it rather than just erroring out.
@@ -98,7 +100,7 @@ static bool createTables(SQLiteDatabase* sqliteDatabase)
         "CREATE UNIQUE INDEX IF NOT EXISTS ObjectStoreData_composit ON ObjectStoreData(keyString, keyDate, keyNumber, objectStoreId)",
 
         "DROP TABLE IF EXISTS IndexData",
-        "CREATE TABLE IF NOT EXISTS IndexData (id INTEGER PRIMARY KEY, indexId INTEGER NOT NULL REFERENCES Indexs(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, objectStoreDataId INTEGER NOT NULL UNIQUE REFERENCES ObjectStoreData(id))",
+        "CREATE TABLE IF NOT EXISTS IndexData (id INTEGER PRIMARY KEY, indexId INTEGER NOT NULL REFERENCES Indexes(id), keyString TEXT, keyDate INTEGER, keyNumber INTEGER, objectStoreDataId INTEGER NOT NULL UNIQUE REFERENCES ObjectStoreData(id))",
         "DROP INDEX IF EXISTS IndexData_composit",
         "CREATE INDEX IF NOT EXISTS IndexData_composit ON IndexData(keyString, keyDate, keyNumber, indexId)",
         "DROP INDEX IF EXISTS IndexData_objectStoreDataId",
@@ -117,7 +119,7 @@ static bool createTables(SQLiteDatabase* sqliteDatabase)
     return true;
 }
 
-void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*)
+void IDBFactoryBackendImpl::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> securityOrigin, Frame*, const String& dataDir)
 {
     IDBDatabaseBackendMap::iterator it = m_databaseBackendMap.find(name);
     if (it != m_databaseBackendMap.end()) {
@@ -129,7 +131,7 @@ void IDBFactoryBackendImpl::open(const String& name, const String& description,
 
     // FIXME: Everything from now on should be done on another thread.
 
-    OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name);
+    OwnPtr<SQLiteDatabase> sqliteDatabase = openSQLiteDatabase(securityOrigin.get(), name, dataDir);
     if (!sqliteDatabase || !createTables(sqliteDatabase.get())) {
         callbacks->onError(IDBDatabaseError::create(IDBDatabaseException::UNKNOWN_ERR, "Internal error."));
         return;
diff --git a/WebCore/storage/IDBFactoryBackendImpl.h b/WebCore/storage/IDBFactoryBackendImpl.h
index c9a33da..f2e1af8 100644
--- a/WebCore/storage/IDBFactoryBackendImpl.h
+++ b/WebCore/storage/IDBFactoryBackendImpl.h
@@ -49,7 +49,7 @@ public:
     }
     virtual ~IDBFactoryBackendImpl();
 
-    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*);
+    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
     virtual void abortPendingTransactions(const Vector<int>& pendingIDs);
 
 private:
diff --git a/WebCore/storage/IDBFactoryBackendInterface.h b/WebCore/storage/IDBFactoryBackendInterface.h
index c052bc2..e591271 100644
--- a/WebCore/storage/IDBFactoryBackendInterface.h
+++ b/WebCore/storage/IDBFactoryBackendInterface.h
@@ -51,7 +51,7 @@ public:
     static PassRefPtr<IDBFactoryBackendInterface> create();
     virtual ~IDBFactoryBackendInterface() { }
 
-    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*) = 0;
+    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir) = 0;
     virtual void abortPendingTransactions(const Vector<int>& ids) = 0;
 };
 
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 6ce12d7..9b1e812 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,21 @@
+2010-09-15  Jeremy Orlow  <jorlow at chromium.org>
+
+        Reviewed by Steve Block.
+
+        Allow the embedder to specify the base path for IndexedDB.
+        https://bugs.webkit.org/show_bug.cgi?id=45815
+
+        Need to add the extra .open() parameter to make this all work.
+
+        * public/WebIDBFactory.h:
+        (WebKit::WebIDBFactory::open):
+        * src/IDBFactoryBackendProxy.cpp:
+        (WebCore::IDBFactoryBackendProxy::open):
+        * src/IDBFactoryBackendProxy.h:
+        * src/WebIDBFactoryImpl.cpp:
+        (WebKit::WebIDBFactoryImpl::open):
+        * src/WebIDBFactoryImpl.h:
+
 2010-09-16  Jeremy Orlow  <jorlow at chromium.org>
 
         Speculative build fix.
diff --git a/WebKit/chromium/public/WebIDBFactory.h b/WebKit/chromium/public/WebIDBFactory.h
index 7c070a2..ab05b06 100755
--- a/WebKit/chromium/public/WebIDBFactory.h
+++ b/WebKit/chromium/public/WebIDBFactory.h
@@ -52,16 +52,14 @@ public:
     virtual ~WebIDBFactory() { }
 
     // The WebKit implementation of open ignores the WebFrame* parameter.
-    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame)
+    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, const WebString& dataDir)
     {
-        int exceptionCode;
-        open(name, description, callbacks, origin, webFrame, exceptionCode);
+        open(name, description, callbacks, origin, webFrame);
     }
     // FIXME: Delete soon.  Compatability hack.
-    virtual void open(const WebString& name, const WebString& description,
-                      WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame, int& exceptionCode)
+    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame* webFrame)
     {
-        open(name, description, callbacks, origin, webFrame);
+        open(name, description, callbacks, origin, webFrame, "/tmp/temporary-indexed-db-files");
     }
 
     virtual void abortPendingTransactions(const WebVector<int>& pendingIDs) { WEBKIT_ASSERT_NOT_REACHED(); }
diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
index 114e7e1..18101e4 100755
--- a/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
+++ b/WebKit/chromium/src/IDBFactoryBackendProxy.cpp
@@ -59,10 +59,10 @@ IDBFactoryBackendProxy::~IDBFactoryBackendProxy()
 {
 }
 
-void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame)
+void IDBFactoryBackendProxy::open(const String& name, const String& description, PassRefPtr<IDBCallbacks> callbacks, PassRefPtr<SecurityOrigin> origin, Frame* frame, const String& dataDir)
 {
     WebKit::WebFrame* webFrame = WebKit::WebFrameImpl::fromFrame(frame);
-    m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame);
+    m_webIDBFactory->open(name, description, new WebIDBCallbacksImpl(callbacks), origin, webFrame, dataDir);
 }
 
 void IDBFactoryBackendProxy::abortPendingTransactions(const Vector<int>& pendingIDs)
diff --git a/WebKit/chromium/src/IDBFactoryBackendProxy.h b/WebKit/chromium/src/IDBFactoryBackendProxy.h
index 9efc7af..ac30cf2 100755
--- a/WebKit/chromium/src/IDBFactoryBackendProxy.h
+++ b/WebKit/chromium/src/IDBFactoryBackendProxy.h
@@ -45,7 +45,7 @@ public:
     virtual ~IDBFactoryBackendProxy();
 
     PassRefPtr<DOMStringList> databases(void) const;
-    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*);
+    virtual void open(const String& name, const String& description, PassRefPtr<IDBCallbacks>, PassRefPtr<SecurityOrigin>, Frame*, const String& dataDir);
     virtual void abortPendingTransactions(const Vector<int>& pendingIDs);
 
 private:
diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.cpp b/WebKit/chromium/src/WebIDBFactoryImpl.cpp
index 564be36..3c8d459 100755
--- a/WebKit/chromium/src/WebIDBFactoryImpl.cpp
+++ b/WebKit/chromium/src/WebIDBFactoryImpl.cpp
@@ -58,9 +58,9 @@ WebIDBFactoryImpl::~WebIDBFactoryImpl()
 {
 }
 
-void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*)
+void WebIDBFactoryImpl::open(const WebString& name, const WebString& description, WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin, WebFrame*, const WebString& dataDir)
 {
-    m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0);
+    m_idbFactoryBackend->open(name, description, IDBCallbacksProxy::create(callbacks), origin, 0, dataDir);
 }
 
 void WebIDBFactoryImpl::abortPendingTransactions(const WebVector<int>& pendingIDs)
diff --git a/WebKit/chromium/src/WebIDBFactoryImpl.h b/WebKit/chromium/src/WebIDBFactoryImpl.h
index aeab478..4dc0a10 100755
--- a/WebKit/chromium/src/WebIDBFactoryImpl.h
+++ b/WebKit/chromium/src/WebIDBFactoryImpl.h
@@ -42,7 +42,7 @@ public:
     WebIDBFactoryImpl();
     virtual ~WebIDBFactoryImpl();
 
-    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*);
+    virtual void open(const WebString& name, const WebString& description, WebIDBCallbacks*, const WebSecurityOrigin&, WebFrame*, const WebString& dataDir);
     virtual void abortPendingTransactions(const WebVector<int>& pendingIDs);
 
 private:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list