LCOV - code coverage report
Current view: top level - dom/indexedDB - FileInfo.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 13 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 5 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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_indexeddb_fileinfo_h__
       8             : #define mozilla_dom_indexeddb_fileinfo_h__
       9             : 
      10             : #include "nsISupportsImpl.h"
      11             : 
      12             : namespace mozilla {
      13             : namespace dom {
      14             : namespace indexedDB {
      15             : 
      16             : class FileManager;
      17             : 
      18             : class FileInfo
      19             : {
      20             :   friend class FileManager;
      21             : 
      22             :   ThreadSafeAutoRefCnt mRefCnt;
      23             :   ThreadSafeAutoRefCnt mDBRefCnt;
      24             :   ThreadSafeAutoRefCnt mSliceRefCnt;
      25             : 
      26             :   RefPtr<FileManager> mFileManager;
      27             : 
      28             : public:
      29             :   class CustomCleanupCallback;
      30             : 
      31             :   static
      32             :   FileInfo* Create(FileManager* aFileManager, int64_t aId);
      33             : 
      34             :   explicit FileInfo(FileManager* aFileManager);
      35             : 
      36             :   void
      37           0 :   AddRef()
      38             :   {
      39           0 :     UpdateReferences(mRefCnt, 1);
      40           0 :   }
      41             : 
      42             :   void
      43           0 :   Release(CustomCleanupCallback* aCustomCleanupCallback = nullptr)
      44             :   {
      45           0 :     UpdateReferences(mRefCnt, -1, aCustomCleanupCallback);
      46           0 :   }
      47             : 
      48             :   void
      49           0 :   UpdateDBRefs(int32_t aDelta)
      50             :   {
      51           0 :     UpdateReferences(mDBRefCnt, aDelta);
      52           0 :   }
      53             : 
      54             :   void
      55             :   UpdateSliceRefs(int32_t aDelta)
      56             :   {
      57             :     UpdateReferences(mSliceRefCnt, aDelta);
      58             :   }
      59             : 
      60             :   void
      61             :   GetReferences(int32_t* aRefCnt, int32_t* aDBRefCnt, int32_t* aSliceRefCnt);
      62             : 
      63             :   FileManager*
      64           0 :   Manager() const
      65             :   {
      66           0 :     return mFileManager;
      67             :   }
      68             : 
      69             :   virtual int64_t
      70             :   Id() const = 0;
      71             : 
      72             : protected:
      73             :   virtual ~FileInfo();
      74             : 
      75             : private:
      76             :   void
      77             :   UpdateReferences(ThreadSafeAutoRefCnt& aRefCount,
      78             :                    int32_t aDelta,
      79             :                    CustomCleanupCallback* aCustomCleanupCallback = nullptr);
      80             : 
      81             :   bool
      82             :   LockedClearDBRefs();
      83             : 
      84             :   void
      85             :   Cleanup();
      86             : };
      87             : 
      88             : class NS_NO_VTABLE FileInfo::CustomCleanupCallback
      89             : {
      90             : public:
      91             :   virtual nsresult
      92             :   Cleanup(FileManager* aFileManager, int64_t aId) = 0;
      93             : 
      94             : protected:
      95           0 :   CustomCleanupCallback()
      96           0 :   { }
      97             : };
      98             : 
      99             : } // namespace indexedDB
     100             : } // namespace dom
     101             : } // namespace mozilla
     102             : 
     103             : #endif // mozilla_dom_indexeddb_fileinfo_h__

Generated by: LCOV version 1.13