mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2024-12-01 01:36:09 +03:00
49 lines
1.5 KiB
C
49 lines
1.5 KiB
C
|
// 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_
|