OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "modules/indexeddb/IDBAny.h" | 37 #include "modules/indexeddb/IDBAny.h" |
38 #include "modules/indexeddb/IDBEventDispatcher.h" | 38 #include "modules/indexeddb/IDBEventDispatcher.h" |
39 #include "modules/indexeddb/IDBHistograms.h" | 39 #include "modules/indexeddb/IDBHistograms.h" |
40 #include "modules/indexeddb/IDBIndex.h" | 40 #include "modules/indexeddb/IDBIndex.h" |
41 #include "modules/indexeddb/IDBKeyPath.h" | 41 #include "modules/indexeddb/IDBKeyPath.h" |
42 #include "modules/indexeddb/IDBTracing.h" | 42 #include "modules/indexeddb/IDBTracing.h" |
43 #include "modules/indexeddb/IDBVersionChangeEvent.h" | 43 #include "modules/indexeddb/IDBVersionChangeEvent.h" |
44 #include "modules/indexeddb/WebIDBDatabaseCallbacksImpl.h" | 44 #include "modules/indexeddb/WebIDBDatabaseCallbacksImpl.h" |
45 #include "public/platform/Platform.h" | 45 #include "public/platform/Platform.h" |
46 #include "public/platform/WebIDBKeyPath.h" | 46 #include "public/platform/WebIDBKeyPath.h" |
| 47 #include "public/platform/WebIDBTypes.h" |
47 #include "wtf/Atomics.h" | 48 #include "wtf/Atomics.h" |
48 #include <limits> | 49 #include <limits> |
49 | 50 |
50 using blink::WebIDBDatabase; | 51 using blink::WebIDBDatabase; |
51 | 52 |
52 namespace WebCore { | 53 namespace WebCore { |
53 | 54 |
54 const char IDBDatabase::indexDeletedErrorMessage[] = "The index or its object st
ore has been deleted."; | 55 const char IDBDatabase::indexDeletedErrorMessage[] = "The index or its object st
ore has been deleted."; |
55 const char IDBDatabase::isKeyCursorErrorMessage[] = "The cursor is a key cursor.
"; | 56 const char IDBDatabase::isKeyCursorErrorMessage[] = "The cursor is a key cursor.
"; |
56 const char IDBDatabase::noKeyOrKeyRangeErrorMessage[] = "No key or key range spe
cified."; | 57 const char IDBDatabase::noKeyOrKeyRangeErrorMessage[] = "No key or key range spe
cified."; |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 298 |
298 IDBTransaction* IDBDatabase::transaction(ExecutionContext* context, const Vector
<String>& scope, const String& modeString, ExceptionState& exceptionState) | 299 IDBTransaction* IDBDatabase::transaction(ExecutionContext* context, const Vector
<String>& scope, const String& modeString, ExceptionState& exceptionState) |
299 { | 300 { |
300 IDB_TRACE("IDBDatabase::transaction"); | 301 IDB_TRACE("IDBDatabase::transaction"); |
301 blink::Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEnd
APICalls", IDBTransactionCall, IDBMethodsMax); | 302 blink::Platform::current()->histogramEnumeration("WebCore.IndexedDB.FrontEnd
APICalls", IDBTransactionCall, IDBMethodsMax); |
302 if (!scope.size()) { | 303 if (!scope.size()) { |
303 exceptionState.throwDOMException(InvalidAccessError, "The storeNames par
ameter was empty."); | 304 exceptionState.throwDOMException(InvalidAccessError, "The storeNames par
ameter was empty."); |
304 return 0; | 305 return 0; |
305 } | 306 } |
306 | 307 |
307 blink::WebIDBDatabase::TransactionMode mode = IDBTransaction::stringToMode(m
odeString, exceptionState); | 308 blink::WebIDBTransactionMode mode = IDBTransaction::stringToMode(modeString,
exceptionState); |
308 if (exceptionState.hadException()) | 309 if (exceptionState.hadException()) |
309 return 0; | 310 return 0; |
310 | 311 |
311 if (m_versionChangeTransaction) { | 312 if (m_versionChangeTransaction) { |
312 exceptionState.throwDOMException(InvalidStateError, "A version change tr
ansaction is running."); | 313 exceptionState.throwDOMException(InvalidStateError, "A version change tr
ansaction is running."); |
313 return 0; | 314 return 0; |
314 } | 315 } |
315 | 316 |
316 if (m_closePending) { | 317 if (m_closePending) { |
317 exceptionState.throwDOMException(InvalidStateError, "The database connec
tion is closing."); | 318 exceptionState.throwDOMException(InvalidStateError, "The database connec
tion is closing."); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 { | 462 { |
462 return EventTargetNames::IDBDatabase; | 463 return EventTargetNames::IDBDatabase; |
463 } | 464 } |
464 | 465 |
465 ExecutionContext* IDBDatabase::executionContext() const | 466 ExecutionContext* IDBDatabase::executionContext() const |
466 { | 467 { |
467 return ActiveDOMObject::executionContext(); | 468 return ActiveDOMObject::executionContext(); |
468 } | 469 } |
469 | 470 |
470 } // namespace WebCore | 471 } // namespace WebCore |
OLD | NEW |