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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 } | 478 } |
479 | 479 |
480 const AtomicString& IDBTransaction::InterfaceName() const { | 480 const AtomicString& IDBTransaction::InterfaceName() const { |
481 return EventTargetNames::IDBTransaction; | 481 return EventTargetNames::IDBTransaction; |
482 } | 482 } |
483 | 483 |
484 ExecutionContext* IDBTransaction::GetExecutionContext() const { | 484 ExecutionContext* IDBTransaction::GetExecutionContext() const { |
485 return ContextLifecycleObserver::GetExecutionContext(); | 485 return ContextLifecycleObserver::GetExecutionContext(); |
486 } | 486 } |
487 | 487 |
| 488 const char* IDBTransaction::InactiveErrorMessage() const { |
| 489 switch (state_) { |
| 490 case kActive: |
| 491 // Callers should check !IsActive() before calling. |
| 492 NOTREACHED(); |
| 493 return nullptr; |
| 494 case kInactive: |
| 495 return IDBDatabase::kTransactionInactiveErrorMessage; |
| 496 case kFinishing: |
| 497 case kFinished: |
| 498 return IDBDatabase::kTransactionFinishedErrorMessage; |
| 499 } |
| 500 NOTREACHED(); |
| 501 return nullptr; |
| 502 } |
| 503 |
488 DispatchEventResult IDBTransaction::DispatchEventInternal(Event* event) { | 504 DispatchEventResult IDBTransaction::DispatchEventInternal(Event* event) { |
489 IDB_TRACE("IDBTransaction::dispatchEvent"); | 505 IDB_TRACE("IDBTransaction::dispatchEvent"); |
490 if (!GetExecutionContext()) { | 506 if (!GetExecutionContext()) { |
491 state_ = kFinished; | 507 state_ = kFinished; |
492 return DispatchEventResult::kCanceledBeforeDispatch; | 508 return DispatchEventResult::kCanceledBeforeDispatch; |
493 } | 509 } |
494 DCHECK_NE(state_, kFinished); | 510 DCHECK_NE(state_, kFinished); |
495 DCHECK(has_pending_activity_); | 511 DCHECK(has_pending_activity_); |
496 DCHECK(GetExecutionContext()); | 512 DCHECK(GetExecutionContext()); |
497 DCHECK_EQ(event->target(), this); | 513 DCHECK_EQ(event->target(), this); |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 IDBObjectStore* object_store = it.key; | 614 IDBObjectStore* object_store = it.key; |
599 object_store->ClearIndexCache(); | 615 object_store->ClearIndexCache(); |
600 } | 616 } |
601 old_store_metadata_.Clear(); | 617 old_store_metadata_.Clear(); |
602 | 618 |
603 deleted_indexes_.Clear(); | 619 deleted_indexes_.Clear(); |
604 deleted_object_stores_.Clear(); | 620 deleted_object_stores_.Clear(); |
605 } | 621 } |
606 | 622 |
607 } // namespace blink | 623 } // namespace blink |
OLD | NEW |