Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/dom/file/EmptyBlobImpl.h
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
#ifndef mozilla_dom_EmptyBlobImpl_h
8
#define mozilla_dom_EmptyBlobImpl_h
9
10
#include "BaseBlobImpl.h"
11
12
namespace mozilla {
13
namespace dom {
14
15
class EmptyBlobImpl final : public BaseBlobImpl
16
{
17
public:
18
  NS_INLINE_DECL_REFCOUNTING_INHERITED(EmptyBlobImpl, BaseBlobImpl)
19
20
  explicit EmptyBlobImpl(const nsAString& aContentType)
21
    : BaseBlobImpl(aContentType, 0 /* aLength */)
22
0
  {
23
0
    mImmutable = true;
24
0
  }
25
26
  EmptyBlobImpl(const nsAString& aName,
27
                const nsAString& aContentType,
28
                int64_t aLastModifiedDate)
29
    : BaseBlobImpl(aName, aContentType, 0, aLastModifiedDate)
30
0
  {
31
0
    mImmutable = true;
32
0
  }
33
34
  virtual void CreateInputStream(nsIInputStream** aStream,
35
                                 ErrorResult& aRv) override;
36
37
  virtual already_AddRefed<BlobImpl>
38
  CreateSlice(uint64_t aStart, uint64_t aLength,
39
              const nsAString& aContentType, ErrorResult& aRv) override;
40
41
  virtual bool IsMemoryFile() const override
42
0
  {
43
0
    return true;
44
0
  }
45
46
private:
47
0
  ~EmptyBlobImpl() {}
48
};
49
50
} // namespace dom
51
} // namespace mozilla
52
53
#endif // mozilla_dom_EmptyBlobImpl_h