Chromium Code Reviews| 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 362 } | 362 } |
| 363 | 363 |
| 364 bool IDBRequest::hasPendingActivity() const | 364 bool IDBRequest::hasPendingActivity() const |
| 365 { | 365 { |
| 366 // FIXME: In an ideal world, we should return true as long as anyone has a o r can | 366 // FIXME: In an ideal world, we should return true as long as anyone has a o r can |
| 367 // get a handle to us and we have event listeners. This is order to h andle | 367 // get a handle to us and we have event listeners. This is order to h andle |
| 368 // user generated events properly. | 368 // user generated events properly. |
| 369 return m_hasPendingActivity && !m_contextStopped; | 369 return m_hasPendingActivity && !m_contextStopped; |
| 370 } | 370 } |
| 371 | 371 |
| 372 void IDBRequest::contextWillBeDestroyed() | |
| 373 { | |
| 374 checkForReferenceCycle(); | |
|
haraken
2014/04/01 05:56:14
I need to reconsider what I should do here. Curren
Mads Ager (chromium)
2014/04/01 11:38:38
What we want to ensure in this call is that any cu
| |
| 375 } | |
| 376 | |
| 372 void IDBRequest::stop() | 377 void IDBRequest::stop() |
| 373 { | 378 { |
| 374 if (m_contextStopped) | 379 if (m_contextStopped) |
| 375 return; | 380 return; |
| 376 | 381 |
| 377 m_contextStopped = true; | 382 m_contextStopped = true; |
| 378 m_requestState.clear(); | 383 m_requestState.clear(); |
| 379 | 384 |
| 380 RefPtr<IDBRequest> protect(this); | 385 RefPtr<IDBRequest> protect(this); |
| 381 | 386 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 | 526 |
| 522 void IDBRequest::dequeueEvent(Event* event) | 527 void IDBRequest::dequeueEvent(Event* event) |
| 523 { | 528 { |
| 524 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { | 529 for (size_t i = 0; i < m_enqueuedEvents.size(); ++i) { |
| 525 if (m_enqueuedEvents[i].get() == event) | 530 if (m_enqueuedEvents[i].get() == event) |
| 526 m_enqueuedEvents.remove(i); | 531 m_enqueuedEvents.remove(i); |
| 527 } | 532 } |
| 528 } | 533 } |
| 529 | 534 |
| 530 } // namespace WebCore | 535 } // namespace WebCore |
| OLD | NEW |