Files
tubestation/dom/filesystem/DeviceStorageFileSystem.h
Ryan VanderMeulen ac4e3f2f99 Backed out 7 changesets (bug 1047483, bug 1079301, bug 1079335) for webplatform test failures.
Backed out changeset 7d06b68c44d0 (bug 1079335)
Backed out changeset 92030169528e (bug 1079301)
Backed out changeset c09d7f95554a (bug 1047483)
Backed out changeset c199f1057d7e (bug 1047483)
Backed out changeset 18830d07884c (bug 1047483)
Backed out changeset e087289ccfbb (bug 1047483)
Backed out changeset 6238ff5d3ed0 (bug 1047483)

CLOSED TREE
2014-10-07 13:16:11 -04:00

71 lines
1.8 KiB
C++

/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_DeviceStorageFileSystem_h
#define mozilla_dom_DeviceStorageFileSystem_h
#include "mozilla/dom/FileSystemBase.h"
#include "nsString.h"
class nsDOMDeviceStorage;
namespace mozilla {
namespace dom {
class DeviceStorageFileSystem
: public FileSystemBase
{
public:
DeviceStorageFileSystem(const nsAString& aStorageType,
const nsAString& aStorageName);
void
Init(nsDOMDeviceStorage* aDeviceStorage);
// Overrides FileSystemBase
virtual void
Shutdown() MOZ_OVERRIDE;
virtual nsPIDOMWindow*
GetWindow() const MOZ_OVERRIDE;
virtual already_AddRefed<nsIFile>
GetLocalFile(const nsAString& aRealPath) const MOZ_OVERRIDE;
virtual bool
GetRealPath(DOMFileImpl* aFile, nsAString& aRealPath) const MOZ_OVERRIDE;
virtual const nsAString&
GetRootName() const MOZ_OVERRIDE;
virtual bool
IsSafeFile(nsIFile* aFile) const MOZ_OVERRIDE;
virtual bool
IsSafeDirectory(Directory* aDir) const MOZ_OVERRIDE;
private:
virtual
~DeviceStorageFileSystem();
bool
LocalPathToRealPath(const nsAString& aLocalPath, nsAString& aRealPath) const;
nsString mStorageType;
nsString mStorageName;
// The local path of the root. Only available in the parent process.
// In the child process, we don't use it and its value should be empty.
nsString mLocalRootPath;
nsString mNormalizedLocalRootPath;
nsDOMDeviceStorage* mDeviceStorage;
};
} // namespace dom
} // namespace mozilla
#endif // mozilla_dom_DeviceStorageFileSystem_h