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

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

Issue 236783002: Pass NewScriptState to idbAnyToScriptValue() and idbKeyToScriptValue() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/bindings/v8/IDBBindingUtilitiesTest.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 1be91ab4dc0b64b686154063d19f2dadcfb28454..34e8bbe2375a13d3c10df3c15c23299618748d02 100644
--- a/Source/bindings/v8/IDBBindingUtilities.cpp
+++ b/Source/bindings/v8/IDBBindingUtilities.cpp
@@ -403,23 +403,19 @@ bool canInjectIDBKeyIntoScriptValue(DOMRequestState* state, const ScriptValue& s
return canInjectNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size() - 1, state->context()->GetIsolate());
}
-ScriptValue idbAnyToScriptValue(DOMRequestState* state, PassRefPtr<IDBAny> any)
+ScriptValue idbAnyToScriptValue(NewScriptState* scriptState, PassRefPtr<IDBAny> any)
{
- v8::Isolate* isolate = state ? state->isolate() : v8::Isolate::GetCurrent();
- ASSERT(isolate->InContext());
- v8::Local<v8::Context> context = state ? state->context() : isolate->GetCurrentContext();
+ v8::Isolate* isolate = scriptState->isolate();
v8::HandleScope handleScope(isolate);
- v8::Handle<v8::Value> v8Value(toV8(any.get(), context->Global(), isolate));
+ v8::Handle<v8::Value> v8Value(toV8(any.get(), scriptState->context()->Global(), isolate));
return ScriptValue(v8Value, isolate);
}
-ScriptValue idbKeyToScriptValue(DOMRequestState* state, PassRefPtr<IDBKey> key)
+ScriptValue idbKeyToScriptValue(NewScriptState* scriptState, PassRefPtr<IDBKey> key)
{
- v8::Isolate* isolate = state ? state->isolate() : v8::Isolate::GetCurrent();
- ASSERT(isolate->InContext());
- v8::Local<v8::Context> context = state ? state->context() : isolate->GetCurrentContext();
+ v8::Isolate* isolate = scriptState->isolate();
v8::HandleScope handleScope(isolate);
- v8::Handle<v8::Value> v8Value(toV8(key.get(), context->Global(), isolate));
+ v8::Handle<v8::Value> v8Value(toV8(key.get(), scriptState->context()->Global(), isolate));
return ScriptValue(v8Value, isolate);
}
@@ -448,7 +444,7 @@ void assertPrimaryKeyValidOrInjectable(DOMRequestState* state, PassRefPtr<Shared
DOMRequestState::Scope scope(*state);
v8::Isolate* isolate = state ? state->isolate() : v8::Isolate::GetCurrent();
- ScriptValue keyValue = idbKeyToScriptValue(state, key);
+ ScriptValue keyValue = idbKeyToScriptValue(state->scriptState(), key);
ScriptValue scriptValue(deserializeIDBValueBuffer(buffer.get(), isolate), isolate);
// This assertion is about already persisted data, so allow experimental types.
« no previous file with comments | « Source/bindings/v8/IDBBindingUtilities.h ('k') | Source/bindings/v8/IDBBindingUtilitiesTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698