Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/clients/manager/ClientNavigateOpParent.cpp
Line
Count
Source (jump to first uncovered line)
1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
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/. */
6
7
#include "ClientNavigateOpParent.h"
8
9
namespace mozilla {
10
namespace dom {
11
12
using mozilla::ipc::IPCResult;
13
14
void
15
ClientNavigateOpParent::ActorDestroy(ActorDestroyReason aReason)
16
0
{
17
0
  if (mPromise) {
18
0
    mPromise->Reject(NS_ERROR_DOM_ABORT_ERR, __func__);
19
0
    mPromise = nullptr;
20
0
  }
21
0
}
22
23
IPCResult
24
ClientNavigateOpParent::Recv__delete__(const ClientOpResult& aResult)
25
0
{
26
0
  if (aResult.type() == ClientOpResult::Tnsresult &&
27
0
      NS_FAILED(aResult.get_nsresult())) {
28
0
    mPromise->Reject(aResult.get_nsresult(), __func__);
29
0
    mPromise = nullptr;
30
0
    return IPC_OK();
31
0
  }
32
0
  mPromise->Resolve(aResult, __func__);
33
0
  mPromise = nullptr;
34
0
  return IPC_OK();
35
0
}
36
37
ClientNavigateOpParent::ClientNavigateOpParent(const ClientNavigateOpConstructorArgs& aArgs,
38
                                               ClientOpPromise::Private* aPromise)
39
  : mPromise(aPromise)
40
0
{
41
0
  MOZ_DIAGNOSTIC_ASSERT(mPromise);
42
0
}
43
44
ClientNavigateOpParent::~ClientNavigateOpParent()
45
0
{
46
0
  MOZ_DIAGNOSTIC_ASSERT(!mPromise);
47
0
}
48
49
} // namespace dom
50
} // namespace mozilla