Changeset 64151 in webkit


Ignore:
Timestamp:
Jul 27, 2010 1:07:42 PM (14 years ago)
Author:
dumi@chromium.org
Message:

Move all WebSQLDatabases-specific code behind #if ENABLE(DATABASE).
https://bugs.webkit.org/show_bug.cgi?id=43035

Reviewed by David Levin.

WebCore:

Make Chromium compile with ENABLE_DATABASE=0. The #ifdefs in
DatabaseAuthorizer and ChromiumBridge are removed, because they're
used by non-HTML5 DBs too (the classes in WebCore/platform/sql/),
which are used by other features too. So they need to be compiled
in even if HTML5 DBs are disabled.

  • bindings/v8/custom/V8DOMWindowCustom.cpp:
  • page/DOMWindow.idl:
  • platform/chromium/ChromiumBridge.h:
  • storage/DatabaseAuthorizer.cpp:
  • storage/chromium/DatabaseObserver.h:
  • storage/chromium/DatabaseTrackerChromium.cpp:
  • storage/chromium/QuotaTracker.cpp:
  • storage/chromium/QuotaTracker.h:
  • storage/chromium/SQLTransactionClientChromium.cpp:

WebKit/chromium:

Make Chromium compile with ENABLE_DATABASE=0.

  • src/ChromiumBridge.cpp:

(WebCore::ChromiumBridge::databaseGetFileSize):

  • src/DatabaseObserver.cpp:
  • src/WebDatabase.cpp:

(WebCore::AbstractDatabase::stringIdentifier):
(WebCore::AbstractDatabase::displayName):
(WebCore::AbstractDatabase::estimatedSize):
(WebCore::AbstractDatabase::securityOrigin):
(WebKit::WebDatabase::updateDatabaseSize):
(WebKit::WebDatabase::closeDatabaseImmediately):

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r64149 r64151  
     12010-07-27  Dumitru Daniliuc  <dumi@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Move all WebSQLDatabases-specific code behind #if ENABLE(DATABASE).
     6        https://bugs.webkit.org/show_bug.cgi?id=43035
     7
     8        Make Chromium compile with ENABLE_DATABASE=0. The #ifdefs in
     9        DatabaseAuthorizer and ChromiumBridge are removed, because they're
     10        used by non-HTML5 DBs too (the classes in WebCore/platform/sql/),
     11        which are used by other features too. So they need to be compiled
     12        in even if HTML5 DBs are disabled.
     13
     14        * bindings/v8/custom/V8DOMWindowCustom.cpp:
     15        * page/DOMWindow.idl:
     16        * platform/chromium/ChromiumBridge.h:
     17        * storage/DatabaseAuthorizer.cpp:
     18        * storage/chromium/DatabaseObserver.h:
     19        * storage/chromium/DatabaseTrackerChromium.cpp:
     20        * storage/chromium/QuotaTracker.cpp:
     21        * storage/chromium/QuotaTracker.h:
     22        * storage/chromium/SQLTransactionClientChromium.cpp:
     23
    1242010-07-27  Chris Fleizach  <cfleizach@apple.com>
    225
  • trunk/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

    r62380 r64151  
    791791}
    792792
     793#if ENABLE(DATABASE)
    793794v8::Handle<v8::Value> V8DOMWindow::openDatabaseCallback(const v8::Arguments& args)
    794795{
     
    820821    return result;
    821822}
     823#endif // ENABLE(DATABASE)
    822824
    823825bool V8DOMWindow::namedSecurityCheck(v8::Local<v8::Object> host, v8::Local<v8::Value> key, v8::AccessType type, v8::Local<v8::Value>)
  • trunk/WebCore/page/DOMWindow.idl

    r64141 r64151  
    742742#endif
    743743
    744 #if defined(ENABLE_DATABASE)
    745         attribute SQLExceptionConstructor SQLException;
    746 #endif
     744        attribute [Conditional=DATABASE] SQLExceptionConstructor SQLException;
    747745
    748746        attribute [Conditional=TOUCH_EVENTS] TouchEventConstructor TouchEvent;
  • trunk/WebCore/platform/chromium/ChromiumBridge.h

    r63589 r64151  
    156156        static GeolocationServiceBridge* createGeolocationServiceBridge(GeolocationServiceChromium*);
    157157
    158         // HTML5 DB -----------------------------------------------------------
    159 #if ENABLE(DATABASE)
     158        // Databases ----------------------------------------------------------
    160159        // Returns a handle to the DB file and ooptionally a handle to its containing directory
    161160        static PlatformFileHandle databaseOpenFile(const String& vfsFleName, int desiredFlags);
     
    166165        // Returns the size of the DB file
    167166        static long long databaseGetFileSize(const String& vfsFileName);
    168 #endif
    169167
    170168        // IndexedDB ----------------------------------------------------------
  • trunk/WebCore/storage/DatabaseAuthorizer.cpp

    r63278 r64151  
    3030#include "DatabaseAuthorizer.h"
    3131
    32 #if ENABLE(DATABASE)
    3332#include "PlatformString.h"
    3433#include <wtf/PassRefPtr.h>
     
    421420
    422421} // namespace WebCore
    423 
    424 #endif // ENABLE(DATABASE)
  • trunk/WebCore/storage/chromium/DatabaseObserver.h

    r61154 r64151  
    3232#define DatabaseObserver_h
    3333
     34#if ENABLE(DATABASE)
     35
    3436namespace WebCore {
    3537
     
    5052}
    5153
     54#endif // ENABLE(DATABASE)
     55
    5256#endif // DatabaseObserver_h
  • trunk/WebCore/storage/chromium/DatabaseTrackerChromium.cpp

    r63479 r64151  
    3131#include "config.h"
    3232#include "DatabaseTracker.h"
     33
     34#if ENABLE(DATABASE)
    3335
    3436#include "AbstractDatabase.h"
     
    174176
    175177}
     178
     179#endif // ENABLE(DATABASE)
  • trunk/WebCore/storage/chromium/QuotaTracker.cpp

    r56825 r64151  
    3232#include "QuotaTracker.h"
    3333
     34#if ENABLE(DATABASE)
     35
    3436#include <wtf/StdLibExtras.h>
    35 #include <wtf/text/CString.h>
    3637
    3738namespace WebCore {
     
    6869
    6970}
     71
     72#endif // ENABLE(DATABASE)
  • trunk/WebCore/storage/chromium/QuotaTracker.h

    r56825 r64151  
    3232#define QuotaTracker_h
    3333
     34#if ENABLE(DATABASE)
     35
     36#include "PlatformString.h"
    3437#include "SecurityOrigin.h"
    3538#include "StringHash.h"
    3639#include <wtf/HashMap.h>
    37 #include <wtf/text/CString.h>
    3840
    3941namespace WebCore {
     
    6163}
    6264
     65#endif // ENABLE(DATABASE)
     66
    6367#endif // QuotaTracker_h
  • trunk/WebCore/storage/chromium/SQLTransactionClientChromium.cpp

    r63278 r64151  
    3131#include "config.h"
    3232#include "SQLTransactionClient.h"
     33
     34#if ENABLE(DATABASE)
    3335
    3436#include "AbstractDatabase.h"
     
    8486
    8587}
     88
     89#endif // ENABLE(DATABASE)
  • trunk/WebKit/chromium/ChangeLog

    r64133 r64151  
     12010-07-27  Dumitru Daniliuc  <dumi@chromium.org>
     2
     3        Reviewed by David Levin.
     4
     5        Move all WebSQLDatabases-specific code behind #if ENABLE(DATABASE).
     6        https://bugs.webkit.org/show_bug.cgi?id=43035
     7
     8        Make Chromium compile with ENABLE_DATABASE=0.
     9
     10        * src/ChromiumBridge.cpp:
     11        (WebCore::ChromiumBridge::databaseGetFileSize):
     12        * src/DatabaseObserver.cpp:
     13        * src/WebDatabase.cpp:
     14        (WebCore::AbstractDatabase::stringIdentifier):
     15        (WebCore::AbstractDatabase::displayName):
     16        (WebCore::AbstractDatabase::estimatedSize):
     17        (WebCore::AbstractDatabase::securityOrigin):
     18        (WebKit::WebDatabase::updateDatabaseSize):
     19        (WebKit::WebDatabase::closeDatabaseImmediately):
     20
    1212010-07-27  Pavel Podivilov  <podivilov@chromium.org>
    222
  • trunk/WebKit/chromium/src/ChromiumBridge.cpp

    r63589 r64151  
    470470}
    471471
    472 // HTML5 DB -------------------------------------------------------------------
    473 
    474 #if ENABLE(DATABASE)
     472// Databases ------------------------------------------------------------------
     473
    475474PlatformFileHandle ChromiumBridge::databaseOpenFile(const String& vfsFileName, int desiredFlags)
    476475{
     
    492491    return webKitClient()->databaseGetFileSize(WebString(vfsFileName));
    493492}
    494 #endif
    495493
    496494// Indexed Database -----------------------------------------------------------
  • trunk/WebKit/chromium/src/DatabaseObserver.cpp

    r61154 r64151  
    3131#include "config.h"
    3232#include "DatabaseObserver.h"
     33
     34#if ENABLE(DATABASE)
    3335
    3436#include "AbstractDatabase.h"
     
    8587
    8688} // namespace WebCore
     89
     90#endif // ENABLE(DATABASE)
  • trunk/WebKit/chromium/src/WebDatabase.cpp

    r62153 r64151  
    4040#include <wtf/PassRefPtr.h>
    4141#include <wtf/RefPtr.h>
     42
     43#if !ENABLE(DATABASE)
     44namespace WebCore {
     45class AbstractDatabase {
     46public:
     47    String stringIdentifier() const { return String(); }
     48    String displayName() const { return String(); }
     49    unsigned long long estimatedSize() const { return 0; }
     50    SecurityOrigin* securityOrigin() const { return 0; }
     51};
     52}
     53#endif // !ENABLE(DATABASE)
    4254
    4355using namespace WebCore;
     
    8597    unsigned long long databaseSize, unsigned long long spaceAvailable)
    8698{
     99#if ENABLE(DATABASE)
    87100    WebCore::QuotaTracker::instance().updateDatabaseSizeAndSpaceAvailableToOrigin(
    88101        originIdentifier, databaseName, databaseSize, spaceAvailable);
     102#endif // ENABLE(DATABASE)
    89103}
    90104
    91105void WebDatabase::closeDatabaseImmediately(const WebString& originIdentifier, const WebString& databaseName)
    92106{
     107#if ENABLE(DATABASE)
    93108    HashSet<RefPtr<AbstractDatabase> > databaseHandles;
    94109    RefPtr<SecurityOrigin> origin = SecurityOrigin::createFromDatabaseIdentifier(originIdentifier);
     
    96111    for (HashSet<RefPtr<AbstractDatabase> >::iterator it = databaseHandles.begin(); it != databaseHandles.end(); ++it)
    97112        it->get()->closeImmediately();
     113#endif // ENABLE(DATABASE)
    98114}
    99115
Note: See TracChangeset for help on using the changeset viewer.