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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 IDBRequest* request = new IDBRequest(scriptState, source, transaction); | 53 IDBRequest* request = new IDBRequest(scriptState, source, transaction); |
54 request->suspendIfNeeded(); | 54 request->suspendIfNeeded(); |
55 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames
) are not associated with transactions. | 55 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames
) are not associated with transactions. |
56 if (transaction) | 56 if (transaction) |
57 transaction->registerRequest(request); | 57 transaction->registerRequest(request); |
58 return request; | 58 return request; |
59 } | 59 } |
60 | 60 |
61 IDBRequest::IDBRequest(ScriptState* scriptState, IDBAny* source, IDBTransaction*
transaction) | 61 IDBRequest::IDBRequest(ScriptState* scriptState, IDBAny* source, IDBTransaction*
transaction) |
62 : ActiveDOMObject(scriptState->executionContext()) | 62 : ActiveDOMObject(scriptState->executionContext()) |
63 , m_contextStopped(false) | |
64 , m_transaction(transaction) | 63 , m_transaction(transaction) |
65 , m_readyState(PENDING) | |
66 , m_requestAborted(false) | |
67 , m_scriptState(scriptState) | 64 , m_scriptState(scriptState) |
68 , m_source(source) | 65 , m_source(source) |
69 , m_hasPendingActivity(true) | |
70 , m_cursorType(IndexedDB::CursorKeyAndValue) | |
71 , m_cursorDirection(WebIDBCursorDirectionNext) | |
72 , m_pendingCursor(nullptr) | |
73 , m_didFireUpgradeNeededEvent(false) | |
74 , m_preventPropagation(false) | |
75 , m_resultDirty(true) | |
76 { | 66 { |
77 } | 67 } |
78 | 68 |
79 IDBRequest::~IDBRequest() | 69 IDBRequest::~IDBRequest() |
80 { | 70 { |
81 ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionConte
xt()); | 71 ASSERT(m_readyState == DONE || m_readyState == EarlyDeath || !executionConte
xt()); |
82 } | 72 } |
83 | 73 |
84 DEFINE_TRACE(IDBRequest) | 74 DEFINE_TRACE(IDBRequest) |
85 { | 75 { |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
539 | 529 |
540 void IDBRequest::dequeueEvent(Event* event) | 530 void IDBRequest::dequeueEvent(Event* event) |
541 { | 531 { |
542 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 532 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
543 if (m_enqueuedEvents[i].get() == event) | 533 if (m_enqueuedEvents[i].get() == event) |
544 m_enqueuedEvents.remove(i); | 534 m_enqueuedEvents.remove(i); |
545 } | 535 } |
546 } | 536 } |
547 | 537 |
548 } // namespace blink | 538 } // namespace blink |
OLD | NEW |