summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/v8/custom/V8DatabaseCustom.cpp')
-rw-r--r--WebCore/bindings/v8/custom/V8DatabaseCustom.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
index 6996d35..dbaa942 100644
--- a/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8DatabaseCustom.cpp
@@ -32,14 +32,23 @@
#if ENABLE(DATABASE)
+#ifdef MANUAL_MERGE_REQUIRED
#include "v8_binding.h"
#include "v8_proxy.h"
+#else // MANUAL_MERGE_REQUIRED
+#endif // MANUAL_MERGE_REQUIRED
#include "Database.h"
+#ifdef MANUAL_MERGE_REQUIRED
#include "V8CustomBinding.h"
+#else // MANUAL_MERGE_REQUIRED
+#include "V8Binding.h"
+#include "V8CustomBinding.h"
+#endif // MANUAL_MERGE_REQUIRED
#include "V8CustomSQLTransactionCallback.h"
#include "V8CustomSQLTransactionErrorCallback.h"
#include "V8CustomVoidCallback.h"
+#include "V8Proxy.h"
namespace WebCore {
@@ -53,37 +62,33 @@ CALLBACK_FUNC_DECL(DatabaseTransaction)
{
INC_STATS("DOM.Database.transaction()");
- if (args.Length() == 0) {
- V8Proxy::ThrowError(V8Proxy::SYNTAX_ERROR, "Transaction callback is required.");
- return v8::Undefined();
- }
+ if (!args.Length())
+ return throwError("Transaction callback is required.", V8Proxy::SyntaxError);
- if (!args[0]->IsObject()) {
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "Transaction callback must be of valid type.");
- return v8::Undefined();
- }
+ if (!args[0]->IsObject())
+ return throwError("Transaction callback must be of valid type.");
- Database* database = V8Proxy::ToNativeObject<Database>(V8ClassIndex::DATABASE, args.Holder());
+ Database* database = V8DOMWrapper::convertToNativeObject<Database>(V8ClassIndex::DATABASE, args.Holder());
- Frame* frame = V8Proxy::retrieveFrame();
+ Frame* frame = V8Proxy::retrieveFrameForCurrentContext();
+ if (!frame)
+ return v8::Undefined();
RefPtr<V8CustomSQLTransactionCallback> callback = V8CustomSQLTransactionCallback::create(args[0], frame);
RefPtr<V8CustomSQLTransactionErrorCallback> errorCallback;
if (args.Length() > 1) {
- if (!args[1]->IsObject()) {
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "Transaction error callback must be of valid type.");
- return v8::Undefined();
- }
+ if (!args[1]->IsObject())
+ return throwError("Transaction error callback must be of valid type.");
+
errorCallback = V8CustomSQLTransactionErrorCallback::create(args[1], frame);
}
RefPtr<V8CustomVoidCallback> successCallback;
if (args.Length() > 2) {
- if (!args[1]->IsObject()) {
- V8Proxy::ThrowError(V8Proxy::TYPE_ERROR, "Transaction success callback must be of valid type.");
- return v8::Undefined();
- }
+ if (!args[1]->IsObject())
+ return throwError("Transaction success callback must be of valid type.");
+
successCallback = V8CustomVoidCallback::create(args[2], frame);
}