forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmultiplexed_session.cc
42 lines (31 loc) · 1.07 KB
/
multiplexed_session.cc
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
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/spdy/multiplexed_session.h"
namespace net {
MultiplexedSessionHandle::MultiplexedSessionHandle(
base::WeakPtr<MultiplexedSession> session)
: session_(session) {
SaveSSLInfo();
}
MultiplexedSessionHandle::~MultiplexedSessionHandle() = default;
bool MultiplexedSessionHandle::GetRemoteEndpoint(IPEndPoint* endpoint) {
if (!session_)
return false;
return session_->GetRemoteEndpoint(endpoint);
}
bool MultiplexedSessionHandle::GetSSLInfo(SSLInfo* ssl_info) const {
if (!has_ssl_info_)
return false;
*ssl_info = ssl_info_;
return true;
}
void MultiplexedSessionHandle::SaveSSLInfo() {
has_ssl_info_ = session_->GetSSLInfo(&ssl_info_);
}
base::StringPiece MultiplexedSessionHandle::GetAcceptChViaAlpsForOrigin(
const url::Origin& origin) const {
return session_ ? session_->GetAcceptChViaAlpsForOrigin(origin)
: base::StringPiece();
}
} // namespace net