| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 ScriptValue IDBRequest::result(ExceptionState& exceptionState) | 81 ScriptValue IDBRequest::result(ExceptionState& exceptionState) |
| 82 { | 82 { |
| 83 if (m_readyState != DONE) { | 83 if (m_readyState != DONE) { |
| 84 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); | 84 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); |
| 85 return ScriptValue(); | 85 return ScriptValue(); |
| 86 } | 86 } |
| 87 m_resultDirty = false; | 87 m_resultDirty = false; |
| 88 return idbAnyToScriptValue(&m_requestState, m_result); | 88 return idbAnyToScriptValue(&m_requestState, m_result); |
| 89 } | 89 } |
| 90 | 90 |
| 91 PassRefPtr<DOMError> IDBRequest::error(ExceptionState& exceptionState) const | 91 PassRefPtrWillBeRawPtr<DOMError> IDBRequest::error(ExceptionState& exceptionStat
e) const |
| 92 { | 92 { |
| 93 if (m_readyState != DONE) { | 93 if (m_readyState != DONE) { |
| 94 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); | 94 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::request
NotFinishedErrorMessage); |
| 95 return nullptr; | 95 return nullptr; |
| 96 } | 96 } |
| 97 return m_error; | 97 return m_error; |
| 98 } | 98 } |
| 99 | 99 |
| 100 ScriptValue IDBRequest::source(ExecutionContext* context) const | 100 ScriptValue IDBRequest::source(ExecutionContext* context) const |
| 101 { | 101 { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (m_contextStopped || !executionContext()) | 204 if (m_contextStopped || !executionContext()) |
| 205 return false; | 205 return false; |
| 206 ASSERT(m_readyState == PENDING || m_readyState == DONE); | 206 ASSERT(m_readyState == PENDING || m_readyState == DONE); |
| 207 if (m_requestAborted) | 207 if (m_requestAborted) |
| 208 return false; | 208 return false; |
| 209 ASSERT(m_readyState == PENDING); | 209 ASSERT(m_readyState == PENDING); |
| 210 ASSERT(!m_error && !m_result); | 210 ASSERT(!m_error && !m_result); |
| 211 return true; | 211 return true; |
| 212 } | 212 } |
| 213 | 213 |
| 214 void IDBRequest::onError(PassRefPtr<DOMError> error) | 214 void IDBRequest::onError(PassRefPtrWillBeRawPtr<DOMError> error) |
| 215 { | 215 { |
| 216 IDB_TRACE("IDBRequest::onError()"); | 216 IDB_TRACE("IDBRequest::onError()"); |
| 217 if (!shouldEnqueueEvent()) | 217 if (!shouldEnqueueEvent()) |
| 218 return; | 218 return; |
| 219 | 219 |
| 220 m_error = error; | 220 m_error = error; |
| 221 m_pendingCursor.clear(); | 221 m_pendingCursor.clear(); |
| 222 enqueueEvent(Event::createCancelableBubble(EventTypeNames::error)); | 222 enqueueEvent(Event::createCancelableBubble(EventTypeNames::error)); |
| 223 } | 223 } |
| 224 | 224 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 | 516 |
| 517 void IDBRequest::dequeueEvent(Event* event) | 517 void IDBRequest::dequeueEvent(Event* event) |
| 518 { | 518 { |
| 519 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 519 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
| 520 if (m_enqueuedEvents[i].get() == event) | 520 if (m_enqueuedEvents[i].get() == event) |
| 521 m_enqueuedEvents.remove(i); | 521 m_enqueuedEvents.remove(i); |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 | 524 |
| 525 } // namespace WebCore | 525 } // namespace WebCore |
| OLD | NEW |