Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/file/ipc/PendingIPCBlobChild.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 "PendingIPCBlobChild.h"
8
9
namespace mozilla {
10
namespace dom {
11
12
PendingIPCBlobChild::PendingIPCBlobChild(const IPCBlob& aBlob)
13
0
{
14
0
  mBlobImpl = IPCBlobUtils::Deserialize(aBlob);
15
0
  MOZ_ASSERT(mBlobImpl);
16
0
}
17
18
PendingIPCBlobChild::~PendingIPCBlobChild()
19
0
{}
20
21
already_AddRefed<BlobImpl>
22
PendingIPCBlobChild::SetPendingInfoAndDeleteActor(const nsString& aName,
23
                                                  const nsString& aContentType,
24
                                                  uint64_t aLength,
25
                                                  int64_t aLastModifiedDate)
26
0
{
27
0
  RefPtr<BlobImpl> blobImpl;
28
0
  blobImpl.swap(mBlobImpl);
29
0
30
0
  blobImpl->SetLazyData(aName, aContentType, aLength, aLastModifiedDate);
31
0
32
0
  PendingIPCFileData fileData(nsString(aName), aLastModifiedDate);
33
0
  PendingIPCBlobData blobData(nsString(aContentType), aLength, fileData);
34
0
  Unused << Send__delete__(this, blobData);
35
0
36
0
  return blobImpl.forget();
37
0
}
38
39
already_AddRefed<BlobImpl>
40
PendingIPCBlobChild::SetPendingInfoAndDeleteActor(const nsString& aContentType,
41
                                                  uint64_t aLength)
42
0
{
43
0
  RefPtr<BlobImpl> blobImpl;
44
0
  blobImpl.swap(mBlobImpl);
45
0
46
0
  blobImpl->SetLazyData(VoidString(), aContentType, aLength, INT64_MAX);
47
0
48
0
  PendingIPCBlobData data(nsString(aContentType), aLength, void_t());
49
0
  Unused << Send__delete__(this, data);
50
0
51
0
  return blobImpl.forget();
52
0
}
53
54
} // namespace dom
55
} // namespace mozilla