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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 RefPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::crea
te(m_injectedScript, m_requestCallback, m_skipCount, m_pageSize); | 513 RefPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::crea
te(m_injectedScript, m_requestCallback, m_skipCount, m_pageSize); |
514 | 514 |
515 RefPtr<IDBRequest> idbRequest; | 515 RefPtr<IDBRequest> idbRequest; |
516 if (!m_indexName.isEmpty()) { | 516 if (!m_indexName.isEmpty()) { |
517 RefPtr<IDBIndex> idbIndex = indexForObjectStore(idbObjectStore.get()
, m_indexName); | 517 RefPtr<IDBIndex> idbIndex = indexForObjectStore(idbObjectStore.get()
, m_indexName); |
518 if (!idbIndex) { | 518 if (!idbIndex) { |
519 m_requestCallback->sendFailure("Could not get index"); | 519 m_requestCallback->sendFailure("Could not get index"); |
520 return; | 520 return; |
521 } | 521 } |
522 | 522 |
523 idbRequest = idbIndex->openCursor(context(), PassRefPtr<IDBKeyRange>
(m_idbKeyRange), IDBCursor::directionNext(), IGNORE_EXCEPTION); | 523 idbRequest = idbIndex->openCursor(context(), PassRefPtr<IDBKeyRange>
(m_idbKeyRange), IndexedDB::CursorNext); |
524 } else { | 524 } else { |
525 idbRequest = idbObjectStore->openCursor(context(), PassRefPtr<IDBKey
Range>(m_idbKeyRange), IDBCursor::directionNext(), IGNORE_EXCEPTION); | 525 idbRequest = idbObjectStore->openCursor(context(), PassRefPtr<IDBKey
Range>(m_idbKeyRange), IndexedDB::CursorNext); |
526 } | 526 } |
527 idbRequest->addEventListener(eventNames().successEvent, openCursorCallba
ck, false); | 527 idbRequest->addEventListener(eventNames().successEvent, openCursorCallba
ck, false); |
528 } | 528 } |
529 | 529 |
530 virtual RequestCallback* requestCallback() { return m_requestCallback.get();
} | 530 virtual RequestCallback* requestCallback() { return m_requestCallback.get();
} |
531 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) | 531 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) |
532 : ExecutableWithDatabase(scriptExecutionContext) | 532 : ExecutableWithDatabase(scriptExecutionContext) |
533 , m_requestCallback(requestCallback) | 533 , m_requestCallback(requestCallback) |
534 , m_injectedScript(injectedScript) | 534 , m_injectedScript(injectedScript) |
535 , m_objectStoreName(objectStoreName) | 535 , m_objectStoreName(objectStoreName) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 v8::HandleScope handleScope; | 778 v8::HandleScope handleScope; |
779 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont
ext(); | 779 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont
ext(); |
780 ASSERT(!context.IsEmpty()); | 780 ASSERT(!context.IsEmpty()); |
781 v8::Context::Scope contextScope(context); | 781 v8::Context::Scope contextScope(context); |
782 | 782 |
783 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen
t, objectStoreName, requestCallback); | 783 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen
t, objectStoreName, requestCallback); |
784 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); | 784 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName
); |
785 } | 785 } |
786 | 786 |
787 } // namespace WebCore | 787 } // namespace WebCore |
OLD | NEW |