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

Unified Diff: Source/modules/indexeddb/InspectorIndexedDBAgent.cpp

Issue 1020233002: [bindings] [devtools] Migrate the usage of ScriptValue.toJSONValue() to ScriptValue::to<JSONValuePt… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 9 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/core/inspector/InjectedScriptBase.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
diff --git a/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
index d3613dc8b1ec3287d12e3c934f914225c563fb04..5bae8c6f7781a6cbfd9b4d594b489e132cdedbda 100644
--- a/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
+++ b/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
@@ -449,9 +449,12 @@ public:
// FIXME: There are no tests for this error showing when a recursive
// object is inspected.
const String errorMessage("\"Inspection error. Maximum depth reached?\"");
- RefPtr<JSONValue> keyJsonValue = idbCursor->key(m_scriptState.get()).toJSONValue(m_scriptState.get());
- RefPtr<JSONValue> primaryKeyJsonValue = idbCursor->primaryKey(m_scriptState.get()).toJSONValue(m_scriptState.get());
- RefPtr<JSONValue> valueJsonValue = idbCursor->value(m_scriptState.get()).toJSONValue(m_scriptState.get());
+ ScriptState* scriptState = m_scriptState.get();
+ v8::Isolate* isolate = scriptState->isolate();
+ ScriptState::Scope scope(scriptState);
+ RefPtr<JSONValue> keyJsonValue = ScriptValue::to<JSONValuePtr>(isolate, idbCursor->key(scriptState), exceptionState);
+ RefPtr<JSONValue> primaryKeyJsonValue = ScriptValue::to<JSONValuePtr>(isolate, idbCursor->primaryKey(scriptState), exceptionState);
+ RefPtr<JSONValue> valueJsonValue = ScriptValue::to<JSONValuePtr>(isolate, idbCursor->value(scriptState), exceptionState);
String key = keyJsonValue ? keyJsonValue->toJSONString() : errorMessage;
String value = valueJsonValue ? valueJsonValue->toJSONString() : errorMessage;
String primaryKey = primaryKeyJsonValue ? primaryKeyJsonValue->toJSONString() : errorMessage;
« no previous file with comments | « Source/core/inspector/InjectedScriptBase.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698