network_chromium.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_NET_NETWORK_CHROMIUM_H_
  5. #define COMPONENTS_UPDATE_CLIENT_NET_NETWORK_CHROMIUM_H_
  6. #include <memory>
  7. #include "base/callback.h"
  8. #include "base/memory/ref_counted.h"
  9. #include "components/update_client/network.h"
  10. namespace network {
  11. class SharedURLLoaderFactory;
  12. }
  13. namespace update_client {
  14. using SendCookiesPredicate = base::RepeatingCallback<bool(const GURL& url)>;
  15. class NetworkFetcherChromiumFactory : public NetworkFetcherFactory {
  16. public:
  17. NetworkFetcherChromiumFactory(
  18. scoped_refptr<network::SharedURLLoaderFactory> shared_url_network_factory,
  19. SendCookiesPredicate cookie_predicate);
  20. NetworkFetcherChromiumFactory(const NetworkFetcherChromiumFactory&) = delete;
  21. NetworkFetcherChromiumFactory& operator=(
  22. const NetworkFetcherChromiumFactory&) = delete;
  23. std::unique_ptr<NetworkFetcher> Create() const override;
  24. protected:
  25. ~NetworkFetcherChromiumFactory() override;
  26. private:
  27. scoped_refptr<network::SharedURLLoaderFactory> shared_url_network_factory_;
  28. SendCookiesPredicate cookie_predicate_;
  29. };
  30. } // namespace update_client
  31. #endif // COMPONENTS_UPDATE_CLIENT_NET_NETWORK_CHROMIUM_H_