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