Chromium Code Reviews| Index: Source/bindings/v8/IDBBindingUtilities.cpp |
| diff --git a/Source/bindings/v8/IDBBindingUtilities.cpp b/Source/bindings/v8/IDBBindingUtilities.cpp |
| index 4cc3a4b4424a77fbc8d703440fca27966beb90e4..8ea735c4dce5fca50dd57fe19bbc84630464f594 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,15 @@ PassRefPtr<IDBKey> scriptValueToIDBKey(DOMRequestState* state, const ScriptValue |
| return createIDBKeyFromValue(v8Value); |
| } |
| +PassRefPtr<IDBKeyRange> scriptValueToIDBKeyRange(DOMRequestState* state, const ScriptValue& scriptValue) |
| +{ |
| + ASSERT(v8::Context::InContext()); |
|
haraken
2013/08/25 23:51:06
Why do you want to have this check? Given that the
jsbell
2013/08/26 16:06:18
Purely copy/paste from the above methods. I'll rem
|
| + 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 |