diff options
90 files changed, 391 insertions, 37 deletions
diff --git a/V8Binding/scripts/CodeGeneratorV8.pm b/V8Binding/scripts/CodeGeneratorV8.pm index ae5209d..541d17b 100644 --- a/V8Binding/scripts/CodeGeneratorV8.pm +++ b/V8Binding/scripts/CodeGeneratorV8.pm @@ -265,7 +265,13 @@ sub GenerateHeader } elsif (IsWorkerClassName($className)) { push(@headerContent, "\n#if ENABLE(WORKERS)\n"); } - + + my $conditionalString; + if ($conditional) { + $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")"; + push(@headerContent, "\n#if ${conditionalString}\n\n"); + } + push(@headerContent, "\n#ifndef $className" . "_H"); push(@headerContent, "\n#define $className" . "_H\n\n"); @@ -315,6 +321,8 @@ END } elsif (IsWorkerClassName($className)) { push(@headerContent, "\n#endif // ENABLE(WORKERS)\n"); } + + push(@headerContent, "#endif // ${conditionalString}\n\n") if $conditional; } @@ -1044,6 +1052,12 @@ sub GenerateImplementation } elsif (IsWorkerClassName($className)) { push(@implFixedHeader, "#if ENABLE(WORKERS)\n\n"); } + + my $conditionalString; + if ($conditional) { + $conditionalString = "ENABLE(" . join(") && ENABLE(", split(/&/, $conditional)) . ")"; + push(@implFixedHeader, "\n#if ${conditionalString}\n\n"); + } if ($className =~ /^V8SVGAnimated/) { AddIncludesForSVGAnimatedType($interfaceName); @@ -1374,6 +1388,7 @@ END } elsif (IsWorkerClassName($className)) { push(@implContent, "\n#endif // ENABLE(WORKERS)\n"); } + push(@implContent, "\n#endif // ${conditionalString}\n") if $conditional; } diff --git a/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp b/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp index 8733696..4b9ff8a 100644 --- a/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp +++ b/WebCore/bindings/js/JSCustomSQLStatementCallback.cpp @@ -28,6 +28,7 @@ #include "config.h" #include "JSCustomSQLStatementCallback.h" +#if ENABLE(DATABASE) #include "Frame.h" #include "ScriptController.h" @@ -90,3 +91,5 @@ void JSCustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLR } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/bindings/js/JSCustomSQLStatementCallback.h b/WebCore/bindings/js/JSCustomSQLStatementCallback.h index 3a3ae21..c380670 100644 --- a/WebCore/bindings/js/JSCustomSQLStatementCallback.h +++ b/WebCore/bindings/js/JSCustomSQLStatementCallback.h @@ -29,6 +29,8 @@ #ifndef JSCustomSQLStatementCallback_h #define JSCustomSQLStatementCallback_h +#if ENABLE(DATABASE) + #include "SQLStatementCallback.h" #include <runtime/JSObject.h> @@ -59,4 +61,6 @@ private: } +#endif // ENABLE(DATABASE) + #endif // JSCustomSQLStatementCallback_h diff --git a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp index dd23889..2932919 100644 --- a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp +++ b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "JSCustomSQLStatementErrorCallback.h" +#if ENABLE(DATABASE) + #include "Frame.h" #include "ScriptController.h" #include "JSSQLError.h" @@ -102,3 +104,5 @@ bool JSCustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h index 2847114..e563393 100644 --- a/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h +++ b/WebCore/bindings/js/JSCustomSQLStatementErrorCallback.h @@ -29,6 +29,8 @@ #ifndef JSCustomSQLStatementErrorCallback_h #define JSCustomSQLStatementErrorCallback_h +#if ENABLE(DATABASE) + #include "SQLStatementErrorCallback.h" #include <runtime/JSObject.h> @@ -59,5 +61,7 @@ private: } +#endif // ENABLE(DATABASE) + #endif // JSCustomSQLStatementErrorCallback_h diff --git a/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp b/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp index 9960a0e..9918e71 100644 --- a/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp +++ b/WebCore/bindings/js/JSCustomSQLTransactionCallback.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "JSCustomSQLTransactionCallback.h" +#if ENABLE(DATABASE) + #include "Frame.h" #include "ScriptController.h" #include "JSSQLTransaction.h" @@ -134,3 +136,5 @@ void JSCustomSQLTransactionCallback::handleEvent(SQLTransaction* transaction, bo } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/bindings/js/JSCustomSQLTransactionCallback.h b/WebCore/bindings/js/JSCustomSQLTransactionCallback.h index 0a21c1a..22c367c 100644 --- a/WebCore/bindings/js/JSCustomSQLTransactionCallback.h +++ b/WebCore/bindings/js/JSCustomSQLTransactionCallback.h @@ -29,6 +29,8 @@ #ifndef JSCustomSQLTransactionCallback_h #define JSCustomSQLTransactionCallback_h +#if ENABLE(DATABASE) + #include "SQLTransactionCallback.h" #include <wtf/PassRefPtr.h> @@ -60,4 +62,6 @@ private: } +#endif // ENABLE(DATABASE) + #endif // JSCustomSQLTransactionCallback_h diff --git a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp index 2324d04..f6e59f6 100644 --- a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp +++ b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "JSCustomSQLTransactionErrorCallback.h" +#if ENABLE(DATABASE) + #include "Frame.h" #include "ScriptController.h" #include "JSSQLError.h" @@ -88,3 +90,5 @@ bool JSCustomSQLTransactionErrorCallback::handleEvent(SQLError* error) } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h index 122224f..5f3d727 100644 --- a/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h +++ b/WebCore/bindings/js/JSCustomSQLTransactionErrorCallback.h @@ -29,6 +29,8 @@ #ifndef JSCustomSQLTransactionErrorCallback_h #define JSCustomSQLTransactionErrorCallback_h +#if ENABLE(DATABASE) + #include "SQLTransactionErrorCallback.h" #include <runtime/JSObject.h> @@ -58,5 +60,6 @@ private: }; } +#endif // ENABLE(DATABASE) #endif // JSCustomSQLTransactionErrorCallback_h diff --git a/WebCore/bindings/js/JSDatabaseCustom.cpp b/WebCore/bindings/js/JSDatabaseCustom.cpp index 9ee61a5..f0f2b69 100644 --- a/WebCore/bindings/js/JSDatabaseCustom.cpp +++ b/WebCore/bindings/js/JSDatabaseCustom.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "JSDatabase.h" +#if ENABLE(DATABASE) + #include "DOMWindow.h" #include "Database.h" #include "Document.h" @@ -126,3 +128,4 @@ JSValuePtr JSDatabase::transaction(ExecState* exec, const ArgList& args) } } +#endif // ENABLE(DATABASE) diff --git a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp index fc643ad..53696d4 100644 --- a/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp +++ b/WebCore/bindings/js/JSSQLResultSetRowListCustom.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "JSSQLResultSetRowList.h" +#if ENABLE(DATABASE) + #include "ExceptionCode.h" #include "SQLValue.h" #include "SQLResultSetRowList.h" @@ -79,3 +81,5 @@ JSValuePtr JSSQLResultSetRowList::item(ExecState* exec, const ArgList& args) } } + +#endif diff --git a/WebCore/bindings/js/JSSQLTransactionCustom.cpp b/WebCore/bindings/js/JSSQLTransactionCustom.cpp index a0f173f..064ab15 100644 --- a/WebCore/bindings/js/JSSQLTransactionCustom.cpp +++ b/WebCore/bindings/js/JSSQLTransactionCustom.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "JSSQLTransaction.h" +#if ENABLE(DATABASE) + #include "DOMWindow.h" #include "ExceptionCode.h" #include "JSCustomSQLStatementCallback.h" @@ -112,3 +114,5 @@ JSValuePtr JSSQLTransaction::executeSql(ExecState* exec, const ArgList& args) } } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp index bf07416..a277027 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp +++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.cpp @@ -29,6 +29,9 @@ */ #include "config.h" + +#if ENABLE(DATABASE) + #include "V8CustomSQLStatementCallback.h" #include "Frame.h" @@ -70,3 +73,6 @@ void V8CustomSQLStatementCallback::handleEvent(SQLTransaction* transaction, SQLR } } // namespace WebCore + +#endif + diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h index 5c4b368..58ee943 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h +++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementCallback.h @@ -31,6 +31,8 @@ #ifndef V8CustomSQLStatementCallback_h #define V8CustomSQLStatementCallback_h +#if ENABLE(DATABASE) + #include "SQLStatementCallback.h" #include <v8.h> #include <wtf/PassRefPtr.h> @@ -59,4 +61,6 @@ private: } // namespace WebCore +#endif + #endif // V8CustomSQLStatementCallback_h diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp index 908d21c..2f4401f 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp +++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.cpp @@ -29,6 +29,9 @@ */ #include "config.h" + +#if ENABLE(DATABASE) + #include "V8CustomSQLStatementErrorCallback.h" #include "Frame.h" @@ -74,3 +77,6 @@ bool V8CustomSQLStatementErrorCallback::handleEvent(SQLTransaction* transaction, } } // namespace WebCore + +#endif + diff --git a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h index 7dc8114..685efc6 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h +++ b/WebCore/bindings/v8/custom/V8CustomSQLStatementErrorCallback.h @@ -31,6 +31,8 @@ #ifndef V8CustomSQLStatementErrorCallback_h #define V8CustomSQLStatementErrorCallback_h +#if ENABLE(DATABASE) + #include "SQLStatementErrorCallback.h" #include "SQLStatementErrorCallback.h" @@ -61,4 +63,6 @@ private: } // namespace WebCore +#endif + #endif // V8CustomSQLStatementErrorCallback_h diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp index a45f3c9..a175df5 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp +++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.cpp @@ -29,6 +29,9 @@ */ #include "config.h" + +#if ENABLE(DATABASE) + #include "V8CustomSQLTransactionCallback.h" #include "Frame.h" @@ -73,3 +76,6 @@ void V8CustomSQLTransactionCallback::handleEvent(SQLTransaction* transaction, bo } } // namespace WebCore + +#endif + diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h index 35497e0..665404d 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h +++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionCallback.h @@ -31,6 +31,8 @@ #ifndef V8CustomSQLTransactionCallback_h #define V8CustomSQLTransactionCallback_h +#if ENABLE(DATABASE) + #include "SQLTransactionCallback.h" #include <v8.h> #include <wtf/PassRefPtr.h> @@ -59,4 +61,6 @@ private: } // namespace WebCore +#endif + #endif // V8CustomSQLTransactionCallback_h diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp index f1ad740..5333006 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp +++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.cpp @@ -29,6 +29,9 @@ */ #include "config.h" + +#if ENABLE(DATABASE) + #include "V8CustomSQLTransactionErrorCallback.h" #include "Frame.h" @@ -73,3 +76,6 @@ bool V8CustomSQLTransactionErrorCallback::handleEvent(SQLError* error) } } // namespace WebCore + +#endif + diff --git a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h index bbf5a749..13e8178 100644 --- a/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h +++ b/WebCore/bindings/v8/custom/V8CustomSQLTransactionErrorCallback.h @@ -31,6 +31,8 @@ #ifndef V8CustomSQLTransactionErrorCallback_h #define V8CustomSQLTransactionErrorCallback_h +#if ENABLE(DATABASE) + #include "SQLTransactionErrorCallback.h" #include <v8.h> #include <wtf/PassRefPtr.h> @@ -60,4 +62,6 @@ private: } // namespace WebCore +#endif + #endif // V8CustomSQLTransactionErrorCallback_h diff --git a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp index 5962ea3..2581d46 100644 --- a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp +++ b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp @@ -30,6 +30,8 @@ #include "config.h" +#if ENABLE(DATABASE) + #include "v8_binding.h" #include "v8_custom.h" #include "v8_proxy.h" @@ -91,3 +93,6 @@ CALLBACK_FUNC_DECL(DatabaseTransaction) } } // namespace WebCore + +#endif + diff --git a/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp index 66585be..2481a4f 100644 --- a/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp +++ b/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp @@ -30,6 +30,8 @@ #include "config.h" +#if ENABLE(DATABASE) + #include "v8_binding.h" #include "v8_custom.h" #include "v8_proxy.h" @@ -88,3 +90,6 @@ CALLBACK_FUNC_DECL(SQLResultSetRowListItem) } } // namespace WebCore + +#endif + diff --git a/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp b/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp index 3ca797c..fca60a0 100644 --- a/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp +++ b/WebCore/bindings/v8/custom/V8SQLTransactionCustom.cpp @@ -30,6 +30,8 @@ #include "config.h" +#if ENABLE(DATABASE) + #include "v8_binding.h" #include "v8_custom.h" #include "v8_proxy.h" @@ -112,3 +114,6 @@ CALLBACK_FUNC_DECL(SQLTransactionExecuteSql) } } // namespace WebCore + +#endif + diff --git a/WebCore/loader/EmptyClients.h b/WebCore/loader/EmptyClients.h index ace7e9e..4d75b7a 100644 --- a/WebCore/loader/EmptyClients.h +++ b/WebCore/loader/EmptyClients.h @@ -126,7 +126,9 @@ public: virtual void print(Frame*) { } +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(Frame*, const String&) { } +#endif virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>) { } diff --git a/WebCore/page/ChromeClient.h b/WebCore/page/ChromeClient.h index 6f82bc1..7b0fa76 100644 --- a/WebCore/page/ChromeClient.h +++ b/WebCore/page/ChromeClient.h @@ -130,7 +130,9 @@ namespace WebCore { virtual void print(Frame*) = 0; +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(Frame*, const String& databaseName) = 0; +#endif #if ENABLE(DASHBOARD_SUPPORT) virtual void dashboardRegionsChanged(); diff --git a/WebCore/storage/ChangeVersionWrapper.cpp b/WebCore/storage/ChangeVersionWrapper.cpp index 54c317c..a2be615 100644 --- a/WebCore/storage/ChangeVersionWrapper.cpp +++ b/WebCore/storage/ChangeVersionWrapper.cpp @@ -28,6 +28,7 @@ #include "config.h" #include "ChangeVersionWrapper.h" +#if ENABLE(DATABASE) #include "Database.h" namespace WebCore { @@ -75,3 +76,5 @@ bool ChangeVersionWrapper::performPostflight(SQLTransaction* transaction) } } // namespace WebCore + +#endif // ENABLE(DATABASE) diff --git a/WebCore/storage/ChangeVersionWrapper.h b/WebCore/storage/ChangeVersionWrapper.h index c2983eb..b14fe55 100644 --- a/WebCore/storage/ChangeVersionWrapper.h +++ b/WebCore/storage/ChangeVersionWrapper.h @@ -28,6 +28,8 @@ #ifndef ChangeVersionWrapper_h #define ChangeVersionWrapper_h +#if ENABLE(DATABASE) + #include "PlatformString.h" #include "SQLTransaction.h" @@ -52,4 +54,6 @@ private: } // namespace WebCore +#endif + #endif // ChangeVersionWrapper_h diff --git a/WebCore/storage/Database.cpp b/WebCore/storage/Database.cpp index 941c49c..e59ddaf 100644 --- a/WebCore/storage/Database.cpp +++ b/WebCore/storage/Database.cpp @@ -29,6 +29,9 @@ #include "config.h" #include "Database.h" +#include <wtf/StdLibExtras.h> + +#if ENABLE(DATABASE) #include "ChangeVersionWrapper.h" #include "CString.h" #include "DatabaseAuthorizer.h" @@ -48,7 +51,7 @@ #include "SQLiteStatement.h" #include "SQLResultSet.h" #include <wtf/MainThread.h> -#include <wtf/StdLibExtras.h> +#endif #if USE(JSC) #include "JSDOMWindow.h" @@ -57,6 +60,14 @@ namespace WebCore { +const String& Database::databaseInfoTableName() +{ + DEFINE_STATIC_LOCAL(String, name, ("__WebKitDatabaseInfoTable__")); + return name; +} + +#if ENABLE(DATABASE) + static Mutex& guidMutex() { // Note: We don't have to use AtomicallyInitializedStatic here because @@ -80,12 +91,6 @@ static GuidDatabaseMap& guidToDatabaseMap() return map; } -const String& Database::databaseInfoTableName() -{ - DEFINE_STATIC_LOCAL(String, name, ("__WebKitDatabaseInfoTable__")); - return name; -} - static const String& databaseVersionKey() { DEFINE_STATIC_LOCAL(String, key, ("WebKitDatabaseVersionKey")); @@ -599,4 +604,6 @@ String Database::stringIdentifier() const return m_name.copy(); } +#endif + } diff --git a/WebCore/storage/Database.h b/WebCore/storage/Database.h index 955f023..3eb303c 100644 --- a/WebCore/storage/Database.h +++ b/WebCore/storage/Database.h @@ -29,6 +29,7 @@ #ifndef Database_h #define Database_h +#if ENABLE(DATABASE) #include <wtf/MessageQueue.h> #include "PlatformString.h" #include "SecurityOrigin.h" @@ -44,7 +45,11 @@ #include <wtf/PassRefPtr.h> #include <wtf/RefPtr.h> #include <wtf/Deque.h> +#else +#include "PlatformString.h" +#endif +#if ENABLE(DATABASE) namespace WebCore { class DatabaseAuthorizer; @@ -145,4 +150,15 @@ private: } // namespace WebCore +#else + +namespace WebCore { +class Database : public ThreadSafeShared<Database> { +public: + static const String& databaseInfoTableName(); +}; +} // namespace WebCore + +#endif // ENABLE(DATABASE) + #endif // Database_h diff --git a/WebCore/storage/Database.idl b/WebCore/storage/Database.idl index e28db9b..1e4b316 100644 --- a/WebCore/storage/Database.idl +++ b/WebCore/storage/Database.idl @@ -28,7 +28,9 @@ module storage { - interface Database { + interface [ + Conditional=DATABASE + ] Database { readonly attribute DOMString version; [Custom] void changeVersion(in DOMString oldVersion, in DOMString newVersion, in SQLTransactionCallback callback, in SQLTransactionErrorCallback errorCallback, in VoidCallback successCallback); [Custom] void transaction(in SQLTransactionCallback callback, in SQLTransactionErrorCallback errorCallback, in VoidCallback successCallback); diff --git a/WebCore/storage/DatabaseDetails.h b/WebCore/storage/DatabaseDetails.h index 677362b..a4d85fd 100644 --- a/WebCore/storage/DatabaseDetails.h +++ b/WebCore/storage/DatabaseDetails.h @@ -29,6 +29,8 @@ #ifndef DatabaseDetails_h #define DatabaseDetails_h +#if ENABLE(DATABASE) + #include "PlatformString.h" namespace WebCore { @@ -64,4 +66,6 @@ private: } // namespace WebCore +#endif + #endif // DatabaseDetails_h diff --git a/WebCore/storage/DatabaseTask.cpp b/WebCore/storage/DatabaseTask.cpp index 7957d2a..755da7c 100644 --- a/WebCore/storage/DatabaseTask.cpp +++ b/WebCore/storage/DatabaseTask.cpp @@ -28,6 +28,8 @@ #include "config.h" #include "DatabaseTask.h" +#if ENABLE(DATABASE) + #include "Database.h" #include "Logging.h" @@ -175,3 +177,5 @@ const char* DatabaseTableNamesTask::debugTaskName() const #endif } // namespace WebCore + +#endif diff --git a/WebCore/storage/DatabaseTask.h b/WebCore/storage/DatabaseTask.h index 50d297f..a3814d7 100644 --- a/WebCore/storage/DatabaseTask.h +++ b/WebCore/storage/DatabaseTask.h @@ -28,6 +28,7 @@ #ifndef DatabaseTask_h #define DatabaseTask_h +#if ENABLE(DATABASE) #include "ExceptionCode.h" #include "PlatformString.h" #include <wtf/OwnPtr.h> @@ -148,4 +149,5 @@ private: } // namespace WebCore +#endif // ENABLE(DATABASE) #endif // DatabaseTask_h diff --git a/WebCore/storage/DatabaseThread.cpp b/WebCore/storage/DatabaseThread.cpp index de9fffb..fab02a2 100644 --- a/WebCore/storage/DatabaseThread.cpp +++ b/WebCore/storage/DatabaseThread.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "DatabaseThread.h" +#if ENABLE(DATABASE) + #include "AutodrainedPool.h" #include "Database.h" #include "DatabaseTask.h" @@ -135,3 +137,4 @@ void DatabaseThread::unscheduleDatabaseTasks(Database* database) } } // namespace WebCore +#endif diff --git a/WebCore/storage/DatabaseThread.h b/WebCore/storage/DatabaseThread.h index 460ffde..9f13c33 100644 --- a/WebCore/storage/DatabaseThread.h +++ b/WebCore/storage/DatabaseThread.h @@ -28,6 +28,7 @@ #ifndef DatabaseThread_h #define DatabaseThread_h +#if ENABLE(DATABASE) #include <wtf/Deque.h> #include <wtf/HashMap.h> #include <wtf/HashSet.h> @@ -70,4 +71,5 @@ private: } // namespace WebCore +#endif // ENABLE(DATABASE) #endif // DatabaseThread_h diff --git a/WebCore/storage/DatabaseTracker.cpp b/WebCore/storage/DatabaseTracker.cpp index d139283..9311bc6 100644 --- a/WebCore/storage/DatabaseTracker.cpp +++ b/WebCore/storage/DatabaseTracker.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "DatabaseTracker.h" +#if ENABLE(DATABASE) + #include "ChromeClient.h" #include "Database.h" #include "DatabaseTrackerClient.h" @@ -828,3 +830,4 @@ void DatabaseTracker::notifyDatabasesChanged(void*) } // namespace WebCore +#endif diff --git a/WebCore/storage/DatabaseTracker.h b/WebCore/storage/DatabaseTracker.h index 8969a54..dc50965 100644 --- a/WebCore/storage/DatabaseTracker.h +++ b/WebCore/storage/DatabaseTracker.h @@ -29,6 +29,8 @@ #ifndef DatabaseTracker_h #define DatabaseTracker_h +#if ENABLE(DATABASE) + #include "DatabaseDetails.h" #include "PlatformString.h" #include "SQLiteDatabase.h" @@ -130,4 +132,5 @@ private: } // namespace WebCore +#endif // ENABLE(DATABASE) #endif // DatabaseTracker_h diff --git a/WebCore/storage/DatabaseTrackerClient.h b/WebCore/storage/DatabaseTrackerClient.h index f9b0f70..b43123c 100644 --- a/WebCore/storage/DatabaseTrackerClient.h +++ b/WebCore/storage/DatabaseTrackerClient.h @@ -28,6 +28,8 @@ #ifndef DatabaseTrackerClient_h #define DatabaseTrackerClient_h +#if ENABLE(DATABASE) + namespace WebCore { class SecurityOrigin; @@ -42,4 +44,6 @@ public: } // namespace WebCore +#endif + #endif // DatabaseTrackerClient_h diff --git a/WebCore/storage/OriginQuotaManager.cpp b/WebCore/storage/OriginQuotaManager.cpp index fa2a580..2b98ab7 100644 --- a/WebCore/storage/OriginQuotaManager.cpp +++ b/WebCore/storage/OriginQuotaManager.cpp @@ -28,6 +28,8 @@ #include "config.h" #include "OriginQuotaManager.h" +#if ENABLE(DATABASE) + #include "Database.h" #include "OriginUsageRecord.h" @@ -121,3 +123,5 @@ unsigned long long OriginQuotaManager::diskUsage(SecurityOrigin* origin) const } + +#endif // ENABLE(DATABASE) diff --git a/WebCore/storage/OriginQuotaManager.h b/WebCore/storage/OriginQuotaManager.h index 81a29e5..2e3615d 100644 --- a/WebCore/storage/OriginQuotaManager.h +++ b/WebCore/storage/OriginQuotaManager.h @@ -29,6 +29,8 @@ #ifndef OriginQuotaManager_h #define OriginQuotaManager_h +#if ENABLE(DATABASE) + #include "StringHash.h" #include "SecurityOriginHash.h" #include <wtf/HashMap.h> @@ -67,4 +69,6 @@ private: } // namespace WebCore +#endif // ENABLE(DATABASE) + #endif // OriginQuotaManager_h diff --git a/WebCore/storage/OriginUsageRecord.cpp b/WebCore/storage/OriginUsageRecord.cpp index d7a7b11..211ba69 100644 --- a/WebCore/storage/OriginUsageRecord.cpp +++ b/WebCore/storage/OriginUsageRecord.cpp @@ -28,6 +28,8 @@ #include "config.h" #include "OriginUsageRecord.h" +#if ENABLE(DATABASE) + #include "FileSystem.h" namespace WebCore { @@ -102,3 +104,5 @@ unsigned long long OriginUsageRecord::diskUsage() } } + +#endif diff --git a/WebCore/storage/OriginUsageRecord.h b/WebCore/storage/OriginUsageRecord.h index 094ce3d..3442ae1 100644 --- a/WebCore/storage/OriginUsageRecord.h +++ b/WebCore/storage/OriginUsageRecord.h @@ -28,6 +28,8 @@ #ifndef OriginUsageRecord_h #define OriginUsageRecord_h +#if ENABLE(DATABASE) + #include "PlatformString.h" #include "StringHash.h" @@ -64,4 +66,6 @@ private: } // namespace WebCore +#endif + #endif diff --git a/WebCore/storage/SQLError.h b/WebCore/storage/SQLError.h index 69c1228..b6ebb5c 100644 --- a/WebCore/storage/SQLError.h +++ b/WebCore/storage/SQLError.h @@ -29,6 +29,8 @@ #ifndef SQLError_h #define SQLError_h +#if ENABLE(DATABASE) + #include "PlatformString.h" #include <wtf/Threading.h> @@ -49,4 +51,6 @@ private: } +#endif + #endif // SQLError_h diff --git a/WebCore/storage/SQLError.idl b/WebCore/storage/SQLError.idl index 5c9540f..d889c5b 100644 --- a/WebCore/storage/SQLError.idl +++ b/WebCore/storage/SQLError.idl @@ -28,7 +28,9 @@ module storage { - interface SQLError { + interface [ + Conditional=DATABASE + ] SQLError { readonly attribute unsigned long code; readonly attribute DOMString message; }; diff --git a/WebCore/storage/SQLResultSet.cpp b/WebCore/storage/SQLResultSet.cpp index 37024a1..19c66c7 100644 --- a/WebCore/storage/SQLResultSet.cpp +++ b/WebCore/storage/SQLResultSet.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "SQLResultSet.h" +#if ENABLE(DATABASE) + #include "ExceptionCode.h" #include "SQLValue.h" @@ -79,3 +81,5 @@ void SQLResultSet::setRowsAffected(int count) } } + +#endif diff --git a/WebCore/storage/SQLResultSet.h b/WebCore/storage/SQLResultSet.h index 58f13b7..5a0ff78 100644 --- a/WebCore/storage/SQLResultSet.h +++ b/WebCore/storage/SQLResultSet.h @@ -29,6 +29,8 @@ #ifndef SQLResultSet_h #define SQLResultSet_h +#if ENABLE(DATABASE) + #include "SQLResultSetRowList.h" #include <wtf/Threading.h> @@ -60,4 +62,6 @@ private: } // namespace WebCore +#endif + #endif // SQLResultSet_h diff --git a/WebCore/storage/SQLResultSet.idl b/WebCore/storage/SQLResultSet.idl index e0d72c9..1db07cd 100644 --- a/WebCore/storage/SQLResultSet.idl +++ b/WebCore/storage/SQLResultSet.idl @@ -28,7 +28,9 @@ module storage { - interface SQLResultSet { + interface [ + Conditional=DATABASE + ] SQLResultSet { readonly attribute SQLResultSetRowList rows; readonly attribute long insertId diff --git a/WebCore/storage/SQLResultSetRowList.cpp b/WebCore/storage/SQLResultSetRowList.cpp index 5b5b943..c1e4844 100644 --- a/WebCore/storage/SQLResultSetRowList.cpp +++ b/WebCore/storage/SQLResultSetRowList.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "SQLResultSetRowList.h" +#if ENABLE(DATABASE) + namespace WebCore { unsigned SQLResultSetRowList::length() const @@ -42,3 +44,5 @@ unsigned SQLResultSetRowList::length() const } } + +#endif diff --git a/WebCore/storage/SQLResultSetRowList.h b/WebCore/storage/SQLResultSetRowList.h index 1b8a8b4..96a6aa1 100644 --- a/WebCore/storage/SQLResultSetRowList.h +++ b/WebCore/storage/SQLResultSetRowList.h @@ -29,6 +29,8 @@ #ifndef SQLResultSetRowList_h #define SQLResultSetRowList_h +#if ENABLE(DATABASE) + #include <wtf/PassRefPtr.h> #include "SQLValue.h" @@ -56,3 +58,5 @@ private: } #endif + +#endif diff --git a/WebCore/storage/SQLResultSetRowList.idl b/WebCore/storage/SQLResultSetRowList.idl index f853e90..6a477e9 100644 --- a/WebCore/storage/SQLResultSetRowList.idl +++ b/WebCore/storage/SQLResultSetRowList.idl @@ -28,7 +28,9 @@ module storage { - interface SQLResultSetRowList { + interface [ + Conditional=DATABASE + ] SQLResultSetRowList { readonly attribute unsigned long length; [Custom] DOMObject item(in unsigned long index); }; diff --git a/WebCore/storage/SQLStatement.cpp b/WebCore/storage/SQLStatement.cpp index 9bd62dd..9160c4e 100644 --- a/WebCore/storage/SQLStatement.cpp +++ b/WebCore/storage/SQLStatement.cpp @@ -28,6 +28,8 @@ #include "config.h" #include "SQLStatement.h" +#if ENABLE(DATABASE) + #include "Database.h" #include "DatabaseAuthorizer.h" #include "Logging.h" @@ -195,3 +197,5 @@ bool SQLStatement::lastExecutionFailedDueToQuota() const } } // namespace WebCore + +#endif // ENABLE(DATABASE) diff --git a/WebCore/storage/SQLStatement.h b/WebCore/storage/SQLStatement.h index e72fcf7..c299156 100644 --- a/WebCore/storage/SQLStatement.h +++ b/WebCore/storage/SQLStatement.h @@ -28,6 +28,8 @@ #ifndef SQLStatement_h #define SQLStatement_h +#if ENABLE(DATABASE) + #include "PlatformString.h" #include "SQLError.h" @@ -80,4 +82,6 @@ private: } // namespace WebCore +#endif // ENABLE(DATABASE) + #endif // SQLStatement_h diff --git a/WebCore/storage/SQLStatementCallback.h b/WebCore/storage/SQLStatementCallback.h index 58a9436..14d19bb 100644 --- a/WebCore/storage/SQLStatementCallback.h +++ b/WebCore/storage/SQLStatementCallback.h @@ -28,6 +28,8 @@ #ifndef SQLStatementCallback_h #define SQLStatementCallback_h +#if ENABLE(DATABASE) + #include <wtf/Threading.h> namespace WebCore { @@ -43,6 +45,6 @@ public: } -#endif // SQLStatementErrorCallback_h - +#endif +#endif // SQLStatementErrorCallback_h diff --git a/WebCore/storage/SQLStatementErrorCallback.h b/WebCore/storage/SQLStatementErrorCallback.h index 5dc3f5a..ef0c328 100644 --- a/WebCore/storage/SQLStatementErrorCallback.h +++ b/WebCore/storage/SQLStatementErrorCallback.h @@ -29,6 +29,8 @@ #ifndef SQLStatementErrorCallback_h #define SQLStatementErrorCallback_h +#if ENABLE(DATABASE) + #include <wtf/Threading.h> namespace WebCore { @@ -44,6 +46,6 @@ public: } -#endif // SQLStatementErrorCallback_h - +#endif +#endif // SQLStatementErrorCallback_h diff --git a/WebCore/storage/SQLTransaction.cpp b/WebCore/storage/SQLTransaction.cpp index 5820d7f..aa22d11 100644 --- a/WebCore/storage/SQLTransaction.cpp +++ b/WebCore/storage/SQLTransaction.cpp @@ -29,6 +29,8 @@ #include "config.h" #include "SQLTransaction.h" +#if ENABLE(DATABASE) + #include "ChromeClient.h" #include "Database.h" #include "DatabaseAuthorizer.h" @@ -548,3 +550,5 @@ void SQLTransaction::cleanupAfterTransactionErrorCallback() } } // namespace WebCore + +#endif // ENABLE(DATABASE) diff --git a/WebCore/storage/SQLTransaction.h b/WebCore/storage/SQLTransaction.h index 87d438e..e269495 100644 --- a/WebCore/storage/SQLTransaction.h +++ b/WebCore/storage/SQLTransaction.h @@ -28,6 +28,8 @@ #ifndef SQLTransaction_h #define SQLTransaction_h +#if ENABLE(DATABASE) + #include <wtf/Threading.h> #include "SQLiteTransaction.h" @@ -128,4 +130,6 @@ private: } // namespace WebCore +#endif + #endif // SQLTransaction_h diff --git a/WebCore/storage/SQLTransaction.idl b/WebCore/storage/SQLTransaction.idl index 41436f1..5d4885c 100644 --- a/WebCore/storage/SQLTransaction.idl +++ b/WebCore/storage/SQLTransaction.idl @@ -28,7 +28,9 @@ module storage { - interface SQLTransaction { + interface [ + Conditional=DATABASE + ] SQLTransaction { [Custom] void executeSql(in DOMString sqlStatement, in ObjectArray arguments, in SQLStatementCallback callback, in SQLStatementErrorCallback errorCallback); }; } diff --git a/WebCore/storage/SQLTransactionCallback.h b/WebCore/storage/SQLTransactionCallback.h index bbe62a5..a4cd940 100644 --- a/WebCore/storage/SQLTransactionCallback.h +++ b/WebCore/storage/SQLTransactionCallback.h @@ -29,6 +29,8 @@ #ifndef SQLTransactionCallback_h #define SQLTransactionCallback_h +#if ENABLE(DATABASE) + #include <wtf/Threading.h> namespace WebCore { @@ -44,4 +46,6 @@ public: } +#endif + #endif // SQLTransactionCallback_h diff --git a/WebCore/storage/SQLTransactionErrorCallback.h b/WebCore/storage/SQLTransactionErrorCallback.h index 2890556..b44255f 100644 --- a/WebCore/storage/SQLTransactionErrorCallback.h +++ b/WebCore/storage/SQLTransactionErrorCallback.h @@ -29,6 +29,8 @@ #ifndef SQLTransactionErrorCallback_h #define SQLTransactionErrorCallback_h +#if ENABLE(DATABASE) + #include <wtf/Threading.h> namespace WebCore { @@ -43,6 +45,8 @@ namespace WebCore { } +#endif + #endif // SQLTransactionErrorCallback_h diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp index 4191d85..c4ff2f0 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp @@ -272,9 +272,9 @@ void ChromeClientAndroid::print(Frame*) {} * we call into the browser thread to ask what to do with the quota, we block here and get woken up when the * browser calls the native WebViewCore::SetDatabaseQuota method with the new quota value. */ +#if ENABLE(DATABASE) void ChromeClientAndroid::exceededDatabaseQuota(Frame* frame, const String& name) { -#if ENABLE(DATABASE) SecurityOrigin* origin = frame->document()->securityOrigin(); // TODO: This default quota value should be pulled from the web browser @@ -306,8 +306,8 @@ void ChromeClientAndroid::exceededDatabaseQuota(Frame* frame, const String& name // to the default quota, casusing it to be tracked from now on. DatabaseTracker::tracker().setQuota(origin, defaultQuota); } -#endif } +#endif // new to change 38068 (Nov 6, 2008) void ChromeClientAndroid::runOpenPanel(Frame*, PassRefPtr<FileChooser>) { notImplemented(); } diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h index 7ffafcd..00c45b9 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h @@ -107,9 +107,9 @@ namespace android { virtual void setToolTip(const String&); virtual void print(Frame*); - +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(Frame*, const String&); - +#endif virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); // Notification that the given form element has changed. This function diff --git a/WebKit/android/jni/WebCoreJniOnLoad.cpp b/WebKit/android/jni/WebCoreJniOnLoad.cpp index f3f6efa..c6b0022 100644 --- a/WebKit/android/jni/WebCoreJniOnLoad.cpp +++ b/WebKit/android/jni/WebCoreJniOnLoad.cpp @@ -24,6 +24,8 @@ */ #define LOG_TAG "webcoreglue" +#include "config.h" + #include "jni_utility.h" #include <jni.h> #include <utils/Log.h> @@ -37,10 +39,13 @@ extern int register_webviewcore(JNIEnv*); extern int register_webhistory(JNIEnv*); extern int register_webicondatabase(JNIEnv*); extern int register_websettings(JNIEnv*); -extern int register_webstorage(JNIEnv*); extern int register_webview(JNIEnv*); extern int register_webcorejni(JNIEnv*); +#if ENABLE(DATABASE) +extern int register_webstorage(JNIEnv*); +#endif + } struct RegistrationMethod { @@ -57,7 +62,9 @@ static RegistrationMethod gWebCoreRegMethods[] = { { "WebHistory", android::register_webhistory }, { "WebIconDatabase", android::register_webicondatabase }, { "WebSettings", android::register_websettings }, +#if ENABLE(DATABASE) { "WebStorage", android::register_webstorage }, +#endif { "WebView", android::register_webview } }; diff --git a/WebKit/android/jni/WebStorage.cpp b/WebKit/android/jni/WebStorage.cpp index d375f3e..f625939 100644 --- a/WebKit/android/jni/WebStorage.cpp +++ b/WebKit/android/jni/WebStorage.cpp @@ -23,8 +23,9 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <config.h> -#include <wtf/Platform.h> +#include "config.h" + +#if ENABLE(DATABASE) #include <JNIHelp.h> @@ -122,3 +123,6 @@ int register_webstorage(JNIEnv* env) } } + +#endif //ENABLE(DATABASE) + diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp index 85f704a..892be74 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp @@ -407,16 +407,16 @@ void ChromeClient::print(Frame* frame) webkit_web_frame_print(kit(frame)); } +#if ENABLE(DATABASE) void ChromeClient::exceededDatabaseQuota(Frame* frame, const String&) { -#if ENABLE(DATABASE) // Set to 5M for testing // FIXME: Make this configurable notImplemented(); const unsigned long long defaultQuota = 5 * 1024 * 1024; DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), defaultQuota); -#endif } +#endif void ChromeClient::runOpenPanel(Frame*, PassRefPtr<FileChooser> prpFileChooser) { diff --git a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h index 299d023..fc0ea8a 100644 --- a/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h +++ b/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h @@ -96,9 +96,9 @@ namespace WebKit { virtual void setToolTip(const WebCore::String&); virtual void print(WebCore::Frame*); - +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&); - +#endif virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>); virtual void formStateDidChange(const WebCore::Node*) { } diff --git a/WebKit/mac/Storage/WebDatabaseManager.mm b/WebKit/mac/Storage/WebDatabaseManager.mm index fa9eea6..a84f235 100644 --- a/WebKit/mac/Storage/WebDatabaseManager.mm +++ b/WebKit/mac/Storage/WebDatabaseManager.mm @@ -29,6 +29,8 @@ #import "WebDatabaseManagerPrivate.h" #import "WebDatabaseManagerInternal.h" +#if ENABLE(DATABASE) + #import "WebDatabaseTrackerClient.h" #import "WebSecurityOriginInternal.h" @@ -137,3 +139,5 @@ void WebKitInitializeDatabasesIfNecessary() initialized = YES; } + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseManagerInternal.h b/WebKit/mac/Storage/WebDatabaseManagerInternal.h index 2065a4e..6a4ad1d 100644 --- a/WebKit/mac/Storage/WebDatabaseManagerInternal.h +++ b/WebKit/mac/Storage/WebDatabaseManagerInternal.h @@ -26,4 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ENABLE(DATABASE) + void WebKitInitializeDatabasesIfNecessary(); + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseManagerPrivate.h b/WebKit/mac/Storage/WebDatabaseManagerPrivate.h index faa4e5d..e373b1c 100644 --- a/WebKit/mac/Storage/WebDatabaseManagerPrivate.h +++ b/WebKit/mac/Storage/WebDatabaseManagerPrivate.h @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ENABLE(DATABASE) + extern NSString *WebDatabaseDirectoryDefaultsKey; extern NSString *WebDatabaseDisplayNameKey; @@ -62,3 +64,5 @@ extern NSString *WebDatabaseIdentifierKey; - (void)deleteDatabase:(NSString *)databaseIdentifier withOrigin:(WebSecurityOrigin *)origin; @end + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.h b/WebKit/mac/Storage/WebDatabaseTrackerClient.h index 5db444c..d06cfe9 100644 --- a/WebKit/mac/Storage/WebDatabaseTrackerClient.h +++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.h @@ -26,6 +26,8 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if ENABLE(DATABASE) + #import <WebCore/DatabaseTrackerClient.h> class WebDatabaseTrackerClient : public WebCore::DatabaseTrackerClient { @@ -38,3 +40,5 @@ public: private: WebDatabaseTrackerClient(); }; + +#endif diff --git a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm index 48530d6..89626fb 100644 --- a/WebKit/mac/Storage/WebDatabaseTrackerClient.mm +++ b/WebKit/mac/Storage/WebDatabaseTrackerClient.mm @@ -28,6 +28,8 @@ #import "WebDatabaseTrackerClient.h" +#if ENABLE(DATABASE) + #import "WebDatabaseManagerPrivate.h" #import "WebSecurityOriginInternal.h" #import <wtf/RetainPtr.h> @@ -67,3 +69,5 @@ void WebDatabaseTrackerClient::dispatchDidModifyDatabase(SecurityOrigin* origin, object:webSecurityOrigin.get() userInfo:userInfo.get()]; } + +#endif diff --git a/WebKit/mac/Storage/WebSecurityOrigin.mm b/WebKit/mac/Storage/WebSecurityOrigin.mm index 85313d0..56a21f5 100644 --- a/WebKit/mac/Storage/WebSecurityOrigin.mm +++ b/WebKit/mac/Storage/WebSecurityOrigin.mm @@ -71,12 +71,20 @@ using namespace WebCore; - (unsigned long long)usage { +#if ENABLE(DATABASE) return DatabaseTracker::tracker().usageForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); +#else + return 0; +#endif } - (unsigned long long)quota { +#if ENABLE(DATABASE) return DatabaseTracker::tracker().quotaForOrigin(reinterpret_cast<SecurityOrigin*>(_private)); +#else + return 0; +#endif } // Sets the storage quota (in bytes) @@ -84,7 +92,9 @@ using namespace WebCore; // This will simply prevent new data from being added to databases in that origin - (void)setQuota:(unsigned long long)quota { +#if ENABLE(DATABASE) DatabaseTracker::tracker().setQuota(reinterpret_cast<SecurityOrigin*>(_private), quota); +#endif } - (BOOL)isEqual:(id)anObject diff --git a/WebKit/mac/Storage/WebSecurityOriginPrivate.h b/WebKit/mac/Storage/WebSecurityOriginPrivate.h index 0796c6e..c7836f8 100644 --- a/WebKit/mac/Storage/WebSecurityOriginPrivate.h +++ b/WebKit/mac/Storage/WebSecurityOriginPrivate.h @@ -49,4 +49,5 @@ // This will simply prevent new data from being added to databases in that origin - (void)setQuota:(unsigned long long)quota; + @end diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.h b/WebKit/mac/WebCoreSupport/WebChromeClient.h index b2f04f1..6c3d71e 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.h +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.h @@ -104,9 +104,9 @@ public: virtual void setToolTip(const WebCore::String&); virtual void print(WebCore::Frame*); - +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String& databaseName); - +#endif virtual void populateVisitedLinks(); #if ENABLE(DASHBOARD_SUPPORT) diff --git a/WebKit/mac/WebCoreSupport/WebChromeClient.mm b/WebKit/mac/WebCoreSupport/WebChromeClient.mm index 79dd641..18c73e9 100644 --- a/WebKit/mac/WebCoreSupport/WebChromeClient.mm +++ b/WebKit/mac/WebCoreSupport/WebChromeClient.mm @@ -500,6 +500,7 @@ void WebChromeClient::print(Frame* frame) CallUIDelegate(m_webView, @selector(webView:printFrameView:), frameView); } +#if ENABLE(DATABASE) void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseName) { BEGIN_BLOCK_OBJC_EXCEPTIONS; @@ -515,6 +516,7 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database END_BLOCK_OBJC_EXCEPTIONS; } +#endif void WebChromeClient::populateVisitedLinks() { diff --git a/WebKit/mac/WebView/WebView.mm b/WebKit/mac/WebView/WebView.mm index de3628a..eabbc9d 100644 --- a/WebKit/mac/WebView/WebView.mm +++ b/WebKit/mac/WebView/WebView.mm @@ -741,7 +741,9 @@ static bool runningTigerMail() WebKitInitializeLoggingChannelsIfNecessary(); WebCore::InitializeLoggingChannelsIfNecessary(); [WebHistoryItem initWindowWatcherIfNecessary]; +#if ENABLE(DATABASE) WebKitInitializeDatabasesIfNecessary(); +#endif WebKitInitializeApplicationCachePathIfNecessary(); patchMailRemoveAttributesMethod(); didOneTimeInitialization = true; diff --git a/WebKit/qt/Api/qwebdatabase.cpp b/WebKit/qt/Api/qwebdatabase.cpp index 489ab17..0203d72 100644 --- a/WebKit/qt/Api/qwebdatabase.cpp +++ b/WebKit/qt/Api/qwebdatabase.cpp @@ -19,6 +19,9 @@ #include "config.h" #include "qwebdatabase.h" + +#if ENABLE(DATABASE) + #include "qwebdatabase_p.h" #include "qwebsecurityorigin.h" #include "qwebsecurityorigin_p.h" @@ -146,3 +149,5 @@ void QWebDatabase::removeDatabase(const QWebDatabase &db) QWebDatabase::~QWebDatabase() { } + +#endif diff --git a/WebKit/qt/Api/qwebdatabase_p.h b/WebKit/qt/Api/qwebdatabase_p.h index 988fb16..145115e 100644 --- a/WebKit/qt/Api/qwebdatabase_p.h +++ b/WebKit/qt/Api/qwebdatabase_p.h @@ -19,6 +19,8 @@ #ifndef _WEBDATABASE_P_H_ #define _WEBDATABASE_P_H_ +#if ENABLE(DATABASE) + #include <QString> #include <QtCore/qshareddata.h> @@ -36,3 +38,5 @@ public: #endif +#endif + diff --git a/WebKit/qt/Api/qwebsecurityorigin.cpp b/WebKit/qt/Api/qwebsecurityorigin.cpp index 5217362..c08785f 100644 --- a/WebKit/qt/Api/qwebsecurityorigin.cpp +++ b/WebKit/qt/Api/qwebsecurityorigin.cpp @@ -101,7 +101,11 @@ int QWebSecurityOrigin::port() const */ qint64 QWebSecurityOrigin::databaseUsage() const { +#if ENABLE(DATABASE) return DatabaseTracker::tracker().usageForOrigin(d->origin.get()); +#else + return 0; +#endif } /*! @@ -109,7 +113,11 @@ qint64 QWebSecurityOrigin::databaseUsage() const */ qint64 QWebSecurityOrigin::databaseQuota() const { +#if ENABLE(DATABASE) return DatabaseTracker::tracker().quotaForOrigin(d->origin.get()); +#else + return 0; +#endif } /*! @@ -121,7 +129,9 @@ qint64 QWebSecurityOrigin::databaseQuota() const */ void QWebSecurityOrigin::setDatabaseQuota(qint64 quota) { +#if ENABLE(DATABASE) DatabaseTracker::tracker().setQuota(d->origin.get(), quota); +#endif } /*! diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp index fa52d6c..5df554b 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp @@ -387,15 +387,17 @@ void ChromeClientQt::print(Frame *frame) emit m_webPage->printRequested(QWebFramePrivate::kit(frame)); } +#if ENABLE(DATABASE) void ChromeClientQt::exceededDatabaseQuota(Frame* frame, const String& databaseName) { quint64 quota = QWebSettings::offlineStorageDefaultQuota(); -#if ENABLE(DATABASE) + if (!DatabaseTracker::tracker().hasEntryForOrigin(frame->document()->securityOrigin())) DatabaseTracker::tracker().setQuota(frame->document()->securityOrigin(), quota); -#endif + emit m_webPage->databaseQuotaExceeded(QWebFramePrivate::kit(frame), databaseName); } +#endif void ChromeClientQt::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> prpFileChooser) { diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.h b/WebKit/qt/WebCoreSupport/ChromeClientQt.h index a13bb7c..77c56fc 100644 --- a/WebKit/qt/WebCoreSupport/ChromeClientQt.h +++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.h @@ -113,9 +113,9 @@ namespace WebCore { virtual void setToolTip(const String&); virtual void print(Frame*); - +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(Frame*, const String&); - +#endif virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); virtual void formStateDidChange(const Node*) { } diff --git a/WebKit/win/ForEachCoClass.h b/WebKit/win/ForEachCoClass.h index 94976e6..e1eeac1 100644 --- a/WebKit/win/ForEachCoClass.h +++ b/WebKit/win/ForEachCoClass.h @@ -31,11 +31,17 @@ #include "ProgIDMacros.h" +#if ENABLE(DATABASE) +#define WEB_DATABASE_MANAGER(macro) macro(WebDatabaseManager) +#else +#define WEB_DATABASE_MANAGER(macro) +#endif + // Items may only be added to the end of this macro. No items may be removed from it. #define FOR_EACH_COCLASS(macro) \ macro(CFDictionaryPropertyBag) \ macro(WebCache) \ - macro(WebDatabaseManager) \ + WEB_DATABASE_MANAGER(macro) \ macro(WebDownload) \ macro(WebError) \ macro(WebHistory) \ diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.cpp b/WebKit/win/WebCoreSupport/WebChromeClient.cpp index 9aec24b..45b07cf 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.cpp +++ b/WebKit/win/WebCoreSupport/WebChromeClient.cpp @@ -506,6 +506,7 @@ void WebChromeClient::print(Frame* frame) uiDelegate2->printFrame(m_webView, kit(frame)); } +#if ENABLE(DATABASE) void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& databaseIdentifier) { COMPtr<WebSecurityOrigin> origin(AdoptCOM, WebSecurityOrigin::createInstance(frame->document()->securityOrigin())); @@ -540,6 +541,7 @@ void WebChromeClient::exceededDatabaseQuota(Frame* frame, const String& database } } } +#endif void WebChromeClient::populateVisitedLinks() { diff --git a/WebKit/win/WebCoreSupport/WebChromeClient.h b/WebKit/win/WebCoreSupport/WebChromeClient.h index cb9f470..44c6107 100644 --- a/WebKit/win/WebCoreSupport/WebChromeClient.h +++ b/WebKit/win/WebCoreSupport/WebChromeClient.h @@ -105,7 +105,9 @@ public: virtual void print(WebCore::Frame*); +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(WebCore::Frame*, const WebCore::String&); +#endif virtual void populateVisitedLinks(); diff --git a/WebKit/win/WebDatabaseManager.cpp b/WebKit/win/WebDatabaseManager.cpp index d4974ed..c16a600 100644 --- a/WebKit/win/WebDatabaseManager.cpp +++ b/WebKit/win/WebDatabaseManager.cpp @@ -30,6 +30,8 @@ #include "WebDatabaseManager.h" #include "WebKitDLL.h" +#if ENABLE(DATABASE) + #include "CFDictionaryPropertyBag.h" #include "COMEnumVariant.h" #include "MarshallingHelpers.h" @@ -364,3 +366,5 @@ void WebKitSetWebDatabasesPathIfNecessary() pathSet = true; } + +#endif diff --git a/WebKit/win/WebDatabaseManager.h b/WebKit/win/WebDatabaseManager.h index 303f1e8..f7084ba 100644 --- a/WebKit/win/WebDatabaseManager.h +++ b/WebKit/win/WebDatabaseManager.h @@ -29,6 +29,8 @@ #ifndef WebDatabaseManager_h #define WebDatabaseManager_h +#if ENABLE(DATABASE) + #include <WebCore/DatabaseTrackerClient.h> #include "WebKit.h" @@ -85,3 +87,5 @@ private: void WebKitSetWebDatabasesPathIfNecessary(); #endif + +#endif diff --git a/WebKit/win/WebSecurityOrigin.cpp b/WebKit/win/WebSecurityOrigin.cpp index c027b13..baec72e 100644 --- a/WebKit/win/WebSecurityOrigin.cpp +++ b/WebKit/win/WebSecurityOrigin.cpp @@ -33,6 +33,10 @@ #include <WebCore/BString.h> #include <WebCore/DatabaseTracker.h> +#if !ENABLE(DATABASE) +#include <wtf/UnusedParam.h> +#endif + using namespace WebCore; // WebSecurityOrigin --------------------------------------------------------------- @@ -126,28 +130,43 @@ HRESULT STDMETHODCALLTYPE WebSecurityOrigin::port( HRESULT STDMETHODCALLTYPE WebSecurityOrigin::usage( /* [retval][out] */ unsigned long long* result) { +#if ENABLE(DATABASE) if (!result) return E_POINTER; *result = DatabaseTracker::tracker().usageForOrigin(m_securityOrigin.get()); return S_OK; +#else + UNUSED_PARAM(result); + return E_NOTIMPL; +#endif } HRESULT STDMETHODCALLTYPE WebSecurityOrigin::quota( /* [retval][out] */ unsigned long long* result) { +#if ENABLE(DATABASE) if (!result) return E_POINTER; *result = DatabaseTracker::tracker().quotaForOrigin(m_securityOrigin.get()); return S_OK; +#else + UNUSED_PARAM(result); + return E_NOTIMPL; +#endif } HRESULT STDMETHODCALLTYPE WebSecurityOrigin::setQuota( /* [in] */ unsigned long long quota) { +#if ENABLE(DATABASE) DatabaseTracker::tracker().setQuota(m_securityOrigin.get(), quota); return S_OK; +#else + UNUSED_PARAM(quota); + return E_NOTIMPL; +#endif } diff --git a/WebKit/win/WebSecurityOrigin.h b/WebKit/win/WebSecurityOrigin.h index a4d9f01..368a7e8 100644 --- a/WebKit/win/WebSecurityOrigin.h +++ b/WebKit/win/WebSecurityOrigin.h @@ -57,7 +57,7 @@ public: virtual HRESULT STDMETHODCALLTYPE port( /* [retval][out] */ unsigned short* result); - + virtual HRESULT STDMETHODCALLTYPE usage( /* [retval][out] */ unsigned long long* result); @@ -66,6 +66,7 @@ public: virtual HRESULT STDMETHODCALLTYPE setQuota( /* [in] */ unsigned long long quota); + private: WebSecurityOrigin(WebCore::SecurityOrigin*); ~WebSecurityOrigin(); diff --git a/WebKit/win/WebView.cpp b/WebKit/win/WebView.cpp index 20c43fd..afacef5 100644 --- a/WebKit/win/WebView.cpp +++ b/WebKit/win/WebView.cpp @@ -2168,7 +2168,9 @@ HRESULT STDMETHODCALLTYPE WebView::initWithFrame( m_preferences = sharedPreferences; InitializeLoggingChannelsIfNecessary(); +#if ENABLE(DATABASE) WebKitSetWebDatabasesPathIfNecessary(); +#endif WebKitSetApplicationCachePathIfNecessary(); m_page = new Page(new WebChromeClient(this), new WebContextMenuClient(this), new WebEditorClient(this), new WebDragClient(this), new WebInspectorClient(this)); diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp index 29fef0e..6dfe7a4 100644 --- a/WebKit/wx/WebKitSupport/ChromeClientWx.cpp +++ b/WebKit/wx/WebKitSupport/ChromeClientWx.cpp @@ -348,10 +348,12 @@ void ChromeClientWx::print(Frame*) notImplemented(); } +#if ENABLE(DATABASE) void ChromeClientWx::exceededDatabaseQuota(Frame*, const String&) { notImplemented(); } +#endif void ChromeClientWx::scroll(const IntSize&, const IntRect&, const IntRect&) { diff --git a/WebKit/wx/WebKitSupport/ChromeClientWx.h b/WebKit/wx/WebKitSupport/ChromeClientWx.h index 74e0023..df1fdd8 100644 --- a/WebKit/wx/WebKitSupport/ChromeClientWx.h +++ b/WebKit/wx/WebKitSupport/ChromeClientWx.h @@ -110,8 +110,9 @@ public: virtual void print(Frame*); +#if ENABLE(DATABASE) virtual void exceededDatabaseQuota(Frame*, const String&); - +#endif virtual void runOpenPanel(Frame*, PassRefPtr<FileChooser>); virtual void formStateDidChange(const Node*) { } |