dom/filesystem/RemoveTask.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/filesystem/RemoveTask.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,68 @@
     1.4 +/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
     1.5 +/* vim: set ts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_dom_RemoveTask_h
    1.11 +#define mozilla_dom_RemoveTask_h
    1.12 +
    1.13 +#include "mozilla/dom/FileSystemTaskBase.h"
    1.14 +#include "nsAutoPtr.h"
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace dom {
    1.18 +
    1.19 +class Promise;
    1.20 +
    1.21 +class RemoveTask MOZ_FINAL
    1.22 +  : public FileSystemTaskBase
    1.23 +{
    1.24 +public:
    1.25 +  RemoveTask(FileSystemBase* aFileSystem,
    1.26 +             const nsAString& aDirPath,
    1.27 +             nsIDOMFile* aTargetFile,
    1.28 +             const nsAString& aTargetPath,
    1.29 +             bool aRecursive);
    1.30 +  RemoveTask(FileSystemBase* aFileSystem,
    1.31 +             const FileSystemRemoveParams& aParam,
    1.32 +             FileSystemRequestParent* aParent);
    1.33 +
    1.34 +  virtual
    1.35 +  ~RemoveTask();
    1.36 +
    1.37 +  already_AddRefed<Promise>
    1.38 +  GetPromise();
    1.39 +
    1.40 +  virtual void
    1.41 +  GetPermissionAccessType(nsCString& aAccess) const MOZ_OVERRIDE;
    1.42 +
    1.43 +protected:
    1.44 +  virtual FileSystemParams
    1.45 +  GetRequestParams(const nsString& aFileSystem) const MOZ_OVERRIDE;
    1.46 +
    1.47 +  virtual FileSystemResponseValue
    1.48 +  GetSuccessRequestResult() const MOZ_OVERRIDE;
    1.49 +
    1.50 +  virtual void
    1.51 +  SetSuccessRequestResult(const FileSystemResponseValue& aValue) MOZ_OVERRIDE;
    1.52 +
    1.53 +  virtual nsresult
    1.54 +  Work() MOZ_OVERRIDE;
    1.55 +
    1.56 +  virtual void
    1.57 +  HandlerCallback() MOZ_OVERRIDE;
    1.58 +
    1.59 +private:
    1.60 +  nsRefPtr<Promise> mPromise;
    1.61 +  nsString mDirRealPath;
    1.62 +  nsCOMPtr<nsIDOMFile> mTargetFile;
    1.63 +  nsString mTargetRealPath;
    1.64 +  bool mRecursive;
    1.65 +  bool mReturnValue;
    1.66 +};
    1.67 +
    1.68 +} // namespace dom
    1.69 +} // namespace mozilla
    1.70 +
    1.71 +#endif // mozilla_dom_RemoveTask_h

mercurial