Bumping manifests a=b2g-bump
[gecko.git] / dom / filesystem / DeviceStorageFileSystem.h
blob9e7ba92e540fb7361e3218a855f013b401df758d
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"
11 #include "nsString.h"
13 class nsDOMDeviceStorage;
15 namespace mozilla {
16 namespace dom {
18 class DeviceStorageFileSystem
19 : public FileSystemBase
21 public:
22 DeviceStorageFileSystem(const nsAString& aStorageType,
23 const nsAString& aStorageName);
25 void
26 Init(nsDOMDeviceStorage* aDeviceStorage);
28 // Overrides FileSystemBase
30 virtual void
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;
39 virtual bool
40 GetRealPath(FileImpl* aFile, nsAString& aRealPath) const MOZ_OVERRIDE;
42 virtual const nsAString&
43 GetRootName() const MOZ_OVERRIDE;
45 virtual bool
46 IsSafeFile(nsIFile* aFile) const MOZ_OVERRIDE;
48 virtual bool
49 IsSafeDirectory(Directory* aDir) const MOZ_OVERRIDE;
50 private:
51 virtual
52 ~DeviceStorageFileSystem();
54 bool
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;
67 } // namespace dom
68 } // namespace mozilla
70 #endif // mozilla_dom_DeviceStorageFileSystem_h