summaryrefslogtreecommitdiff
path: root/chromium/net/http/http_network_session_peer.h
blob: 9f421445ba0d6543de7b52b086fd0d7e96d8f568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_HTTP_HTTP_NETWORK_SESSION_PEER_H_
#define NET_HTTP_HTTP_NETWORK_SESSION_PEER_H_

#include <memory>

#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"

namespace net {

class ClientSocketPoolManager;
class HttpStreamFactory;
class HttpNetworkSession;
struct HttpNetworkSessionParams;

class NET_EXPORT_PRIVATE HttpNetworkSessionPeer {
 public:
  // |session| should outlive the HttpNetworkSessionPeer.
  explicit HttpNetworkSessionPeer(HttpNetworkSession* session);

  HttpNetworkSessionPeer(const HttpNetworkSessionPeer&) = delete;
  HttpNetworkSessionPeer& operator=(const HttpNetworkSessionPeer&) = delete;

  ~HttpNetworkSessionPeer();

  void SetClientSocketPoolManager(
      std::unique_ptr<ClientSocketPoolManager> socket_pool_manager);

  void SetHttpStreamFactory(
      std::unique_ptr<HttpStreamFactory> http_stream_factory);

  HttpNetworkSessionParams* params();

 private:
  const raw_ptr<HttpNetworkSession> session_;
};

}  // namespace net

#endif  // NET_HTTP_HTTP_NETWORK_SESSION_PEER_H_