Commit 4d53d204 authored by Victor Vasiliev's avatar Victor Vasiliev Committed by Commit Bot

Roll src/net/third_party/quiche/src/ 85240a12e..50ea92a17 (2 commits)

https://quiche.googlesource.com/quiche.git/+log/85240a12ed2b..50ea92a176ba

$ git log 85240a12e..50ea92a17 --date=short --no-merges --format='%ad %ae %s'
2019-12-26 renjietang Record the frequency of stream frame coalescing at QuicSession.CoalesceStreamFrameStatus.
2019-12-24 vasilvv Add a proper API to create memslices from the QUIC code.

Created with:
  roll-dep src/net/third_party/quiche/src

R=zhongyi@chromium.org

Change-Id: I8688b4c43c66035e789c9628eb45d8f0d75fc3af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1982780
Commit-Queue: Zhongyi Shi <zhongyi@chromium.org>
Reviewed-by: default avatarZhongyi Shi <zhongyi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727588}
parent d4cc9a7f
...@@ -310,7 +310,7 @@ vars = { ...@@ -310,7 +310,7 @@ vars = {
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed # the commit queue can handle CLs rolling feed
# and whatever else without interference from each other. # and whatever else without interference from each other.
'quiche_revision': '85240a12ed2b9ccb08ae449bca1bbf9eb93c8a12', 'quiche_revision': '50ea92a176baa696e88b519609584214317745eb',
# Three lines of non-changing comments so that # Three lines of non-changing comments so that
# the commit queue can handle CLs rolling ios_webkit # the commit queue can handle CLs rolling ios_webkit
# and whatever else without interference from each other. # and whatever else without interference from each other.
......
...@@ -9,23 +9,19 @@ ...@@ -9,23 +9,19 @@
namespace net { namespace net {
namespace {
// TODO(eroman): IOBuffer is being converted to require buffer sizes and offsets // TODO(eroman): IOBuffer is being converted to require buffer sizes and offsets
// be specified as "size_t" rather than "int" (crbug.com/488553). To facilitate // be specified as "size_t" rather than "int" (crbug.com/488553). To facilitate
// this move (since LOTS of code needs to be updated), both "size_t" and "int // this move (since LOTS of code needs to be updated), both "size_t" and "int
// are being accepted. When using "size_t" this function ensures that it can be // are being accepted. When using "size_t" this function ensures that it can be
// safely converted to an "int" without truncation. // safely converted to an "int" without truncation.
void AssertValidBufferSize(size_t size) { void IOBuffer::AssertValidBufferSize(size_t size) {
base::CheckedNumeric<int>(size).ValueOrDie(); base::CheckedNumeric<int>(size).ValueOrDie();
} }
void AssertValidBufferSize(int size) { void IOBuffer::AssertValidBufferSize(int size) {
CHECK_GE(size, 0); CHECK_GE(size, 0);
} }
} // namespace
IOBuffer::IOBuffer() : data_(nullptr) {} IOBuffer::IOBuffer() : data_(nullptr) {}
IOBuffer::IOBuffer(int buffer_size) { IOBuffer::IOBuffer(int buffer_size) {
......
...@@ -86,6 +86,9 @@ class NET_EXPORT IOBuffer : public base::RefCountedThreadSafe<IOBuffer> { ...@@ -86,6 +86,9 @@ class NET_EXPORT IOBuffer : public base::RefCountedThreadSafe<IOBuffer> {
protected: protected:
friend class base::RefCountedThreadSafe<IOBuffer>; friend class base::RefCountedThreadSafe<IOBuffer>;
static void AssertValidBufferSize(size_t size);
static void AssertValidBufferSize(int size);
// Only allow derived classes to specify data_. // Only allow derived classes to specify data_.
// In all other cases, we own data_, and must delete it at destruction time. // In all other cases, we own data_, and must delete it at destruction time.
explicit IOBuffer(char* data); explicit IOBuffer(char* data);
......
...@@ -8,11 +8,28 @@ ...@@ -8,11 +8,28 @@
namespace quic { namespace quic {
namespace {
class QuicIOBuffer : public net::IOBuffer {
public:
QuicIOBuffer(QuicUniqueBufferPtr buffer, size_t size)
: buffer_(std::move(buffer)) {
AssertValidBufferSize(size);
data_ = buffer_.get();
}
private:
~QuicIOBuffer() override { data_ = nullptr; }
QuicUniqueBufferPtr buffer_;
};
} // namespace
QuicMemSliceImpl::QuicMemSliceImpl() = default; QuicMemSliceImpl::QuicMemSliceImpl() = default;
QuicMemSliceImpl::QuicMemSliceImpl(QuicBufferAllocator* /*allocator*/, QuicMemSliceImpl::QuicMemSliceImpl(QuicUniqueBufferPtr buffer, size_t length) {
size_t length) { io_buffer_ = base::MakeRefCounted<QuicIOBuffer>(std::move(buffer), length);
io_buffer_ = base::MakeRefCounted<net::IOBuffer>(length);
length_ = length; length_ = length;
} }
......
...@@ -7,12 +7,11 @@ ...@@ -7,12 +7,11 @@
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "net/base/io_buffer.h" #include "net/base/io_buffer.h"
#include "net/third_party/quiche/src/quic/core/quic_buffer_allocator.h"
#include "net/third_party/quiche/src/quic/platform/api/quic_export.h" #include "net/third_party/quiche/src/quic/platform/api/quic_export.h"
namespace quic { namespace quic {
class QuicBufferAllocator;
// QuicMemSliceImpl TODO(fayang) // QuicMemSliceImpl TODO(fayang)
class QUIC_EXPORT_PRIVATE QuicMemSliceImpl { class QUIC_EXPORT_PRIVATE QuicMemSliceImpl {
public: public:
...@@ -20,7 +19,7 @@ class QUIC_EXPORT_PRIVATE QuicMemSliceImpl { ...@@ -20,7 +19,7 @@ class QUIC_EXPORT_PRIVATE QuicMemSliceImpl {
QuicMemSliceImpl(); QuicMemSliceImpl();
// Constructs a QuicMemSliceImp by let |allocator| allocate a data buffer of // Constructs a QuicMemSliceImp by let |allocator| allocate a data buffer of
// |length|. // |length|.
QuicMemSliceImpl(QuicBufferAllocator* allocator, size_t length); QuicMemSliceImpl(QuicUniqueBufferPtr buffer, size_t length);
QuicMemSliceImpl(scoped_refptr<net::IOBuffer> io_buffer, size_t length); QuicMemSliceImpl(scoped_refptr<net::IOBuffer> io_buffer, size_t length);
......
...@@ -3,9 +3,17 @@ ...@@ -3,9 +3,17 @@
// found in the LICENSE file. // found in the LICENSE file.
#include "net/quic/quic_chromium_connection_helper.h" #include "net/quic/quic_chromium_connection_helper.h"
#include "base/no_destructor.h"
namespace net { namespace net {
namespace {
quic::QuicBufferAllocator* GetBufferAllocator() {
static base::NoDestructor<quic::SimpleBufferAllocator> allocator;
return &*allocator;
}
} // namespace
QuicChromiumConnectionHelper::QuicChromiumConnectionHelper( QuicChromiumConnectionHelper::QuicChromiumConnectionHelper(
const quic::QuicClock* clock, const quic::QuicClock* clock,
quic::QuicRandom* random_generator) quic::QuicRandom* random_generator)
...@@ -23,7 +31,7 @@ quic::QuicRandom* QuicChromiumConnectionHelper::GetRandomGenerator() { ...@@ -23,7 +31,7 @@ quic::QuicRandom* QuicChromiumConnectionHelper::GetRandomGenerator() {
quic::QuicBufferAllocator* quic::QuicBufferAllocator*
QuicChromiumConnectionHelper::GetStreamSendBufferAllocator() { QuicChromiumConnectionHelper::GetStreamSendBufferAllocator() {
return &buffer_allocator_; return GetBufferAllocator();
} }
} // namespace net } // namespace net
...@@ -39,7 +39,6 @@ class NET_EXPORT_PRIVATE QuicChromiumConnectionHelper ...@@ -39,7 +39,6 @@ class NET_EXPORT_PRIVATE QuicChromiumConnectionHelper
private: private:
const quic::QuicClock* clock_; const quic::QuicClock* clock_;
quic::QuicRandom* random_generator_; quic::QuicRandom* random_generator_;
quic::SimpleBufferAllocator buffer_allocator_;
DISALLOW_COPY_AND_ASSIGN(QuicChromiumConnectionHelper); DISALLOW_COPY_AND_ASSIGN(QuicChromiumConnectionHelper);
}; };
......
...@@ -433,3 +433,9 @@ QUIC_FLAG( ...@@ -433,3 +433,9 @@ QUIC_FLAG(
bool, bool,
FLAGS_quic_reloadable_flag_quic_create_server_handshaker_in_constructor, FLAGS_quic_reloadable_flag_quic_create_server_handshaker_in_constructor,
false) false)
// If true, the frequency of stream frame coalescing will be logged as
// QuicSession.CoalesceStreamFrameStatus.
QUIC_FLAG(bool,
FLAGS_quic_reloadable_flag_quic_log_coalesce_stream_frame_frequency,
false)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment