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

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

Issue 11337028: Merge 132922 - Remove ensureAuxiliaryContext (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years, 2 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/WebCore/Modules/indexeddb/IDBRequest.cpp ('k') | Source/WebCore/bindings/v8/V8PerIsolateData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/bindings/v8/IDBBindingUtilities.cpp
===================================================================
--- Source/WebCore/bindings/v8/IDBBindingUtilities.cpp (revision 132933)
+++ Source/WebCore/bindings/v8/IDBBindingUtilities.cpp (working copy)
@@ -179,10 +179,9 @@
IDBKeyPathParseError error;
IDBParseKeyPath(keyPath, keyPathElements, error);
ASSERT(error == IDBKeyPathParseErrorNone);
+ ASSERT(v8::Context::InContext());
v8::HandleScope handleScope;
- v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext());
-
v8::Handle<v8::Value> v8Value(value.v8Value());
v8::Handle<v8::Value> v8Key(getNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size()));
if (v8Key.IsEmpty())
@@ -194,8 +193,10 @@
{
IDB_TRACE("createIDBKeyFromScriptValueAndKeyPath");
ASSERT(!keyPath.isNull());
+ ASSERT(v8::Context::InContext());
- v8::HandleScope scope;
+
+ v8::HandleScope handleScope;
if (keyPath.type() == IDBKeyPath::ArrayType) {
IDBKey::KeyArray result;
const Vector<String>& array = keyPath.array();
@@ -212,11 +213,10 @@
return createIDBKeyFromScriptValueAndKeyPath(value, keyPath.string());
}
-// FIXME: The only reason this exists is because we need a v8::Context and scope inside a timer. Is there a better / more general way to do this?
ScriptValue deserializeIDBValue(ScriptExecutionContext* scriptContext, PassRefPtr<SerializedScriptValue> prpValue)
{
+ ASSERT(v8::Context::InContext());
v8::HandleScope handleScope;
- v8::Context::Scope contextScope(toV8Context(scriptContext, UseCurrentWorld));
RefPtr<SerializedScriptValue> serializedValue = prpValue;
if (serializedValue)
return ScriptValue(serializedValue->deserialize());
@@ -226,6 +226,7 @@
bool injectIDBKeyIntoScriptValue(PassRefPtr<IDBKey> key, ScriptValue& value, const IDBKeyPath& keyPath)
{
IDB_TRACE("injectIDBKeyIntoScriptValue");
+ ASSERT(v8::Context::InContext());
ASSERT(keyPath.type() == IDBKeyPath::StringType);
Vector<String> keyPathElements;
@@ -237,8 +238,6 @@
return 0;
v8::HandleScope handleScope;
- v8::Context::Scope scope(V8PerIsolateData::current()->ensureAuxiliaryContext());
-
v8::Handle<v8::Value> v8Value(value.v8Value());
v8::Handle<v8::Value> parent(ensureNthValueOnKeyPath(v8Value, keyPathElements, keyPathElements.size() - 1));
if (parent.IsEmpty())
@@ -268,9 +267,8 @@
ScriptValue idbKeyToScriptValue(ScriptExecutionContext* scriptContext, PassRefPtr<IDBKey> key)
{
+ ASSERT(v8::Context::InContext());
v8::HandleScope handleScope;
- v8::Context::Scope contextScope(toV8Context(scriptContext, UseCurrentWorld));
-
v8::Handle<v8::Value> v8Value(toV8(key.get()));
return ScriptValue(v8Value);
}
« no previous file with comments | « Source/WebCore/Modules/indexeddb/IDBRequest.cpp ('k') | Source/WebCore/bindings/v8/V8PerIsolateData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698