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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 return it->key; | 386 return it->key; |
387 } | 387 } |
388 } | 388 } |
389 return IDBObjectStoreMetadata::InvalidId; | 389 return IDBObjectStoreMetadata::InvalidId; |
390 } | 390 } |
391 | 391 |
392 bool IDBDatabase::hasPendingActivity() const | 392 bool IDBDatabase::hasPendingActivity() const |
393 { | 393 { |
394 // The script wrapper must not be collected before the object is closed or | 394 // The script wrapper must not be collected before the object is closed or |
395 // we can't fire a "versionchange" event to let script manually close the co nnection. | 395 // we can't fire a "versionchange" event to let script manually close the co nnection. |
396 return !m_closePending && !m_eventTargetData.eventListenerMap.isEmpty() && ! m_contextStopped; | 396 return !m_closePending && !const_cast<IDBDatabase*>(this)->ensureEventTarget Data().eventListenerMap.isEmpty() && !m_contextStopped; |
tkent
2013/10/10 21:16:25
!...eventListernMap.isEmpty() looks like equivalen
jsbell
2013/10/10 21:49:16
I was probably ignorant of hasEventListeners when
| |
397 } | 397 } |
398 | 398 |
399 void IDBDatabase::stop() | 399 void IDBDatabase::stop() |
400 { | 400 { |
401 // Stop fires at a deterministic time, so we need to call close in it. | 401 // Stop fires at a deterministic time, so we need to call close in it. |
402 close(); | 402 close(); |
403 | 403 |
404 m_contextStopped = true; | 404 m_contextStopped = true; |
405 } | 405 } |
406 | 406 |
407 const AtomicString& IDBDatabase::interfaceName() const | 407 const AtomicString& IDBDatabase::interfaceName() const |
408 { | 408 { |
409 return eventNames().interfaceForIDBDatabase; | 409 return eventNames().interfaceForIDBDatabase; |
410 } | 410 } |
411 | 411 |
412 ScriptExecutionContext* IDBDatabase::scriptExecutionContext() const | 412 ScriptExecutionContext* IDBDatabase::scriptExecutionContext() const |
413 { | 413 { |
414 return ActiveDOMObject::scriptExecutionContext(); | 414 return ActiveDOMObject::scriptExecutionContext(); |
415 } | 415 } |
416 | 416 |
417 EventTargetData* IDBDatabase::eventTargetData() | |
418 { | |
419 return &m_eventTargetData; | |
420 } | |
421 | |
422 EventTargetData* IDBDatabase::ensureEventTargetData() | |
423 { | |
424 return &m_eventTargetData; | |
425 } | |
426 | |
427 } // namespace WebCore | 417 } // namespace WebCore |
OLD | NEW |