Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/FileSystemEntry.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 file,
5
 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
#ifndef mozilla_dom_FileSystemEntry_h
8
#define mozilla_dom_FileSystemEntry_h
9
10
#include "mozilla/Attributes.h"
11
#include "mozilla/ErrorResult.h"
12
#include "mozilla/dom/BindingDeclarations.h"
13
#include "mozilla/dom/FileSystemBinding.h"
14
#include "nsCycleCollectionParticipant.h"
15
#include "nsIGlobalObject.h"
16
#include "nsWrapperCache.h"
17
18
namespace mozilla {
19
namespace dom {
20
21
class FileSystem;
22
class OwningFileOrDirectory;
23
24
class FileSystemEntry
25
  : public nsISupports
26
  , public nsWrapperCache
27
{
28
public:
29
  NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30
  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileSystemEntry)
31
32
  static already_AddRefed<FileSystemEntry>
33
  Create(nsIGlobalObject* aGlobalObject,
34
         const OwningFileOrDirectory& aFileOrDirectory,
35
         FileSystem* aFileSystem);
36
37
  nsIGlobalObject*
38
  GetParentObject() const
39
0
  {
40
0
    return mParent;
41
0
  }
42
43
  virtual JSObject*
44
  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
45
46
  virtual bool
47
  IsFile() const
48
  {
49
    return false;
50
  }
51
52
  virtual bool
53
  IsDirectory() const
54
  {
55
    return false;
56
  }
57
58
  virtual void
59
  GetName(nsAString& aName, ErrorResult& aRv) const = 0;
60
61
  virtual void
62
  GetFullPath(nsAString& aFullPath, ErrorResult& aRv) const = 0;
63
64
  void
65
  GetParent(const Optional<OwningNonNull<FileSystemEntryCallback>>& aSuccessCallback,
66
            const Optional<OwningNonNull<ErrorCallback>>& aErrorCallback);
67
68
  FileSystem*
69
  Filesystem() const
70
0
  {
71
0
    return mFileSystem;
72
0
  }
73
74
protected:
75
  FileSystemEntry(nsIGlobalObject* aGlobalObject,
76
                  FileSystemEntry* aParentEntry,
77
                  FileSystem* aFileSystem);
78
  virtual ~FileSystemEntry();
79
80
private:
81
  nsCOMPtr<nsIGlobalObject> mParent;
82
  RefPtr<FileSystemEntry> mParentEntry;
83
  RefPtr<FileSystem> mFileSystem;
84
};
85
86
} // namespace dom
87
} // namespace mozilla
88
89
#endif // mozilla_dom_FileSystemEntry_h