Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "core/inspector/InspectorIndexedDBAgent.h" | 33 #include "core/inspector/InspectorIndexedDBAgent.h" |
| 34 | 34 |
| 35 #include "bindings/v8/ExceptionStatePlaceholder.h" | |
| 35 #include "bindings/v8/ScriptController.h" | 36 #include "bindings/v8/ScriptController.h" |
| 36 #include "core/dom/DOMStringList.h" | 37 #include "core/dom/DOMStringList.h" |
| 37 #include "core/dom/Document.h" | 38 #include "core/dom/Document.h" |
| 38 #include "core/dom/Event.h" | 39 #include "core/dom/Event.h" |
| 39 #include "core/dom/EventListener.h" | 40 #include "core/dom/EventListener.h" |
| 40 #include "core/inspector/InjectedScript.h" | 41 #include "core/inspector/InjectedScript.h" |
| 41 #include "core/inspector/InspectorPageAgent.h" | 42 #include "core/inspector/InspectorPageAgent.h" |
| 42 #include "core/inspector/InspectorState.h" | 43 #include "core/inspector/InspectorState.h" |
| 43 #include "core/page/Frame.h" | 44 #include "core/page/Frame.h" |
| 44 #include "core/platform/JSONValues.h" | 45 #include "core/platform/JSONValues.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 202 RefPtr<IDBOpenDBRequest> idbOpenDBRequest = idbFactory->open(context(), data baseName, ec); | 203 RefPtr<IDBOpenDBRequest> idbOpenDBRequest = idbFactory->open(context(), data baseName, ec); |
| 203 if (ec) { | 204 if (ec) { |
| 204 requestCallback()->sendFailure("Could not open database."); | 205 requestCallback()->sendFailure("Could not open database."); |
| 205 return; | 206 return; |
| 206 } | 207 } |
| 207 idbOpenDBRequest->addEventListener(eventNames().successEvent, callback, fals e); | 208 idbOpenDBRequest->addEventListener(eventNames().successEvent, callback, fals e); |
| 208 } | 209 } |
| 209 | 210 |
| 210 static PassRefPtr<IDBTransaction> transactionForDatabase(ScriptExecutionContext* scriptExecutionContext, IDBDatabase* idbDatabase, const String& objectStoreName , const String& mode = IDBTransaction::modeReadOnly()) | 211 static PassRefPtr<IDBTransaction> transactionForDatabase(ScriptExecutionContext* scriptExecutionContext, IDBDatabase* idbDatabase, const String& objectStoreName , const String& mode = IDBTransaction::modeReadOnly()) |
| 211 { | 212 { |
| 212 ExceptionCode ec = 0; | 213 IgnorableExceptionState es; |
|
arv (Not doing code reviews)
2013/07/01 22:29:31
Maybe another subclass... ignore is not really the
jsbell
2013/07/02 18:48:08
Agreed, and I don't have a better suggestion.
arv (Not doing code reviews)
2013/07/09 23:41:04
Done.
| |
| 213 RefPtr<IDBTransaction> idbTransaction = idbDatabase->transaction(scriptExecu tionContext, objectStoreName, mode, ec); | 214 RefPtr<IDBTransaction> idbTransaction = idbDatabase->transaction(scriptExecu tionContext, objectStoreName, mode, es); |
| 214 if (ec) | 215 if (es.hadException()) |
| 215 return 0; | 216 return 0; |
| 216 return idbTransaction; | 217 return idbTransaction; |
| 217 } | 218 } |
| 218 | 219 |
| 219 static PassRefPtr<IDBObjectStore> objectStoreForTransaction(IDBTransaction* idbT ransaction, const String& objectStoreName) | 220 static PassRefPtr<IDBObjectStore> objectStoreForTransaction(IDBTransaction* idbT ransaction, const String& objectStoreName) |
| 220 { | 221 { |
| 221 ExceptionCode ec = 0; | 222 IgnorableExceptionState es; |
| 222 RefPtr<IDBObjectStore> idbObjectStore = idbTransaction->objectStore(objectSt oreName, ec); | 223 RefPtr<IDBObjectStore> idbObjectStore = idbTransaction->objectStore(objectSt oreName, es); |
| 223 if (ec) | 224 if (es.hadException()) |
| 224 return 0; | 225 return 0; |
| 225 return idbObjectStore; | 226 return idbObjectStore; |
| 226 } | 227 } |
| 227 | 228 |
| 228 static PassRefPtr<IDBIndex> indexForObjectStore(IDBObjectStore* idbObjectStore, const String& indexName) | 229 static PassRefPtr<IDBIndex> indexForObjectStore(IDBObjectStore* idbObjectStore, const String& indexName) |
| 229 { | 230 { |
| 230 ExceptionCode ec = 0; | 231 IgnorableExceptionState es; |
| 231 RefPtr<IDBIndex> idbIndex = idbObjectStore->index(indexName, ec); | 232 RefPtr<IDBIndex> idbIndex = idbObjectStore->index(indexName, es); |
| 232 if (ec) | 233 if (es.hadException()) |
| 233 return 0; | 234 return 0; |
| 234 return idbIndex; | 235 return idbIndex; |
| 235 } | 236 } |
| 236 | 237 |
| 237 static PassRefPtr<KeyPath> keyPathFromIDBKeyPath(const IDBKeyPath& idbKeyPath) | 238 static PassRefPtr<KeyPath> keyPathFromIDBKeyPath(const IDBKeyPath& idbKeyPath) |
| 238 { | 239 { |
| 239 RefPtr<KeyPath> keyPath; | 240 RefPtr<KeyPath> keyPath; |
| 240 switch (idbKeyPath.type()) { | 241 switch (idbKeyPath.type()) { |
| 241 case IDBKeyPath::NullType: | 242 case IDBKeyPath::NullType: |
| 242 keyPath = KeyPath::create().setType(KeyPath::Type::Null); | 243 keyPath = KeyPath::create().setType(KeyPath::Type::Null); |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 777 v8::HandleScope handleScope; | 778 v8::HandleScope handleScope; |
| 778 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont ext(); | 779 v8::Handle<v8::Context> context = document->frame()->script()->mainWorldCont ext(); |
| 779 ASSERT(!context.IsEmpty()); | 780 ASSERT(!context.IsEmpty()); |
| 780 v8::Context::Scope contextScope(context); | 781 v8::Context::Scope contextScope(context); |
| 781 | 782 |
| 782 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen t, objectStoreName, requestCallback); | 783 RefPtr<ClearObjectStore> clearObjectStore = ClearObjectStore::create(documen t, objectStoreName, requestCallback); |
| 783 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName ); | 784 clearObjectStore->start(idbFactory, document->securityOrigin(), databaseName ); |
| 784 } | 785 } |
| 785 | 786 |
| 786 } // namespace WebCore | 787 } // namespace WebCore |
| OLD | NEW |