2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-03-05 07:25:40 +04:00
|
|
|
/* 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
|
|
|
|
|
2016-03-20 13:58:01 +03:00
|
|
|
virtual already_AddRefed<FileSystemBase>
|
|
|
|
Clone() override;
|
|
|
|
|
2016-04-18 10:32:59 +03:00
|
|
|
virtual bool
|
|
|
|
ShouldCreateDirectory() override { return true; }
|
|
|
|
|
2014-03-05 07:25:40 +04:00
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
Shutdown() override;
|
2014-03-05 07:25:40 +04:00
|
|
|
|
2016-03-20 13:56:10 +03:00
|
|
|
virtual nsISupports*
|
|
|
|
GetParentObject() const override;
|
2014-03-05 07:25:40 +04:00
|
|
|
|
2015-07-10 20:54:53 +03:00
|
|
|
virtual void
|
2016-04-18 10:32:30 +03:00
|
|
|
GetDirectoryName(nsIFile* aFile, nsAString& aRetval,
|
|
|
|
ErrorResult& aRv) const override;
|
2014-03-05 07:24:19 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
IsSafeFile(nsIFile* aFile) const override;
|
2014-03-05 07:24:19 +04:00
|
|
|
|
2014-03-12 10:30:21 +04:00
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
IsSafeDirectory(Directory* aDir) const override;
|
2016-03-20 13:56:10 +03:00
|
|
|
|
|
|
|
virtual void
|
|
|
|
SerializeDOMPath(nsAString& aSerializedString) const override;
|
|
|
|
|
2016-04-09 21:17:02 +03:00
|
|
|
virtual bool
|
|
|
|
NeedToGoToMainThread() const override { return true; }
|
|
|
|
|
|
|
|
virtual nsresult
|
|
|
|
MainThreadWork() override;
|
|
|
|
|
2014-03-05 07:25:40 +04:00
|
|
|
private:
|
|
|
|
virtual
|
|
|
|
~DeviceStorageFileSystem();
|
|
|
|
|
|
|
|
nsString mStorageType;
|
|
|
|
nsString mStorageName;
|
|
|
|
|
2015-08-18 14:42:14 +03:00
|
|
|
uint64_t mWindowId;
|
2014-03-05 07:25:40 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_DeviceStorageFileSystem_h
|