Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: net/spdy/spdy_write_queue_unittest.cc

Issue 2799913003: Fix some net/spdy lint picks, from git cl lint. (Closed)
Patch Set: Set upstream branch to Issue 2801603003 as trybots pass. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/spdy/spdy_test_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/spdy_write_queue.h" 5 #include "net/spdy/spdy_write_queue.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <cstring> 8 #include <cstring>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // Makes a SpdyBufferProducer producing a frame with the data in the 43 // Makes a SpdyBufferProducer producing a frame with the data in the
44 // given int (converted to a string). 44 // given int (converted to a string).
45 std::unique_ptr<SpdyBufferProducer> IntToProducer(int i) { 45 std::unique_ptr<SpdyBufferProducer> IntToProducer(int i) {
46 return StringToProducer(base::IntToString(i)); 46 return StringToProducer(base::IntToString(i));
47 } 47 }
48 48
49 // Producer whose produced buffer will enqueue yet another buffer into the 49 // Producer whose produced buffer will enqueue yet another buffer into the
50 // SpdyWriteQueue upon destruction. 50 // SpdyWriteQueue upon destruction.
51 class RequeingBufferProducer : public SpdyBufferProducer { 51 class RequeingBufferProducer : public SpdyBufferProducer {
52 public: 52 public:
53 RequeingBufferProducer(SpdyWriteQueue* queue) { 53 explicit RequeingBufferProducer(SpdyWriteQueue* queue) {
54 buffer_.reset(new SpdyBuffer(kOriginal, arraysize(kOriginal))); 54 buffer_.reset(new SpdyBuffer(kOriginal, arraysize(kOriginal)));
55 buffer_->AddConsumeCallback( 55 buffer_->AddConsumeCallback(
56 base::Bind(RequeingBufferProducer::ConsumeCallback, queue)); 56 base::Bind(RequeingBufferProducer::ConsumeCallback, queue));
57 } 57 }
58 58
59 std::unique_ptr<SpdyBuffer> ProduceBuffer() override { 59 std::unique_ptr<SpdyBuffer> ProduceBuffer() override {
60 return std::move(buffer_); 60 return std::move(buffer_);
61 } 61 }
62 62
63 size_t EstimateMemoryUsage() const override { 63 size_t EstimateMemoryUsage() const override {
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 base::WeakPtr<SpdyStream> weak_stream; 372 base::WeakPtr<SpdyStream> weak_stream;
373 373
374 EXPECT_TRUE(queue.Dequeue(&frame_type, &producer, &weak_stream)); 374 EXPECT_TRUE(queue.Dequeue(&frame_type, &producer, &weak_stream));
375 EXPECT_EQ(SpdyString(kRequeued), 375 EXPECT_EQ(SpdyString(kRequeued),
376 producer->ProduceBuffer()->GetRemainingData()); 376 producer->ProduceBuffer()->GetRemainingData());
377 } 377 }
378 378
379 } // namespace 379 } // namespace
380 380
381 } // namespace net 381 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698