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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
52 #include "modules/indexeddb/IDBKeyPath.h" | 52 #include "modules/indexeddb/IDBKeyPath.h" |
53 #include "modules/indexeddb/IDBKeyRange.h" | 53 #include "modules/indexeddb/IDBKeyRange.h" |
54 #include "modules/indexeddb/IDBMetadata.h" | 54 #include "modules/indexeddb/IDBMetadata.h" |
55 #include "modules/indexeddb/IDBObjectStore.h" | 55 #include "modules/indexeddb/IDBObjectStore.h" |
56 #include "modules/indexeddb/IDBOpenDBRequest.h" | 56 #include "modules/indexeddb/IDBOpenDBRequest.h" |
57 #include "modules/indexeddb/IDBPendingTransactionMonitor.h" | 57 #include "modules/indexeddb/IDBPendingTransactionMonitor.h" |
58 #include "modules/indexeddb/IDBRequest.h" | 58 #include "modules/indexeddb/IDBRequest.h" |
59 #include "modules/indexeddb/IDBTransaction.h" | 59 #include "modules/indexeddb/IDBTransaction.h" |
60 #include "platform/JSONValues.h" | 60 #include "platform/JSONValues.h" |
61 #include "platform/weborigin/SecurityOrigin.h" | 61 #include "platform/weborigin/SecurityOrigin.h" |
62 #include "public/platform/WebIDBCursor.h" | 62 #include "public/platform/WebIDBCursor.h" |
jsbell
2014/06/09 16:27:09
Needs to include public/platform/WebIDBTypes.h
Pritam Nikam
2014/06/11 14:07:47
Done.
| |
63 #include "wtf/Vector.h" | 63 #include "wtf/Vector.h" |
64 | 64 |
65 using WebCore::TypeBuilder::Array; | 65 using WebCore::TypeBuilder::Array; |
66 using WebCore::TypeBuilder::IndexedDB::DatabaseWithObjectStores; | 66 using WebCore::TypeBuilder::IndexedDB::DatabaseWithObjectStores; |
67 using WebCore::TypeBuilder::IndexedDB::DataEntry; | 67 using WebCore::TypeBuilder::IndexedDB::DataEntry; |
68 using WebCore::TypeBuilder::IndexedDB::Key; | 68 using WebCore::TypeBuilder::IndexedDB::Key; |
69 using WebCore::TypeBuilder::IndexedDB::KeyPath; | 69 using WebCore::TypeBuilder::IndexedDB::KeyPath; |
70 using WebCore::TypeBuilder::IndexedDB::KeyRange; | 70 using WebCore::TypeBuilder::IndexedDB::KeyRange; |
71 using WebCore::TypeBuilder::IndexedDB::ObjectStore; | 71 using WebCore::TypeBuilder::IndexedDB::ObjectStore; |
72 using WebCore::TypeBuilder::IndexedDB::ObjectStoreIndex; | 72 using WebCore::TypeBuilder::IndexedDB::ObjectStoreIndex; |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 RefPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::crea te(scriptState(), m_requestCallback, m_skipCount, m_pageSize); | 503 RefPtr<OpenCursorCallback> openCursorCallback = OpenCursorCallback::crea te(scriptState(), m_requestCallback, m_skipCount, m_pageSize); |
504 | 504 |
505 IDBRequest* idbRequest; | 505 IDBRequest* idbRequest; |
506 if (!m_indexName.isEmpty()) { | 506 if (!m_indexName.isEmpty()) { |
507 IDBIndex* idbIndex = indexForObjectStore(idbObjectStore, m_indexName ); | 507 IDBIndex* idbIndex = indexForObjectStore(idbObjectStore, m_indexName ); |
508 if (!idbIndex) { | 508 if (!idbIndex) { |
509 m_requestCallback->sendFailure("Could not get index"); | 509 m_requestCallback->sendFailure("Could not get index"); |
510 return; | 510 return; |
511 } | 511 } |
512 | 512 |
513 idbRequest = idbIndex->openCursor(scriptState(), m_idbKeyRange.get() , blink::WebIDBCursor::Next); | 513 idbRequest = idbIndex->openCursor(scriptState(), m_idbKeyRange.get() , blink::Next); |
514 } else { | 514 } else { |
515 idbRequest = idbObjectStore->openCursor(scriptState(), m_idbKeyRange .get(), blink::WebIDBCursor::Next); | 515 idbRequest = idbObjectStore->openCursor(scriptState(), m_idbKeyRange .get(), blink::Next); |
516 } | 516 } |
517 idbRequest->addEventListener(EventTypeNames::success, openCursorCallback , false); | 517 idbRequest->addEventListener(EventTypeNames::success, openCursorCallback , false); |
518 } | 518 } |
519 | 519 |
520 virtual RequestCallback* requestCallback() OVERRIDE { return m_requestCallba ck.get(); } | 520 virtual RequestCallback* requestCallback() OVERRIDE { return m_requestCallba ck.get(); } |
521 DataLoader(ScriptState* scriptState, PassRefPtr<RequestDataCallback> request Callback, const String& objectStoreName, const String& indexName, IDBKeyRange* i dbKeyRange, int skipCount, unsigned pageSize) | 521 DataLoader(ScriptState* scriptState, PassRefPtr<RequestDataCallback> request Callback, const String& objectStoreName, const String& indexName, IDBKeyRange* i dbKeyRange, int skipCount, unsigned pageSize) |
522 : ExecutableWithDatabase(scriptState) | 522 : ExecutableWithDatabase(scriptState) |
523 , m_requestCallback(requestCallback) | 523 , m_requestCallback(requestCallback) |
524 , m_objectStoreName(objectStoreName) | 524 , m_objectStoreName(objectStoreName) |
525 , m_indexName(indexName) | 525 , m_indexName(indexName) |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
767 if (!idbFactory) | 767 if (!idbFactory) |
768 return; | 768 return; |
769 | 769 |
770 ScriptState* scriptState = ScriptState::forMainWorld(frame); | 770 ScriptState* scriptState = ScriptState::forMainWorld(frame); |
771 ScriptState::Scope scope(scriptState); | 771 ScriptState::Scope scope(scriptState); |
772 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(scriptS tate, objectStoreName, requestCallback); | 772 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(scriptS tate, objectStoreName, requestCallback); |
773 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName ); | 773 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName ); |
774 } | 774 } |
775 | 775 |
776 } // namespace WebCore | 776 } // namespace WebCore |
OLD | NEW |