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 = {
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling feed
# and whatever else without interference from each other.
'quiche_revision': '85240a12ed2b9ccb08ae449bca1bbf9eb93c8a12',
'quiche_revision': '50ea92a176baa696e88b519609584214317745eb',
# Three lines of non-changing comments so that
# the commit queue can handle CLs rolling ios_webkit
# and whatever else without interference from each other.
......
......@@ -9,23 +9,19 @@
namespace net {
namespace {
// 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
// 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
// safely converted to an "int" without truncation.
void AssertValidBufferSize(size_t size) {
void IOBuffer::AssertValidBufferSize(size_t size) {
base::CheckedNumeric<int>(size).ValueOrDie();
}
void AssertValidBufferSize(int size) {
void IOBuffer::AssertValidBufferSize(int size) {
CHECK_GE(size, 0);
}
} // namespace
IOBuffer::IOBuffer() : data_(nullptr) {}
IOBuffer::IOBuffer(int buffer_size) {
......
......@@ -86,6 +86,9 @@ class NET_EXPORT IOBuffer : public base::RefCountedThreadSafe<IOBuffer> {
protected:
friend class base::RefCountedThreadSafe<IOBuffer>;
static void AssertValidBufferSize(size_t size);
static void AssertValidBufferSize(int size);
// Only allow derived classes to specify data_.
// In all other cases, we own data_, and must delete it at destruction time.
explicit IOBuffer(char* data);
......
......@@ -8,11 +8,28 @@
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(QuicBufferAllocator* /*allocator*/,
size_t length) {
io_buffer_ = base::MakeRefCounted<net::IOBuffer>(length);
QuicMemSliceImpl::QuicMemSliceImpl(QuicUniqueBufferPtr buffer, size_t length) {
io_buffer_ = base::MakeRefCounted<QuicIOBuffer>(std::move(buffer), length);
length_ = length;
}
......
......@@ -7,12 +7,11 @@
#include "base/memory/ref_counted.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"
namespace quic {
class QuicBufferAllocator;
// QuicMemSliceImpl TODO(fayang)
class QUIC_EXPORT_PRIVATE QuicMemSliceImpl {
public:
......@@ -20,7 +19,7 @@ class QUIC_EXPORT_PRIVATE QuicMemSliceImpl {
QuicMemSliceImpl();
// Constructs a QuicMemSliceImp by let |allocator| allocate a data buffer of
// |length|.
QuicMemSliceImpl(QuicBufferAllocator* allocator, size_t length);
QuicMemSliceImpl(QuicUniqueBufferPtr buffer, size_t length);
QuicMemSliceImpl(scoped_refptr<net::IOBuffer> io_buffer, size_t length);
......
......@@ -3,9 +3,17 @@
// found in the LICENSE file.
#include "net/quic/quic_chromium_connection_helper.h"
#include "base/no_destructor.h"
namespace net {
namespace {
quic::QuicBufferAllocator* GetBufferAllocator() {
static base::NoDestructor<quic::SimpleBufferAllocator> allocator;
return &*allocator;
}
} // namespace
QuicChromiumConnectionHelper::QuicChromiumConnectionHelper(
const quic::QuicClock* clock,
quic::QuicRandom* random_generator)
......@@ -23,7 +31,7 @@ quic::QuicRandom* QuicChromiumConnectionHelper::GetRandomGenerator() {
quic::QuicBufferAllocator*
QuicChromiumConnectionHelper::GetStreamSendBufferAllocator() {
return &buffer_allocator_;
return GetBufferAllocator();
}
} // namespace net
......@@ -39,7 +39,6 @@ class NET_EXPORT_PRIVATE QuicChromiumConnectionHelper
private:
const quic::QuicClock* clock_;
quic::QuicRandom* random_generator_;
quic::SimpleBufferAllocator buffer_allocator_;
DISALLOW_COPY_AND_ASSIGN(QuicChromiumConnectionHelper);
};
......
......@@ -433,3 +433,9 @@ QUIC_FLAG(
bool,
FLAGS_quic_reloadable_flag_quic_create_server_handshaker_in_constructor,
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