|
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/. */ |
|
6 |
|
7 #ifndef mozilla_dom_CreateDirectoryTask_h |
|
8 #define mozilla_dom_CreateDirectoryTask_h |
|
9 |
|
10 #include "mozilla/dom/FileSystemTaskBase.h" |
|
11 #include "nsAutoPtr.h" |
|
12 |
|
13 namespace mozilla { |
|
14 namespace dom { |
|
15 |
|
16 class Promise; |
|
17 |
|
18 class CreateDirectoryTask MOZ_FINAL |
|
19 : public FileSystemTaskBase |
|
20 { |
|
21 public: |
|
22 CreateDirectoryTask(FileSystemBase* aFileSystem, |
|
23 const nsAString& aPath); |
|
24 CreateDirectoryTask(FileSystemBase* aFileSystem, |
|
25 const FileSystemCreateDirectoryParams& aParam, |
|
26 FileSystemRequestParent* aParent); |
|
27 |
|
28 virtual |
|
29 ~CreateDirectoryTask(); |
|
30 |
|
31 already_AddRefed<Promise> |
|
32 GetPromise(); |
|
33 |
|
34 virtual void |
|
35 GetPermissionAccessType(nsCString& aAccess) const MOZ_OVERRIDE; |
|
36 |
|
37 protected: |
|
38 virtual FileSystemParams |
|
39 GetRequestParams(const nsString& aFileSystem) const MOZ_OVERRIDE; |
|
40 |
|
41 virtual FileSystemResponseValue |
|
42 GetSuccessRequestResult() const MOZ_OVERRIDE; |
|
43 |
|
44 virtual void |
|
45 SetSuccessRequestResult(const FileSystemResponseValue& aValue) MOZ_OVERRIDE; |
|
46 |
|
47 virtual nsresult |
|
48 Work() MOZ_OVERRIDE; |
|
49 |
|
50 virtual void |
|
51 HandlerCallback() MOZ_OVERRIDE; |
|
52 |
|
53 private: |
|
54 nsRefPtr<Promise> mPromise; |
|
55 nsString mTargetRealPath; |
|
56 }; |
|
57 |
|
58 } // namespace dom |
|
59 } // namespace mozilla |
|
60 |
|
61 #endif // mozilla_dom_CreateDirectoryTask_h |