| OLD | NEW |
| 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 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 return; | 488 return; |
| 489 } | 489 } |
| 490 | 490 |
| 491 Document* document = toDocument(m_scriptState->executionContext()); | 491 Document* document = toDocument(m_scriptState->executionContext()); |
| 492 if (!document) | 492 if (!document) |
| 493 return; | 493 return; |
| 494 // FIXME: There are no tests for this error showing when a recursive | 494 // FIXME: There are no tests for this error showing when a recursive |
| 495 // object is inspected. | 495 // object is inspected. |
| 496 const String errorMessage("\"Inspection error. Maximum depth reached?\""
); | 496 const String errorMessage("\"Inspection error. Maximum depth reached?\""
); |
| 497 ScriptState* scriptState = m_scriptState.get(); | 497 ScriptState* scriptState = m_scriptState.get(); |
| 498 v8::Isolate* isolate = scriptState->isolate(); | |
| 499 ScriptState::Scope scope(scriptState); | 498 ScriptState::Scope scope(scriptState); |
| 500 RefPtr<JSONValue> keyJsonValue = toJSONValue(isolate, idbCursor->key(scr
iptState).v8Value()); | 499 RefPtr<JSONValue> keyJsonValue = toJSONValue(scriptState->context(), idb
Cursor->key(scriptState).v8Value()); |
| 501 RefPtr<JSONValue> primaryKeyJsonValue = toJSONValue(isolate, idbCursor->
primaryKey(scriptState).v8Value()); | 500 RefPtr<JSONValue> primaryKeyJsonValue = toJSONValue(scriptState->context
(), idbCursor->primaryKey(scriptState).v8Value()); |
| 502 RefPtr<JSONValue> valueJsonValue = toJSONValue(isolate, idbCursor->value
(scriptState).v8Value()); | 501 RefPtr<JSONValue> valueJsonValue = toJSONValue(scriptState->context(), i
dbCursor->value(scriptState).v8Value()); |
| 503 String key = keyJsonValue ? keyJsonValue->toJSONString() : errorMessage; | 502 String key = keyJsonValue ? keyJsonValue->toJSONString() : errorMessage; |
| 504 String value = valueJsonValue ? valueJsonValue->toJSONString() : errorMe
ssage; | 503 String value = valueJsonValue ? valueJsonValue->toJSONString() : errorMe
ssage; |
| 505 String primaryKey = primaryKeyJsonValue ? primaryKeyJsonValue->toJSONStr
ing() : errorMessage; | 504 String primaryKey = primaryKeyJsonValue ? primaryKeyJsonValue->toJSONStr
ing() : errorMessage; |
| 506 RefPtr<DataEntry> dataEntry = DataEntry::create() | 505 RefPtr<DataEntry> dataEntry = DataEntry::create() |
| 507 .setKey(key) | 506 .setKey(key) |
| 508 .setPrimaryKey(primaryKey) | 507 .setPrimaryKey(primaryKey) |
| 509 .setValue(value); | 508 .setValue(value); |
| 510 m_result->addItem(dataEntry); | 509 m_result->addItem(dataEntry); |
| 511 } | 510 } |
| 512 | 511 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); | 835 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); |
| 837 } | 836 } |
| 838 | 837 |
| 839 DEFINE_TRACE(InspectorIndexedDBAgent) | 838 DEFINE_TRACE(InspectorIndexedDBAgent) |
| 840 { | 839 { |
| 841 visitor->trace(m_inspectedFrames); | 840 visitor->trace(m_inspectedFrames); |
| 842 InspectorBaseAgent::trace(visitor); | 841 InspectorBaseAgent::trace(visitor); |
| 843 } | 842 } |
| 844 | 843 |
| 845 } // namespace blink | 844 } // namespace blink |
| OLD | NEW |