1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* vim: set ts=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/. */
7 #ifndef mozilla_dom_DeviceStorageFileSystem_h
8 #define mozilla_dom_DeviceStorageFileSystem_h
10 #include "mozilla/dom/FileSystemBase.h"
13 class nsDOMDeviceStorage
;
18 class DeviceStorageFileSystem
19 : public FileSystemBase
22 DeviceStorageFileSystem(const nsAString
& aStorageType
,
23 const nsAString
& aStorageName
);
26 Init(nsDOMDeviceStorage
* aDeviceStorage
);
28 // Overrides FileSystemBase
31 Shutdown() MOZ_OVERRIDE
;
33 virtual nsPIDOMWindow
*
34 GetWindow() const MOZ_OVERRIDE
;
36 virtual already_AddRefed
<nsIFile
>
37 GetLocalFile(const nsAString
& aRealPath
) const MOZ_OVERRIDE
;
40 GetRealPath(FileImpl
* aFile
, nsAString
& aRealPath
) const MOZ_OVERRIDE
;
42 virtual const nsAString
&
43 GetRootName() const MOZ_OVERRIDE
;
46 IsSafeFile(nsIFile
* aFile
) const MOZ_OVERRIDE
;
49 IsSafeDirectory(Directory
* aDir
) const MOZ_OVERRIDE
;
52 ~DeviceStorageFileSystem();
55 LocalPathToRealPath(const nsAString
& aLocalPath
, nsAString
& aRealPath
) const;
57 nsString mStorageType
;
58 nsString mStorageName
;
60 // The local path of the root. Only available in the parent process.
61 // In the child process, we don't use it and its value should be empty.
62 nsString mLocalRootPath
;
63 nsString mNormalizedLocalRootPath
;
64 nsDOMDeviceStorage
* mDeviceStorage
;
68 } // namespace mozilla
70 #endif // mozilla_dom_DeviceStorageFileSystem_h