Changeset 171749 in webkit


Ignore:
Timestamp:
Jul 29, 2014 10:37:58 AM (10 years ago)
Author:
beidson@apple.com
Message:

Make WKOriginDataManager actually operate on IndexedDatabases.
https://bugs.webkit.org/show_bug.cgi?id=135346

Reviewed by Sam Weinig (and David Kilzer and Alex Christensen)

Source/WebCore:

  • WebCore.exp.in:

Source/WebKit2:

  • DatabaseProcess/DatabaseProcess.cpp:

(WebKit::DatabaseProcess::DatabaseProcess):
(WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
(WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins):
(WebKit::removeAllDatabasesForOriginPath): Utility to delete all database files for the given origin path

that have been modified between the given dates.

(WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
(WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin):
(WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
(WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates):
(WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
(WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries):

  • DatabaseProcess/DatabaseProcess.h:
  • Shared/WebCrossThreadCopier.cpp:

(WebCore::SecurityOriginData>::copy):

  • Shared/WebCrossThreadCopier.h:
  • UIProcess/WebOriginDataManagerProxy.cpp:

(WebKit::WebOriginDataManagerProxy::getOrigins):
(WebKit::WebOriginDataManagerProxy::didGetOrigins):
(WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
(WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates):
(WebKit::WebOriginDataManagerProxy::deleteAllEntries):

  • WebProcess/OriginData/WebOriginDataManager.cpp:

(WebKit::WebOriginDataManager::getOrigins): Pipe IDB requests through to the DatabaseProcess.
(WebKit::WebOriginDataManager::deleteEntriesForOrigin): Ditto.
(WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Ditto.
(WebKit::WebOriginDataManager::deleteAllEntries): Ditto.

Location:
trunk/Source
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r171747 r171749  
     12014-07-29  Brady Eidson  <beidson@apple.com>
     2
     3        Make WKOriginDataManager actually operate on IndexedDatabases.
     4        https://bugs.webkit.org/show_bug.cgi?id=135346
     5
     6        Reviewed by Sam Weinig (and David Kilzer and Alex Christensen)
     7
     8        * WebCore.exp.in:
     9
    1102014-07-29  Dan Bernstein  <mitz@apple.com>
    211
  • trunk/Source/WebCore/WebCore.exp.in

    r171747 r171749  
    10671067__ZN7WebCore37WidgetHierarchyUpdatesSuspensionScope35s_widgetHierarchyUpdateSuspendCountE
    10681068__ZN7WebCore3URL10invalidateEv
     1069__ZN7WebCore3URL11setProtocolERKN3WTF6StringE
     1070__ZN7WebCore3URL7setPathERKN3WTF6StringE
    10691071__ZN7WebCore3URLC1ENS_18ParsedURLStringTagERKN3WTF6StringE
    10701072__ZN7WebCore3URLC1EP5NSURL
  • trunk/Source/WebKit2/ChangeLog

    r171748 r171749  
     12014-07-29  Brady Eidson  <beidson@apple.com>
     2
     3        Make WKOriginDataManager actually operate on IndexedDatabases.
     4        https://bugs.webkit.org/show_bug.cgi?id=135346
     5
     6        Reviewed by Sam Weinig (and David Kilzer and Alex Christensen)
     7
     8        * DatabaseProcess/DatabaseProcess.cpp:
     9        (WebKit::DatabaseProcess::DatabaseProcess):
     10        (WebKit::DatabaseProcess::getIndexedDatabaseOrigins):
     11        (WebKit::DatabaseProcess::doGetIndexedDatabaseOrigins):
     12        (WebKit::removeAllDatabasesForOriginPath): Utility to delete all database files for the given origin path
     13            that have been modified between the given dates.
     14        (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
     15        (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin):
     16        (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates):
     17        (WebKit::DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates):
     18        (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries):
     19        (WebKit::DatabaseProcess::doDeleteAllIndexedDatabaseEntries):
     20        * DatabaseProcess/DatabaseProcess.h:
     21
     22        * Shared/WebCrossThreadCopier.cpp:
     23        (WebCore::SecurityOriginData>::copy):
     24        * Shared/WebCrossThreadCopier.h:
     25
     26        * UIProcess/WebOriginDataManagerProxy.cpp:
     27        (WebKit::WebOriginDataManagerProxy::getOrigins):
     28        (WebKit::WebOriginDataManagerProxy::didGetOrigins):
     29        (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin):
     30        (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates):
     31        (WebKit::WebOriginDataManagerProxy::deleteAllEntries):
     32
     33        * WebProcess/OriginData/WebOriginDataManager.cpp:
     34        (WebKit::WebOriginDataManager::getOrigins): Pipe IDB requests through to the DatabaseProcess.
     35        (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Ditto.
     36        (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Ditto.
     37        (WebKit::WebOriginDataManager::deleteAllEntries): Ditto.
     38
    1392014-07-29  Commit Queue  <commit-queue@webkit.org>
    240
  • trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.cpp

    r171622 r171749  
    3535#include "DatabaseToWebProcessConnection.h"
    3636#include "UniqueIDBDatabase.h"
     37#include "WebCrossThreadCopier.h"
    3738#include "WebOriginDataManager.h"
    3839#include "WebOriginDataManagerMessages.h"
     40#include "WebOriginDataManagerProxyMessages.h"
    3941#include <WebCore/FileSystem.h>
     42#include <WebCore/TextEncoding.h>
    4043#include <wtf/MainThread.h>
    4144
     
    5457    , m_webOriginDataManager(std::make_unique<WebOriginDataManager>(this))
    5558{
     59    // Make sure the UTF8Encoding encoding and the text encoding maps have been built on the main thread before a background thread needs it.
     60    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=135365 - Need a more explicit way of doing this besides accessing the UTF8Encoding.
     61    UTF8Encoding();
    5662}
    5763
     
    186192}
    187193
     194void DatabaseProcess::getIndexedDatabaseOrigins(uint64_t callbackID)
     195{
     196    postDatabaseTask(createAsyncTask(*this, &DatabaseProcess::doGetIndexedDatabaseOrigins, callbackID));
     197}
     198
     199void DatabaseProcess::doGetIndexedDatabaseOrigins(uint64_t callbackID)
     200{
     201    Vector<SecurityOriginData> results;
     202
     203    if (m_indexedDatabaseDirectory.isEmpty()) {
     204        send(Messages::WebOriginDataManagerProxy::DidGetOrigins(results, callbackID), 0);
     205        return;
     206    }
     207
     208    Vector<String> originPaths = listDirectory(m_indexedDatabaseDirectory, "*");
     209    for (auto& originPath : originPaths) {
     210        URL url;
     211        url.setProtocol(ASCIILiteral("file"));
     212        url.setPath(originPath);
     213
     214        String databaseIdentifier = url.lastPathComponent();
     215
     216        RefPtr<SecurityOrigin> securityOrigin = SecurityOrigin::maybeCreateFromDatabaseIdentifier(databaseIdentifier);
     217        if (!securityOrigin)
     218            continue;
     219
     220        results.append(SecurityOriginData::fromSecurityOrigin(securityOrigin.get()));
     221    }
     222
     223    send(Messages::WebOriginDataManagerProxy::DidGetOrigins(results, callbackID), 0);
     224}
     225
     226static void removeAllDatabasesForOriginPath(const String& originPath, double startDate, double endDate)
     227{
     228    // FIXME: We should also close/invalidate any live handles to the database files we are about to delete.
     229    // Right now:
     230    //     - For read-only operations, they will continue functioning as normal on the unlinked file.
     231    //     - For write operations, they will start producing errors as SQLite notices the missing backing store.
     232    // This is tracked by https://bugs.webkit.org/show_bug.cgi?id=135347
     233
     234    Vector<String> databasePaths = listDirectory(originPath, "*");
     235
     236    for (auto& databasePath : databasePaths) {
     237        String databaseFile = pathByAppendingComponent(databasePath, "IndexedDB.sqlite3");
     238
     239        if (!fileExists(databaseFile))
     240            continue;
     241
     242        time_t modTime;
     243        getFileModificationTime(databaseFile, modTime);
     244
     245        if (modTime < startDate || modTime > endDate)
     246            continue;
     247
     248        deleteFile(databaseFile);
     249        deleteEmptyDirectory(databasePath);
     250    }
     251
     252    deleteEmptyDirectory(originPath);
     253}
     254
     255void DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin(const SecurityOriginData& origin, uint64_t callbackID)
     256{
     257    postDatabaseTask(createAsyncTask(*this, &DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin, origin, callbackID));
     258}
     259
     260void DatabaseProcess::doDeleteIndexedDatabaseEntriesForOrigin(const SecurityOriginData& originData, uint64_t callbackID)
     261{
     262    if (m_indexedDatabaseDirectory.isEmpty()) {
     263        send(Messages::WebOriginDataManagerProxy::DidDeleteEntries(callbackID), 0);
     264        return;
     265    }
     266
     267    RefPtr<SecurityOrigin> origin = originData.securityOrigin();
     268    String databaseIdentifier = origin->databaseIdentifier();
     269    String originPath = pathByAppendingComponent(m_indexedDatabaseDirectory, databaseIdentifier);
     270
     271    removeAllDatabasesForOriginPath(originPath, std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max());
     272
     273    send(Messages::WebOriginDataManagerProxy::DidDeleteEntries(callbackID), 0);
     274}
     275
     276void DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates(double startDate, double endDate, uint64_t callbackID)
     277{
     278    postDatabaseTask(createAsyncTask(*this, &DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates, startDate, endDate, callbackID));
     279}
     280
     281void DatabaseProcess::doDeleteIndexedDatabaseEntriesModifiedBetweenDates(double startDate, double endDate, uint64_t callbackID)
     282{
     283    if (m_indexedDatabaseDirectory.isEmpty()) {
     284        send(Messages::WebOriginDataManagerProxy::DidDeleteEntries(callbackID), 0);
     285        return;
     286    }
     287
     288    Vector<String> originPaths = listDirectory(m_indexedDatabaseDirectory, "*");
     289    for (auto& originPath : originPaths)
     290        removeAllDatabasesForOriginPath(originPath, startDate, endDate);
     291
     292    send(Messages::WebOriginDataManagerProxy::DidDeleteEntries(callbackID), 0);
     293}
     294
     295void DatabaseProcess::deleteAllIndexedDatabaseEntries(uint64_t callbackID)
     296{
     297    postDatabaseTask(createAsyncTask(*this, &DatabaseProcess::doDeleteAllIndexedDatabaseEntries, callbackID));
     298}
     299
     300void DatabaseProcess::doDeleteAllIndexedDatabaseEntries(uint64_t callbackID)
     301{
     302    if (m_indexedDatabaseDirectory.isEmpty()) {
     303        send(Messages::WebOriginDataManagerProxy::DidDeleteAllEntries(callbackID), 0);
     304        return;
     305    }
     306
     307    Vector<String> originPaths = listDirectory(m_indexedDatabaseDirectory, "*");
     308    for (auto& originPath : originPaths)
     309        removeAllDatabasesForOriginPath(originPath, std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max());
     310
     311    send(Messages::WebOriginDataManagerProxy::DidDeleteAllEntries(callbackID), 0);
     312}
     313
    188314#if !PLATFORM(COCOA)
    189315void DatabaseProcess::initializeProcess(const ChildProcessInitializationParameters&)
  • trunk/Source/WebKit2/DatabaseProcess/DatabaseProcess.h

    r171622 r171749  
    6161    WorkQueue& queue() { return m_queue.get(); }
    6262
     63    void getIndexedDatabaseOrigins(uint64_t callbackID);
     64    void deleteIndexedDatabaseEntriesForOrigin(const SecurityOriginData&, uint64_t callbackID);
     65    void deleteIndexedDatabaseEntriesModifiedBetweenDates(double startDate, double endDate, uint64_t callbackID);
     66    void deleteAllIndexedDatabaseEntries(uint64_t callbackID);
     67
    6368private:
    6469    DatabaseProcess();
     
    8691    void performNextDatabaseTask();
    8792    void ensurePathExists(const String&);
     93    void doGetIndexedDatabaseOrigins(uint64_t callbackID);
     94    void doDeleteIndexedDatabaseEntriesForOrigin(const SecurityOriginData&, uint64_t callbackID);
     95    void doDeleteIndexedDatabaseEntriesModifiedBetweenDates(double startDate, double endDate, uint64_t callbackID);
     96    void doDeleteAllIndexedDatabaseEntries(uint64_t callbackID);
    8897
    8998    Vector<RefPtr<DatabaseToWebProcessConnection>> m_databaseToWebProcessConnections;
  • trunk/Source/WebKit2/Shared/WebCrossThreadCopier.cpp

    r163959 r171749  
    2929
    3030#include "IDBIdentifier.h"
     31#include "SecurityOriginData.h"
    3132#include "UniqueIDBDatabaseIdentifier.h"
    3233#include <WebCore/IDBKeyData.h>
     
    8081}
    8182
     83SecurityOriginData CrossThreadCopierBase<false, false, SecurityOriginData>::copy(const SecurityOriginData& securityOriginData)
     84{
     85    return securityOriginData.isolatedCopy();
     86}
     87
    8288ASCIILiteral CrossThreadCopierBase<false, false, ASCIILiteral>::copy(const ASCIILiteral& literal)
    8389{
  • trunk/Source/WebKit2/Shared/WebCrossThreadCopier.h

    r163266 r171749  
    3737
    3838enum class UniqueIDBDatabaseShutdownType;
     39
     40struct SecurityOriginData;
    3941}
    4042
     
    5961        return type;
    6062    }
     63};
     64
     65template<> struct CrossThreadCopierBase<false, false, WebKit::SecurityOriginData> {
     66    static WebKit::SecurityOriginData copy(const WebKit::SecurityOriginData& type);
    6167};
    6268
  • trunk/Source/WebKit2/UIProcess/WebOriginDataManagerProxy.cpp

    r171622 r171749  
    3232#include "WebOriginDataManagerProxyMessages.h"
    3333#include "WebSecurityOrigin.h"
     34#include <WebCore/SecurityOrigin.h>
     35#include <wtf/NeverDestroyed.h>
     36
     37using namespace WebCore;
    3438
    3539namespace WebKit {
     
    8387void WebOriginDataManagerProxy::getOrigins(WKOriginDataTypes types, std::function<void (API::Array*, CallbackBase::Error)> callbackFunction)
    8488{
     89    // FIXME: Right now we only support IndexedDatabase data so we know that we're only sending this request to the DatabaseProcess.
     90    // That's why having one single callback works.
     91    // In the future when we message N-processes we'll have to wait for all N replies before responding to the client.
     92    if (!(types & kWKIndexedDatabaseData)) {
     93        callbackFunction(nullptr, CallbackBase::Error::None);
     94        return;
     95    }
     96
    8597    RefPtr<ArrayCallback> callback = ArrayCallback::create(WTF::move(callbackFunction));
    8698
     
    93105    m_arrayCallbacks.set(callbackID, callback.release());
    94106
    95     // FIXME (Multi-WebProcess): <rdar://problem/12239765> Make manipulating cache information work with per-tab WebProcess.
    96     context()->sendToAllProcessesRelaunchingThemIfNecessary(Messages::WebOriginDataManager::GetOrigins(types, callbackID));
    97 }
    98 
    99 void WebOriginDataManagerProxy::didGetOrigins(const Vector<SecurityOriginData>& originDatas, uint64_t callbackID)
     107    context()->sendToDatabaseProcessRelaunchingIfNecessary(Messages::WebOriginDataManager::GetOrigins(types, callbackID));
     108}
     109
     110void WebOriginDataManagerProxy::didGetOrigins(IPC::Connection* connection, const Vector<SecurityOriginData>& originIdentifiers, uint64_t callbackID)
    100111{
    101112    RefPtr<ArrayCallback> callback = m_arrayCallbacks.take(callbackID);
    102     performAPICallbackWithSecurityOriginDataVector(originDatas, callback.get());
     113    MESSAGE_CHECK_BASE(callback, connection);
     114
     115    Vector<RefPtr<API::Object>> securityOrigins;
     116    securityOrigins.reserveInitialCapacity(originIdentifiers.size());
     117
     118    for (const auto& originIdentifier : originIdentifiers)
     119        securityOrigins.uncheckedAppend(WebSecurityOrigin::create(originIdentifier.securityOrigin()));
     120
     121    callback->performCallbackWithReturnValue(API::Array::create(WTF::move(securityOrigins)).get());
    103122}
    104123
    105124void WebOriginDataManagerProxy::deleteEntriesForOrigin(WKOriginDataTypes types, WebSecurityOrigin* origin, std::function<void (CallbackBase::Error)> callbackFunction)
    106125{
    107     if (!(types & kWKIndexedDatabaseData))
    108         return;
    109 
    110     // FIXME: Right now we only support IndexedDatabase data so we know that we're only sending this request to the DatabaseProcess.
    111     // That's why having one single callback works.
    112     // In the future when we message N-processes we'll have to wait for all N replies before responding to the client.
     126    // FIXME: Right now we only support IndexedDatabase data so we know that we're only sending this request to the DatabaseProcess.
     127    // That's why having one single callback works.
     128    // In the future when we message N-processes we'll have to wait for all N replies before responding to the client.
     129    if (!(types & kWKIndexedDatabaseData)) {
     130        callbackFunction(CallbackBase::Error::None);
     131        return;
     132    }
    113133
    114134    RefPtr<VoidCallback> callback = VoidCallback::create(WTF::move(callbackFunction));
     
    132152void WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates(WKOriginDataTypes types, double startDate, double endDate, std::function<void (CallbackBase::Error)> callbackFunction)
    133153{
    134     if (!(types & kWKIndexedDatabaseData))
    135         return;
    136 
    137     // FIXME: Right now we only support IndexedDatabase data so we know that we're only sending this request to the DatabaseProcess.
    138     // That's why having one single callback works.
    139     // In the future when we message N-processes we'll have to wait for all N replies before responding to the client.
     154    // FIXME: Right now we only support IndexedDatabase data so we know that we're only sending this request to the DatabaseProcess.
     155    // That's why having one single callback works.
     156    // In the future when we message N-processes we'll have to wait for all N replies before responding to the client.
     157    if (!(types & kWKIndexedDatabaseData)) {
     158        callbackFunction(CallbackBase::Error::None);
     159        return;
     160    }
    140161
    141162    RefPtr<VoidCallback> callback = VoidCallback::create(WTF::move(callbackFunction));
     
    152173}
    153174
    154 void WebOriginDataManagerProxy::didDeleteEntries(uint64_t callbackID)
     175void WebOriginDataManagerProxy::didDeleteEntries(IPC::Connection* connection, uint64_t callbackID)
    155176{
    156177    RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID);
     178    MESSAGE_CHECK_BASE(callback, connection);
    157179    callback->performCallback();
    158180}
     
    160182void WebOriginDataManagerProxy::deleteAllEntries(WKOriginDataTypes types, std::function<void (CallbackBase::Error)> callbackFunction)
    161183{
    162     if (!(types & kWKIndexedDatabaseData))
    163         return;
    164 
    165     // FIXME: Right now we only support IndexedDatabase data so we know that we're only sending this request to the DatabaseProcess.
    166     // That's why having one single callback works.
    167     // In the future when we message N-processes we'll have to wait for all N replies before responding to the client.
     184    // FIXME: Right now we only support IndexedDatabase data so we know that we're only sending this request to the DatabaseProcess.
     185    // That's why having one single callback works.
     186    // In the future when we message N-processes we'll have to wait for all N replies before responding to the client.
     187    if (!(types & kWKIndexedDatabaseData)) {
     188        callbackFunction(CallbackBase::Error::None);
     189        return;
     190    }
    168191
    169192    RefPtr<VoidCallback> callback = VoidCallback::create(WTF::move(callbackFunction));
     
    180203}
    181204
    182 void WebOriginDataManagerProxy::didDeleteAllEntries(uint64_t callbackID)
     205void WebOriginDataManagerProxy::didDeleteAllEntries(IPC::Connection* connection, uint64_t callbackID)
    183206{
    184207    RefPtr<VoidCallback> callback = m_voidCallbacks.take(callbackID);
     208    MESSAGE_CHECK_BASE(callback, connection);
    185209    callback->performCallback();
    186210}
  • trunk/Source/WebKit2/UIProcess/WebOriginDataManagerProxy.h

    r171622 r171749  
    6868    explicit WebOriginDataManagerProxy(WebContext*);
    6969
    70     void didGetOrigins(const Vector<SecurityOriginData>&, uint64_t callbackID);
    71     void didDeleteEntries(uint64_t callbackID);
    72     void didDeleteAllEntries(uint64_t callbackID);
     70    void didGetOrigins(IPC::Connection*, const Vector<SecurityOriginData>&, uint64_t callbackID);
     71    void didDeleteEntries(IPC::Connection*, uint64_t callbackID);
     72    void didDeleteAllEntries(IPC::Connection*, uint64_t callbackID);
    7373
    7474    // WebContextSupplement
  • trunk/Source/WebKit2/UIProcess/WebOriginDataManagerProxy.messages.in

    r171622 r171749  
    2222
    2323messages -> WebOriginDataManagerProxy {
    24     DidGetOrigins(Vector<WebKit::SecurityOriginData> originIdentifiers, uint64_t callbackID);
    25     DidDeleteEntries(uint64_t callbackID);
    26     DidDeleteAllEntries(uint64_t callbackID);
     24    DidGetOrigins(Vector<WebKit::SecurityOriginData> originIdentifiers, uint64_t callbackID) WantsConnection
     25    DidDeleteEntries(uint64_t callbackID) WantsConnection
     26    DidDeleteAllEntries(uint64_t callbackID) WantsConnection
    2727}
  • trunk/Source/WebKit2/WebProcess/OriginData/WebOriginDataManager.cpp

    r171622 r171749  
    2727#include "WebOriginDataManager.h"
    2828
    29 #include "ChildProcess.h"
     29#include "DatabaseProcess.h"
    3030#include "SecurityOriginData.h"
    3131#include "WebCoreArgumentCoders.h"
     
    5252}
    5353
    54 void WebOriginDataManager::getOrigins(WKOriginDataTypes, uint64_t callbackID)
     54void WebOriginDataManager::getOrigins(WKOriginDataTypes types, uint64_t callbackID)
    5555{
    56     HashSet<RefPtr<SecurityOrigin>> origins;
    57 
    58     // FIXME: populate origins
    59 
    60     Vector<SecurityOriginData> identifiers;
    61     identifiers.reserveCapacity(origins.size());
    62 
    63     HashSet<RefPtr<SecurityOrigin>>::iterator end = origins.end();
    64     HashSet<RefPtr<SecurityOrigin>>::iterator i = origins.begin();
    65     for (; i != end; ++i) {
    66         RefPtr<SecurityOrigin> origin = *i;
    67 
    68         SecurityOriginData originData;
    69         originData.protocol = origin->protocol();
    70         originData.host = origin->host();
    71         originData.port = origin->port();
    72 
    73         identifiers.uncheckedAppend(originData);
     56    // FIXME: For now, the DatabaseProcess only handles IndexedDatabase origin data.
     57    // If it ever starts handling other data types (e.g. WebSQL) then it will have to aggregrate requests
     58    // for multiple types into the one callback.
     59    if (types & kWKIndexedDatabaseData) {
     60        DatabaseProcess::shared().getIndexedDatabaseOrigins(callbackID);
     61        return;
    7462    }
    7563
    76     m_childProcess->send(Messages::WebOriginDataManagerProxy::DidGetOrigins(identifiers, callbackID), 0);
     64    Vector<SecurityOriginData> results;
     65    m_childProcess->send(Messages::WebOriginDataManagerProxy::DidGetOrigins(results, callbackID), 0);
    7766}
    7867
    79 void WebOriginDataManager::deleteEntriesForOrigin(WKOriginDataTypes, const SecurityOriginData& origindata, uint64_t callbackID)
     68void WebOriginDataManager::deleteEntriesForOrigin(WKOriginDataTypes types, const SecurityOriginData& originData, uint64_t callbackID)
    8069{
    81     // FIXME: delete entries for origin
    82     m_childProcess->send(Messages::WebOriginDataManagerProxy::DidDeleteEntries(callbackID), 0);
    83 }
    84 
    85 void WebOriginDataManager::deleteEntriesModifiedBetweenDates(WKOriginDataTypes, double, double, uint64_t callbackID)
    86 {
    87     // FIXME: delete entries modified between the start and end date
     70    // FIXME: For now, the DatabaseProcess only handles IndexedDatabase origin data.
     71    // If it ever starts handling other data types (e.g. WebSQL) then it will have to aggregrate requests
     72    // for multiple types into the one callback.
     73    if (types & kWKIndexedDatabaseData) {
     74        DatabaseProcess::shared().deleteIndexedDatabaseEntriesForOrigin(originData, callbackID);
     75        return;
     76    }
    8877
    8978    m_childProcess->send(Messages::WebOriginDataManagerProxy::DidDeleteEntries(callbackID), 0);
    9079}
    9180
    92 void WebOriginDataManager::deleteAllEntries(WKOriginDataTypes, uint64_t callbackID)
     81void WebOriginDataManager::deleteEntriesModifiedBetweenDates(WKOriginDataTypes types, double startTime, double endTime, uint64_t callbackID)
    9382{
    94     // FIXME: delete entries
     83    // FIXME: For now, the DatabaseProcess only handles IndexedDatabase origin data.
     84    // If it ever starts handling other data types (e.g. WebSQL) then it will have to aggregrate requests
     85    // for multiple types into the one callback.
     86    if (types & kWKIndexedDatabaseData) {
     87        DatabaseProcess::shared().deleteIndexedDatabaseEntriesModifiedBetweenDates(startTime, endTime, callbackID);
     88        return;
     89    }
     90    m_childProcess->send(Messages::WebOriginDataManagerProxy::DidDeleteEntries(callbackID), 0);
     91}
    9592
     93void WebOriginDataManager::deleteAllEntries(WKOriginDataTypes types, uint64_t callbackID)
     94{
     95    // FIXME: For now, the DatabaseProcess only handles IndexedDatabase origin data.
     96    // If it ever starts handling other data types (e.g. WebSQL) then it will have to aggregrate requests
     97    // for multiple types into the one callback.
     98    if (types & kWKIndexedDatabaseData) {
     99        DatabaseProcess::shared().deleteAllIndexedDatabaseEntries(callbackID);
     100        return;
     101    }
    96102    m_childProcess->send(Messages::WebOriginDataManagerProxy::DidDeleteAllEntries(callbackID), 0);
    97103}
Note: See TracChangeset for help on using the changeset viewer.