2014-03-05 07:25:40 +04:00
|
|
|
/* -*- 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_CreateDirectoryTask_h
|
|
|
|
#define mozilla_dom_CreateDirectoryTask_h
|
|
|
|
|
|
|
|
#include "mozilla/dom/FileSystemTaskBase.h"
|
|
|
|
#include "nsAutoPtr.h"
|
2014-07-19 05:31:11 +04:00
|
|
|
#include "mozilla/ErrorResult.h"
|
2014-03-05 07:25:40 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class Promise;
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class CreateDirectoryTask final
|
2014-03-05 07:25:40 +04:00
|
|
|
: public FileSystemTaskBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CreateDirectoryTask(FileSystemBase* aFileSystem,
|
2014-07-19 05:31:11 +04:00
|
|
|
const nsAString& aPath,
|
|
|
|
ErrorResult& aRv);
|
2014-03-05 07:25:40 +04:00
|
|
|
CreateDirectoryTask(FileSystemBase* aFileSystem,
|
|
|
|
const FileSystemCreateDirectoryParams& aParam,
|
|
|
|
FileSystemRequestParent* aParent);
|
|
|
|
|
|
|
|
virtual
|
|
|
|
~CreateDirectoryTask();
|
|
|
|
|
|
|
|
already_AddRefed<Promise>
|
|
|
|
GetPromise();
|
|
|
|
|
2014-03-05 07:24:19 +04:00
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
GetPermissionAccessType(nsCString& aAccess) const override;
|
2014-03-05 07:24:19 +04:00
|
|
|
|
2014-03-05 07:25:40 +04:00
|
|
|
protected:
|
|
|
|
virtual FileSystemParams
|
2015-03-21 19:28:04 +03:00
|
|
|
GetRequestParams(const nsString& aFileSystem) const override;
|
2014-03-05 07:25:40 +04:00
|
|
|
|
|
|
|
virtual FileSystemResponseValue
|
2015-03-21 19:28:04 +03:00
|
|
|
GetSuccessRequestResult() const override;
|
2014-03-05 07:25:40 +04:00
|
|
|
|
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
SetSuccessRequestResult(const FileSystemResponseValue& aValue) override;
|
2014-03-05 07:25:40 +04:00
|
|
|
|
|
|
|
virtual nsresult
|
2015-03-21 19:28:04 +03:00
|
|
|
Work() override;
|
2014-03-05 07:25:40 +04:00
|
|
|
|
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
HandlerCallback() override;
|
2014-03-05 07:25:40 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
nsRefPtr<Promise> mPromise;
|
|
|
|
nsString mTargetRealPath;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_CreateDirectoryTask_h
|