Bumping manifests a=b2g-bump
[gecko.git] / dom / filesystem / RemoveTask.h
blob13b1f1872d697ce53c4591cb23a6b69ec73806e1
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_RemoveTask_h
8 #define mozilla_dom_RemoveTask_h
10 #include "mozilla/dom/FileSystemTaskBase.h"
11 #include "nsAutoPtr.h"
12 #include "mozilla/ErrorResult.h"
14 namespace mozilla {
15 namespace dom {
17 class FileImpl;
18 class Promise;
20 class RemoveTask MOZ_FINAL
21 : public FileSystemTaskBase
23 public:
24 RemoveTask(FileSystemBase* aFileSystem,
25 const nsAString& aDirPath,
26 FileImpl* aTargetFile,
27 const nsAString& aTargetPath,
28 bool aRecursive,
29 ErrorResult& aRv);
30 RemoveTask(FileSystemBase* aFileSystem,
31 const FileSystemRemoveParams& aParam,
32 FileSystemRequestParent* aParent);
34 virtual
35 ~RemoveTask();
37 already_AddRefed<Promise>
38 GetPromise();
40 virtual void
41 GetPermissionAccessType(nsCString& aAccess) const MOZ_OVERRIDE;
43 protected:
44 virtual FileSystemParams
45 GetRequestParams(const nsString& aFileSystem) const MOZ_OVERRIDE;
47 virtual FileSystemResponseValue
48 GetSuccessRequestResult() const MOZ_OVERRIDE;
50 virtual void
51 SetSuccessRequestResult(const FileSystemResponseValue& aValue) MOZ_OVERRIDE;
53 virtual nsresult
54 Work() MOZ_OVERRIDE;
56 virtual void
57 HandlerCallback() MOZ_OVERRIDE;
59 private:
60 nsRefPtr<Promise> mPromise;
61 nsString mDirRealPath;
62 // This cannot be a File because this object will be used on a different
63 // thread and File is not thread-safe. Let's use the FileImpl instead.
64 nsRefPtr<FileImpl> mTargetFileImpl;
65 nsString mTargetRealPath;
66 bool mRecursive;
67 bool mReturnValue;
70 } // namespace dom
71 } // namespace mozilla
73 #endif // mozilla_dom_RemoveTask_h