Skip to content

Commit

Permalink
Bug 1110487 P4 Allow Cache Action objects to be canceled more than once.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmottola committed Jun 26, 2019
1 parent 0278071 commit 8734ce1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dom/cache/Action.cpp
Expand Up @@ -14,7 +14,9 @@ void
Action::CancelOnInitiatingThread()
{
NS_ASSERT_OWNINGTHREAD(Action);
MOZ_ASSERT(!mCanceled);
// It is possible for cancellation to be duplicated. For example, an
// individual Cache could have its Actions canceled and then shutdown
// could trigger a second action.
mCanceled = true;
}

Expand Down
3 changes: 3 additions & 0 deletions dom/cache/Action.h
Expand Up @@ -49,6 +49,9 @@ class Action
// Cancellation is a best effort to stop processing as soon as possible, but
// does not guarantee the Action will not run.
//
// CancelOnInitiatingThread() may be called more than once. Subsequent
// calls should have no effect.
//
// Default implementation sets an internal cancellation flag that can be
// queried with IsCanceled().
virtual void CancelOnInitiatingThread();
Expand Down

0 comments on commit 8734ce1

Please sign in to comment.