Changeset 109463 in webkit


Ignore:
Timestamp:
Mar 1, 2012 4:25:40 PM (12 years ago)
Author:
abarth@webkit.org
Message:

Remove last ENABLED(INDEXED_DATABASE) ifdef from WebCore proper
https://bugs.webkit.org/show_bug.cgi?id=80061

Reviewed by Dimitri Glazkov.

This patch removes the last ENABLED(INDEXED_DATABASE) ifdef from
WebCore proper by moving the backend factory out of PageGroup and into
a supplement for PageGroup. After this patch, we're ready to move the
IDB code into Modules.

  • Modules/indexeddb/DOMWindowIndexedDatabase.cpp:

(WebCore::DOMWindowIndexedDatabase::webkitIndexedDB):

  • WebCore.gypi:
  • inspector/InspectorIndexedDBAgent.cpp:

(WebCore::assertIDBFactory):

  • page/PageGroup.cpp:

(WebCore):

  • page/PageGroup.h:

(PageGroup):

Location:
trunk/Source/WebCore
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109459 r109463  
     12012-03-01  Adam Barth  <abarth@webkit.org>
     2
     3        Remove last ENABLED(INDEXED_DATABASE) ifdef from WebCore proper
     4        https://bugs.webkit.org/show_bug.cgi?id=80061
     5
     6        Reviewed by Dimitri Glazkov.
     7
     8        This patch removes the last ENABLED(INDEXED_DATABASE) ifdef from
     9        WebCore proper by moving the backend factory out of PageGroup and into
     10        a supplement for PageGroup.  After this patch, we're ready to move the
     11        IDB code into Modules.
     12
     13        * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
     14        (WebCore::DOMWindowIndexedDatabase::webkitIndexedDB):
     15        * WebCore.gypi:
     16        * inspector/InspectorIndexedDBAgent.cpp:
     17        (WebCore::assertIDBFactory):
     18        * page/PageGroup.cpp:
     19        (WebCore):
     20        * page/PageGroup.h:
     21        (PageGroup):
     22
    1232012-03-01  Dale Curtis  <dalecurtis@chromium.org>
    224
  • trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.cpp

    r109392 r109463  
    1111 *    documentation and/or other materials provided with the distribution.
    1212 *
    13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
     13 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
    1414 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1515 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     
    3333#include "IDBFactory.h"
    3434#include "Page.h"
    35 #include "PageGroup.h"
     35#include "PageGroupIndexedDatabase.h"
    3636#include "SecurityOrigin.h"
    3737
     
    8484
    8585    if (!m_idbFactory && m_window->isCurrentlyDisplayedInFrame())
    86         m_idbFactory = IDBFactory::create(page->group().idbFactory());
     86        m_idbFactory = IDBFactory::create(PageGroupIndexedDatabase::from(page->group())->factoryBackend());
    8787    return m_idbFactory.get();
    8888}
  • trunk/Source/WebCore/Modules/indexeddb/DOMWindowIndexedDatabase.h

    r109392 r109463  
    1111 *    documentation and/or other materials provided with the distribution.
    1212 *
    13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
     13 * THIS SOFTWARE IS PROVIDED BY GOOGLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
    1414 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    1515 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  • trunk/Source/WebCore/WebCore.gypi

    r109451 r109463  
    12971297            'Modules/indexeddb/DOMWindowIndexedDatabase.cpp',
    12981298            'Modules/indexeddb/DOMWindowIndexedDatabase.h',
     1299            'Modules/indexeddb/PageGroupIndexedDatabase.cpp',
     1300            'Modules/indexeddb/PageGroupIndexedDatabase.h',
    12991301            'Modules/intents/Intent.cpp',
    13001302            'Modules/intents/Intent.h',
  • trunk/Source/WebCore/inspector/InspectorIndexedDBAgent.cpp

    r108495 r109463  
    5959#include "Page.h"
    6060#include "PageGroup.h"
     61#include "PageGroupIndexedDatabase.h"
    6162#include "SecurityOrigin.h"
    6263
     
    634635{
    635636    Page* page = document ? document->page() : 0;
    636     IDBFactoryBackendInterface* idbFactory = page ? page->group().idbFactory() : 0;
     637    IDBFactoryBackendInterface* idbFactory = page ? PageGroupIndexedDatabase::from(page->group())->factoryBackend() : 0;
    637638
    638639    if (!idbFactory)
  • trunk/Source/WebCore/page/PageGroup.cpp

    r103793 r109463  
    262262}
    263263
    264 #if ENABLE(INDEXED_DATABASE)
    265 IDBFactoryBackendInterface* PageGroup::idbFactory()
    266 {
    267     // Do not add page setting based access control here since this object is shared by all pages in
    268     // the group and having per-page controls is misleading.
    269     if (!m_factoryBackend)
    270         m_factoryBackend = IDBFactoryBackendInterface::create();
    271     return m_factoryBackend.get();
    272 }
    273 #endif
    274 
    275264void PageGroup::addUserScriptToWorld(DOMWrapperWorld* world, const String& source, const KURL& url,
    276265                                     PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
  • trunk/Source/WebCore/page/PageGroup.h

    r103365 r109463  
    3030#include <wtf/Noncopyable.h>
    3131#include "LinkHash.h"
     32#include "Supplementable.h"
    3233#include "UserScript.h"
    3334#include "UserStyleSheet.h"
     
    4344    class StorageNamespace;
    4445
    45     class PageGroup {
     46    class PageGroup : public Supplementable<PageGroup> {
    4647        WTF_MAKE_NONCOPYABLE(PageGroup); WTF_MAKE_FAST_ALLOCATED;
    4748    public:
     
    8283        bool hasLocalStorage() { return m_localStorage; }
    8384
    84 #if ENABLE(INDEXED_DATABASE)
    85         IDBFactoryBackendInterface* idbFactory();
    86         bool hasIDBFactory() { return m_factoryBackend; }
    87 #endif
    88 
    8985        void addUserScriptToWorld(DOMWrapperWorld*, const String& source, const KURL&,
    9086                                  PassOwnPtr<Vector<String> > whitelist, PassOwnPtr<Vector<String> > blacklist,
     
    123119        unsigned m_identifier;
    124120        RefPtr<StorageNamespace> m_localStorage;
    125 #if ENABLE(INDEXED_DATABASE)
    126         RefPtr<IDBFactoryBackendInterface> m_factoryBackend;
    127 #endif
    128121
    129122        OwnPtr<UserScriptMap> m_userScripts;
Note: See TracChangeset for help on using the changeset viewer.