xref: /aosp_15_r20/external/cronet/net/proxy_resolution/proxy_config_service_fixed.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2011 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef NET_PROXY_RESOLUTION_PROXY_CONFIG_SERVICE_FIXED_H_
6 #define NET_PROXY_RESOLUTION_PROXY_CONFIG_SERVICE_FIXED_H_
7 
8 #include "base/compiler_specific.h"
9 #include "net/base/net_errors.h"
10 #include "net/base/net_export.h"
11 #include "net/proxy_resolution/proxy_config_service.h"
12 #include "net/proxy_resolution/proxy_config_with_annotation.h"
13 
14 namespace net {
15 
16 // Implementation of ProxyConfigService that returns a fixed result.
17 class NET_EXPORT ProxyConfigServiceFixed : public ProxyConfigService {
18  public:
19   explicit ProxyConfigServiceFixed(const ProxyConfigWithAnnotation& pc);
20   ~ProxyConfigServiceFixed() override;
21 
22   // ProxyConfigService methods:
AddObserver(Observer * observer)23   void AddObserver(Observer* observer) override {}
RemoveObserver(Observer * observer)24   void RemoveObserver(Observer* observer) override {}
25   ConfigAvailability GetLatestProxyConfig(
26       ProxyConfigWithAnnotation* config) override;
27 
28  private:
29   ProxyConfigWithAnnotation pc_;
30 };
31 
32 }  // namespace net
33 
34 #endif  // NET_PROXY_RESOLUTION_PROXY_CONFIG_SERVICE_FIXED_H_
35