| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 | 519 |
| 520 ExceptionCode ec = 0; | 520 ExceptionCode ec = 0; |
| 521 RefPtr<IDBRequest> idbRequest; | 521 RefPtr<IDBRequest> idbRequest; |
| 522 if (!m_indexName.isEmpty()) { | 522 if (!m_indexName.isEmpty()) { |
| 523 RefPtr<IDBIndex> idbIndex = indexForObjectStore(idbObjectStore.get()
, m_indexName); | 523 RefPtr<IDBIndex> idbIndex = indexForObjectStore(idbObjectStore.get()
, m_indexName); |
| 524 if (!idbIndex) { | 524 if (!idbIndex) { |
| 525 m_requestCallback->sendFailure("Could not get index"); | 525 m_requestCallback->sendFailure("Could not get index"); |
| 526 return; | 526 return; |
| 527 } | 527 } |
| 528 | 528 |
| 529 idbRequest = idbIndex->openCursor(context(), PassRefPtr<IDBKeyRange>
(m_idbKeyRange), ec); | 529 idbRequest = idbIndex->openCursor(context(), PassRefPtr<IDBKeyRange>
(m_idbKeyRange), IDBCursor::directionNext(), ec); |
| 530 } else | 530 } else |
| 531 idbRequest = idbObjectStore->openCursor(context(), PassRefPtr<IDBKey
Range>(m_idbKeyRange), ec); | 531 idbRequest = idbObjectStore->openCursor(context(), PassRefPtr<IDBKey
Range>(m_idbKeyRange), IDBCursor::directionNext(), ec); |
| 532 idbRequest->addEventListener(eventNames().successEvent, openCursorCallba
ck, false); | 532 idbRequest->addEventListener(eventNames().successEvent, openCursorCallba
ck, false); |
| 533 } | 533 } |
| 534 | 534 |
| 535 virtual RequestCallback* requestCallback() { return m_requestCallback.get();
} | 535 virtual RequestCallback* requestCallback() { return m_requestCallback.get();
} |
| 536 DataLoader(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<Reques
tDataCallback> requestCallback, const InjectedScript& injectedScript, const Stri
ng& objectStoreName, const String& indexName, PassRefPtr<IDBKeyRange> idbKeyRang
e, int skipCount, unsigned pageSize) | 536 DataLoader(ScriptExecutionContext* scriptExecutionContext, PassRefPtr<Reques
tDataCallback> requestCallback, const InjectedScript& injectedScript, const Stri
ng& objectStoreName, const String& indexName, PassRefPtr<IDBKeyRange> idbKeyRang
e, int skipCount, unsigned pageSize) |
| 537 : ExecutableWithDatabase(scriptExecutionContext) | 537 : ExecutableWithDatabase(scriptExecutionContext) |
| 538 , m_requestCallback(requestCallback) | 538 , m_requestCallback(requestCallback) |
| 539 , m_injectedScript(injectedScript) | 539 , m_injectedScript(injectedScript) |
| 540 , m_objectStoreName(objectStoreName) | 540 , m_objectStoreName(objectStoreName) |
| 541 , m_indexName(indexName) | 541 , m_indexName(indexName) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 v8::HandleScope handleScope; | 782 v8::HandleScope handleScope; |
| 783 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont
ext(); | 783 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont
ext(); |
| 784 ASSERT(!context.IsEmpty()); | 784 ASSERT(!context.IsEmpty()); |
| 785 v8::Context::Scope contextScope(context); | 785 v8::Context::Scope contextScope(context); |
| 786 | 786 |
| 787 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen
t, objectStoreName, requestCallback); | 787 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen
t, objectStoreName, requestCallback); |
| 788 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); | 788 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); |
| 789 } | 789 } |
| 790 | 790 |
| 791 } // namespace WebCore | 791 } // namespace WebCore |
| OLD | NEW |