Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Unified Diff: Source/bindings/v8/IDBBindingUtilities.cpp

Issue 22893058: IndexedDB: Replace IDL operation overloading with ScriptValue handling (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove assert, per review feedback Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.h ('k') | Source/core/inspector/InspectorIndexedDBAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/IDBBindingUtilities.cpp
diff --git a/Source/bindings/v8/IDBBindingUtilities.cpp b/Source/bindings/v8/IDBBindingUtilities.cpp
index 4cc3a4b4424a77fbc8d703440fca27966beb90e4..93b2217b0c09f861a41e6786842ec6c1df47c1bd 100644
--- a/Source/bindings/v8/IDBBindingUtilities.cpp
+++ b/Source/bindings/v8/IDBBindingUtilities.cpp
@@ -26,12 +26,14 @@
#include "config.h"
#include "bindings/v8/IDBBindingUtilities.h"
+#include "V8IDBKeyRange.h"
#include "bindings/v8/DOMRequestState.h"
#include "bindings/v8/SerializedScriptValue.h"
#include "bindings/v8/V8Binding.h"
#include "core/platform/SharedBuffer.h"
#include "modules/indexeddb/IDBKey.h"
#include "modules/indexeddb/IDBKeyPath.h"
+#include "modules/indexeddb/IDBKeyRange.h"
#include "modules/indexeddb/IDBTracing.h"
#include "wtf/MathExtras.h"
#include "wtf/Vector.h"
@@ -331,4 +333,14 @@ PassRefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState* state, const ScriptValue
return createIDBKeyFromValue(v8Value);
}
+PassRefPtr<IDBKeyRange> scriptValueToIDBKeyRange(DOMRequestState* state, const ScriptValue& scriptValue)
+{
+ v8::Isolate* isolate = state ? state->context()->GetIsolate() : v8::Isolate::GetCurrent();
+ v8::HandleScope handleScope(isolate);
+ v8::Handle<v8::Value> value(scriptValue.v8Value());
+ if (V8IDBKeyRange::HasInstance(value, isolate, worldType(isolate)))
+ return V8IDBKeyRange::toNative(value.As<v8::Object>());
+ return 0;
+}
+
} // namespace WebCore
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.h ('k') | Source/core/inspector/InspectorIndexedDBAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698