Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/clients/manager/ClientManagerOpChild.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 "ClientManagerOpChild.h"
8
9
#include "mozilla/dom/ClientManager.h"
10
#include "mozilla/ipc/ProtocolUtils.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
void
16
ClientManagerOpChild::ActorDestroy(ActorDestroyReason aReason)
17
0
{
18
0
  mClientManager = nullptr;
19
0
  if (mPromise) {
20
0
    mPromise->Reject(NS_ERROR_ABORT, __func__);
21
0
    mPromise = nullptr;
22
0
  }
23
0
}
24
25
mozilla::ipc::IPCResult
26
ClientManagerOpChild::Recv__delete__(const ClientOpResult& aResult)
27
0
{
28
0
  mClientManager = nullptr;
29
0
  if (aResult.type() == ClientOpResult::Tnsresult &&
30
0
      NS_FAILED(aResult.get_nsresult())) {
31
0
    mPromise->Reject(aResult.get_nsresult(), __func__);
32
0
    mPromise = nullptr;
33
0
    return IPC_OK();
34
0
  }
35
0
  mPromise->Resolve(aResult, __func__);
36
0
  mPromise = nullptr;
37
0
  return IPC_OK();
38
0
}
39
40
ClientManagerOpChild::ClientManagerOpChild(ClientManager* aClientManager,
41
                                           const ClientOpConstructorArgs& aArgs,
42
                                           ClientOpPromise::Private* aPromise)
43
  : mClientManager(aClientManager)
44
  , mPromise(aPromise)
45
0
{
46
0
  MOZ_DIAGNOSTIC_ASSERT(mClientManager);
47
0
  MOZ_DIAGNOSTIC_ASSERT(mPromise);
48
0
}
49
50
ClientManagerOpChild::~ClientManagerOpChild()
51
0
{
52
0
  MOZ_DIAGNOSTIC_ASSERT(!mPromise);
53
0
}
54
55
} // namespace dom
56
} // namespace mozilla