unzip_impl.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_UPDATE_CLIENT_UNZIP_UNZIP_IMPL_H_
  5. #define COMPONENTS_UPDATE_CLIENT_UNZIP_UNZIP_IMPL_H_
  6. #include <memory>
  7. #include "base/callback.h"
  8. #include "base/memory/ref_counted.h"
  9. #include "components/services/unzip/public/mojom/unzipper.mojom.h"
  10. #include "components/update_client/unzipper.h"
  11. #include "mojo/public/cpp/bindings/pending_remote.h"
  12. namespace update_client {
  13. class UnzipChromiumFactory : public UnzipperFactory {
  14. public:
  15. using Callback =
  16. base::RepeatingCallback<mojo::PendingRemote<unzip::mojom::Unzipper>()>;
  17. explicit UnzipChromiumFactory(Callback callback);
  18. UnzipChromiumFactory(const UnzipChromiumFactory&) = delete;
  19. UnzipChromiumFactory& operator=(const UnzipChromiumFactory&) = delete;
  20. std::unique_ptr<Unzipper> Create() const override;
  21. protected:
  22. ~UnzipChromiumFactory() override;
  23. private:
  24. const Callback callback_;
  25. };
  26. } // namespace update_client
  27. #endif // COMPONENTS_UPDATE_CLIENT_UNZIP_UNZIP_IMPL_H_