FileSystemAccessHandleChild.h (1346B)
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 DOM_FS_CHILD_FILESYSTEMACCESSHANDLECHILD_H_ 8 #define DOM_FS_CHILD_FILESYSTEMACCESSHANDLECHILD_H_ 9 10 #include "mozilla/dom/PFileSystemAccessHandleChild.h" 11 12 namespace mozilla::dom { 13 14 class FileSystemSyncAccessHandle; 15 16 class FileSystemAccessHandleChild : public PFileSystemAccessHandleChild { 17 public: 18 FileSystemAccessHandleChild(); 19 20 NS_INLINE_DECL_REFCOUNTING(FileSystemAccessHandleChild, override) 21 22 FileSystemSyncAccessHandle* MutableAccessHandlePtr() const { 23 MOZ_ASSERT(mAccessHandle); 24 return mAccessHandle; 25 } 26 27 void SetAccessHandle(FileSystemSyncAccessHandle* aAccessHandle); 28 29 void ActorDestroy(ActorDestroyReason aWhy) override; 30 31 private: 32 virtual ~FileSystemAccessHandleChild(); 33 34 // Use a weak ref so actor does not hold DOM object alive past content use. 35 // The weak reference is cleared in FileSystemSyncAccessHandle::LastRelease. 36 FileSystemSyncAccessHandle* MOZ_NON_OWNING_REF mAccessHandle; 37 }; 38 39 } // namespace mozilla::dom 40 41 #endif // DOM_FS_CHILD_FILESYSTEMACCESSHANDLECHILD_H_