patch_impl.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  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_PATCH_PATCH_IMPL_H_
  5. #define COMPONENTS_UPDATE_CLIENT_PATCH_PATCH_IMPL_H_
  6. #include "base/callback.h"
  7. #include "base/memory/ref_counted.h"
  8. #include "components/services/patch/public/mojom/file_patcher.mojom.h"
  9. #include "components/update_client/patcher.h"
  10. #include "mojo/public/cpp/bindings/pending_remote.h"
  11. namespace update_client {
  12. class PatchChromiumFactory : public PatcherFactory {
  13. public:
  14. using Callback =
  15. base::RepeatingCallback<mojo::PendingRemote<patch::mojom::FilePatcher>()>;
  16. explicit PatchChromiumFactory(Callback callback);
  17. PatchChromiumFactory(const PatchChromiumFactory&) = delete;
  18. PatchChromiumFactory& operator=(const PatchChromiumFactory&) = delete;
  19. scoped_refptr<Patcher> Create() const override;
  20. protected:
  21. ~PatchChromiumFactory() override;
  22. private:
  23. const Callback callback_;
  24. };
  25. } // namespace update_client
  26. #endif // COMPONENTS_UPDATE_CLIENT_PATCH_PATCH_IMPL_H_