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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/inspector/InjectedScriptBase.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 m_requestCallback->sendFailure("Could not continue cursor."); 442 m_requestCallback->sendFailure("Could not continue cursor.");
443 return; 443 return;
444 } 444 }
445 445
446 Document* document = toDocument(m_scriptState->executionContext()); 446 Document* document = toDocument(m_scriptState->executionContext());
447 if (!document) 447 if (!document)
448 return; 448 return;
449 // FIXME: There are no tests for this error showing when a recursive 449 // FIXME: There are no tests for this error showing when a recursive
450 // object is inspected. 450 // object is inspected.
451 const String errorMessage("\"Inspection error. Maximum depth reached?\"" ); 451 const String errorMessage("\"Inspection error. Maximum depth reached?\"" );
452 RefPtr<JSONValue> keyJsonValue = idbCursor->key(m_scriptState.get()).toJ SONValue(m_scriptState.get()); 452 ScriptState* scriptState = m_scriptState.get();
453 RefPtr<JSONValue> primaryKeyJsonValue = idbCursor->primaryKey(m_scriptSt ate.get()).toJSONValue(m_scriptState.get()); 453 v8::Isolate* isolate = scriptState->isolate();
454 RefPtr<JSONValue> valueJsonValue = idbCursor->value(m_scriptState.get()) .toJSONValue(m_scriptState.get()); 454 ScriptState::Scope scope(scriptState);
455 RefPtr<JSONValue> keyJsonValue = ScriptValue::to<JSONValuePtr>(isolate, idbCursor->key(scriptState), exceptionState);
456 RefPtr<JSONValue> primaryKeyJsonValue = ScriptValue::to<JSONValuePtr>(is olate, idbCursor->primaryKey(scriptState), exceptionState);
457 RefPtr<JSONValue> valueJsonValue = ScriptValue::to<JSONValuePtr>(isolate , idbCursor->value(scriptState), exceptionState);
455 String key = keyJsonValue ? keyJsonValue->toJSONString() : errorMessage; 458 String key = keyJsonValue ? keyJsonValue->toJSONString() : errorMessage;
456 String value = valueJsonValue ? valueJsonValue->toJSONString() : errorMe ssage; 459 String value = valueJsonValue ? valueJsonValue->toJSONString() : errorMe ssage;
457 String primaryKey = primaryKeyJsonValue ? primaryKeyJsonValue->toJSONStr ing() : errorMessage; 460 String primaryKey = primaryKeyJsonValue ? primaryKeyJsonValue->toJSONStr ing() : errorMessage;
458 RefPtr<DataEntry> dataEntry = DataEntry::create() 461 RefPtr<DataEntry> dataEntry = DataEntry::create()
459 .setKey(key) 462 .setKey(key)
460 .setPrimaryKey(primaryKey) 463 .setPrimaryKey(primaryKey)
461 .setValue(value); 464 .setValue(value);
462 m_result->addItem(dataEntry); 465 m_result->addItem(dataEntry);
463 466
464 } 467 }
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName ); 783 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName );
781 } 784 }
782 785
783 DEFINE_TRACE(InspectorIndexedDBAgent) 786 DEFINE_TRACE(InspectorIndexedDBAgent)
784 { 787 {
785 visitor->trace(m_page); 788 visitor->trace(m_page);
786 InspectorBaseAgent::trace(visitor); 789 InspectorBaseAgent::trace(visitor);
787 } 790 }
788 791
789 } // namespace blink 792 } // namespace blink
OLDNEW
« 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