naiveproxy/net/tools/quic/quic_simple_dispatcher.h

49 lines
1.5 KiB
C
Raw Permalink Normal View History

2018-02-02 13:49:39 +03:00
// Copyright (c) 2012 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.
#ifndef NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_
#define NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_
#include "net/quic/core/quic_server_session_base.h"
#include "net/tools/quic/quic_dispatcher.h"
#include "net/tools/quic/quic_http_response_cache.h"
namespace net {
class QuicSimpleDispatcher : public QuicDispatcher {
public:
QuicSimpleDispatcher(
const QuicConfig& config,
const QuicCryptoServerConfig* crypto_config,
QuicVersionManager* version_manager,
std::unique_ptr<QuicConnectionHelperInterface> helper,
std::unique_ptr<QuicCryptoServerStream::Helper> session_helper,
std::unique_ptr<QuicAlarmFactory> alarm_factory,
QuicHttpResponseCache* response_cache);
~QuicSimpleDispatcher() override;
int GetRstErrorCount(QuicRstStreamErrorCode rst_error_code) const;
void OnRstStreamReceived(const QuicRstStreamFrame& frame) override;
protected:
QuicServerSessionBase* CreateQuicSession(
QuicConnectionId connection_id,
const QuicSocketAddress& client_address,
QuicStringPiece alpn) override;
QuicHttpResponseCache* response_cache() { return response_cache_; }
private:
QuicHttpResponseCache* response_cache_; // Unowned.
// The map of the reset error code with its counter.
std::map<QuicRstStreamErrorCode, int> rst_error_map_;
};
} // namespace net
#endif // NET_TOOLS_QUIC_QUIC_SIMPLE_DISPATCHER_H_