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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 if (exceptionState.hadException()) { | 459 if (exceptionState.hadException()) { |
460 m_requestCallback->sendFailure("Could not continue cursor."); | 460 m_requestCallback->sendFailure("Could not continue cursor."); |
461 return; | 461 return; |
462 } | 462 } |
463 | 463 |
464 Document* document = toDocument(m_scriptState->executionContext()); | 464 Document* document = toDocument(m_scriptState->executionContext()); |
465 if (!document) | 465 if (!document) |
466 return; | 466 return; |
467 // FIXME: There are no tests for this error showing when a recursive | 467 // FIXME: There are no tests for this error showing when a recursive |
468 // object is inspected. | 468 // object is inspected. |
469 const String errorMessage("\"Inspection error. Maximum depth reached?\""
); | 469 const String16 errorMessage("\"Inspection error. Maximum depth reached?\
""); |
470 ScriptState* scriptState = m_scriptState.get(); | 470 ScriptState* scriptState = m_scriptState.get(); |
471 ScriptState::Scope scope(scriptState); | 471 ScriptState::Scope scope(scriptState); |
472 OwnPtr<protocol::Value> keyJsonValue = toProtocolValue(scriptState->cont
ext(), idbCursor->key(scriptState).v8Value()); | 472 OwnPtr<protocol::Value> keyJsonValue = toProtocolValue(scriptState->cont
ext(), idbCursor->key(scriptState).v8Value()); |
473 OwnPtr<protocol::Value> primaryKeyJsonValue = toProtocolValue(scriptStat
e->context(), idbCursor->primaryKey(scriptState).v8Value()); | 473 OwnPtr<protocol::Value> primaryKeyJsonValue = toProtocolValue(scriptStat
e->context(), idbCursor->primaryKey(scriptState).v8Value()); |
474 OwnPtr<protocol::Value> valueJsonValue = toProtocolValue(scriptState->co
ntext(), idbCursor->value(scriptState).v8Value()); | 474 OwnPtr<protocol::Value> valueJsonValue = toProtocolValue(scriptState->co
ntext(), idbCursor->value(scriptState).v8Value()); |
475 String key = keyJsonValue ? keyJsonValue->toJSONString() : errorMessage; | 475 String16 key = keyJsonValue ? keyJsonValue->toJSONString() : errorMessag
e; |
476 String value = valueJsonValue ? valueJsonValue->toJSONString() : errorMe
ssage; | 476 String16 value = valueJsonValue ? valueJsonValue->toJSONString() : error
Message; |
477 String primaryKey = primaryKeyJsonValue ? primaryKeyJsonValue->toJSONStr
ing() : errorMessage; | 477 String primaryKey = primaryKeyJsonValue ? primaryKeyJsonValue->toJSONStr
ing() : errorMessage; |
478 OwnPtr<DataEntry> dataEntry = DataEntry::create() | 478 OwnPtr<DataEntry> dataEntry = DataEntry::create() |
479 .setKey(key) | 479 .setKey(key) |
480 .setPrimaryKey(primaryKey) | 480 .setPrimaryKey(primaryKey) |
481 .setValue(value).build(); | 481 .setValue(value).build(); |
482 m_result->addItem(dataEntry.release()); | 482 m_result->addItem(dataEntry.release()); |
483 } | 483 } |
484 | 484 |
485 void end(bool hasMore) | 485 void end(bool hasMore) |
486 { | 486 { |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); | 805 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); |
806 } | 806 } |
807 | 807 |
808 DEFINE_TRACE(InspectorIndexedDBAgent) | 808 DEFINE_TRACE(InspectorIndexedDBAgent) |
809 { | 809 { |
810 visitor->trace(m_inspectedFrames); | 810 visitor->trace(m_inspectedFrames); |
811 InspectorBaseAgent::trace(visitor); | 811 InspectorBaseAgent::trace(visitor); |
812 } | 812 } |
813 | 813 |
814 } // namespace blink | 814 } // namespace blink |
OLD | NEW |