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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) | 59 // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) |
60 // are not associated with transactions. | 60 // are not associated with transactions. |
61 if (transaction) | 61 if (transaction) |
62 transaction->registerRequest(request); | 62 transaction->registerRequest(request); |
63 return request; | 63 return request; |
64 } | 64 } |
65 | 65 |
66 IDBRequest::IDBRequest(ScriptState* scriptState, | 66 IDBRequest::IDBRequest(ScriptState* scriptState, |
67 IDBAny* source, | 67 IDBAny* source, |
68 IDBTransaction* transaction) | 68 IDBTransaction* transaction) |
69 : ActiveScriptWrappable(this), | 69 : SuspendableObject(scriptState->getExecutionContext()), |
70 SuspendableObject(scriptState->getExecutionContext()), | |
71 m_transaction(transaction), | 70 m_transaction(transaction), |
72 m_source(source) {} | 71 m_source(source) {} |
73 | 72 |
74 IDBRequest::~IDBRequest() { | 73 IDBRequest::~IDBRequest() { |
75 DCHECK(m_readyState == DONE || m_readyState == EarlyDeath || | 74 DCHECK(m_readyState == DONE || m_readyState == EarlyDeath || |
76 !getExecutionContext()); | 75 !getExecutionContext()); |
77 } | 76 } |
78 | 77 |
79 DEFINE_TRACE(IDBRequest) { | 78 DEFINE_TRACE(IDBRequest) { |
80 visitor->trace(m_transaction); | 79 visitor->trace(m_transaction); |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 550 } |
552 | 551 |
553 void IDBRequest::dequeueEvent(Event* event) { | 552 void IDBRequest::dequeueEvent(Event* event) { |
554 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 553 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
555 if (m_enqueuedEvents[i].get() == event) | 554 if (m_enqueuedEvents[i].get() == event) |
556 m_enqueuedEvents.remove(i); | 555 m_enqueuedEvents.remove(i); |
557 } | 556 } |
558 } | 557 } |
559 | 558 |
560 } // namespace blink | 559 } // namespace blink |
OLD | NEW |