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 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 #include "config.h" | 29 #include "config.h" |
30 #include "modules/indexeddb/IDBRequest.h" | 30 #include "modules/indexeddb/IDBRequest.h" |
31 | 31 |
32 #include "bindings/core/v8/ExceptionState.h" | 32 #include "bindings/core/v8/ExceptionState.h" |
33 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 33 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
34 #include "bindings/modules/v8/IDBBindingUtilities.h" | 34 #include "bindings/modules/v8/IDBBindingUtilities.h" |
35 #include "core/dom/ExecutionContext.h" | 35 #include "core/dom/ExecutionContext.h" |
36 #include "core/events/EventQueue.h" | 36 #include "core/events/EventQueue.h" |
| 37 #include "modules/IndexedDBNames.h" |
37 #include "modules/indexeddb/IDBCursorWithValue.h" | 38 #include "modules/indexeddb/IDBCursorWithValue.h" |
38 #include "modules/indexeddb/IDBDatabase.h" | 39 #include "modules/indexeddb/IDBDatabase.h" |
39 #include "modules/indexeddb/IDBEventDispatcher.h" | 40 #include "modules/indexeddb/IDBEventDispatcher.h" |
40 #include "modules/indexeddb/IDBTracing.h" | 41 #include "modules/indexeddb/IDBTracing.h" |
41 #include "platform/SharedBuffer.h" | 42 #include "platform/SharedBuffer.h" |
42 #include "public/platform/WebBlobInfo.h" | 43 #include "public/platform/WebBlobInfo.h" |
43 | 44 |
44 using blink::WebIDBCursor; | 45 using blink::WebIDBCursor; |
45 | 46 |
46 namespace blink { | 47 namespace blink { |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 { | 123 { |
123 if (m_contextStopped || !executionContext()) | 124 if (m_contextStopped || !executionContext()) |
124 return ScriptValue(); | 125 return ScriptValue(); |
125 | 126 |
126 return idbAnyToScriptValue(m_scriptState.get(), m_source); | 127 return idbAnyToScriptValue(m_scriptState.get(), m_source); |
127 } | 128 } |
128 | 129 |
129 const String& IDBRequest::readyState() const | 130 const String& IDBRequest::readyState() const |
130 { | 131 { |
131 ASSERT(m_readyState == PENDING || m_readyState == DONE); | 132 ASSERT(m_readyState == PENDING || m_readyState == DONE); |
132 DEFINE_STATIC_LOCAL(AtomicString, pending, ("pending", AtomicString::Constru
ctFromLiteral)); | |
133 DEFINE_STATIC_LOCAL(AtomicString, done, ("done", AtomicString::ConstructFrom
Literal)); | |
134 | 133 |
135 if (m_readyState == PENDING) | 134 if (m_readyState == PENDING) |
136 return pending; | 135 return IndexedDBNames::pending; |
137 | 136 |
138 return done; | 137 return IndexedDBNames::done; |
139 } | 138 } |
140 | 139 |
141 void IDBRequest::abort() | 140 void IDBRequest::abort() |
142 { | 141 { |
143 ASSERT(!m_requestAborted); | 142 ASSERT(!m_requestAborted); |
144 if (m_contextStopped || !executionContext()) | 143 if (m_contextStopped || !executionContext()) |
145 return; | 144 return; |
146 ASSERT(m_readyState == PENDING || m_readyState == DONE); | 145 ASSERT(m_readyState == PENDING || m_readyState == DONE); |
147 if (m_readyState == DONE) | 146 if (m_readyState == DONE) |
148 return; | 147 return; |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 | 537 |
539 void IDBRequest::dequeueEvent(Event* event) | 538 void IDBRequest::dequeueEvent(Event* event) |
540 { | 539 { |
541 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 540 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
542 if (m_enqueuedEvents[i].get() == event) | 541 if (m_enqueuedEvents[i].get() == event) |
543 m_enqueuedEvents.remove(i); | 542 m_enqueuedEvents.remove(i); |
544 } | 543 } |
545 } | 544 } |
546 | 545 |
547 } // namespace blink | 546 } // namespace blink |
OLD | NEW |