Bug 1941046 - Part 4: Send a callback request for impression and clicks of MARS Top...
[gecko.git] / dom / media / SeekJob.cpp
blob1760cceb35c277a9f80c4d2a700204936edb12ea
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "SeekJob.h"
9 namespace mozilla {
11 SeekJob::~SeekJob() {
12 MOZ_DIAGNOSTIC_ASSERT(mTarget.isNothing());
13 MOZ_DIAGNOSTIC_ASSERT(mPromise.IsEmpty());
16 bool SeekJob::Exists() const {
17 MOZ_ASSERT(mTarget.isSome() == !mPromise.IsEmpty());
18 return mTarget.isSome();
21 void SeekJob::Resolve(StaticString aCallSite) {
22 mPromise.Resolve(true, aCallSite);
23 mTarget.reset();
26 void SeekJob::RejectIfExists(StaticString aCallSite) {
27 mTarget.reset();
28 mPromise.RejectIfExists(true, aCallSite);
31 } // namespace mozilla