| Index: net/spdy/spdy_write_queue_unittest.cc
|
| diff --git a/net/spdy/spdy_write_queue_unittest.cc b/net/spdy/spdy_write_queue_unittest.cc
|
| index 6d6cb3cd3b57fe0d1ac253f6b5ca570477517260..772bd947c137b5af17abbd2b4f3087da305ea10d 100644
|
| --- a/net/spdy/spdy_write_queue_unittest.cc
|
| +++ b/net/spdy/spdy_write_queue_unittest.cc
|
| @@ -30,12 +30,9 @@ class SpdyWriteQueueTest : public ::testing::Test {};
|
| scoped_ptr<SpdyBufferProducer> StringToProducer(const std::string& s) {
|
| scoped_ptr<char[]> data(new char[s.size()]);
|
| std::memcpy(data.get(), s.data(), s.size());
|
| - return scoped_ptr<SpdyBufferProducer>(
|
| - new SimpleBufferProducer(
|
| - scoped_ptr<SpdyBuffer>(
|
| - new SpdyBuffer(
|
| - scoped_ptr<SpdyFrame>(
|
| - new SpdyFrame(data.release(), s.size(), true))))));
|
| + return scoped_ptr<SpdyBufferProducer>(new SimpleBufferProducer(
|
| + scoped_ptr<SpdyBuffer>(new SpdyBuffer(scoped_ptr<SpdyFrame>(
|
| + new SpdyFrame(data.release(), s.size(), true))))));
|
| }
|
|
|
| // Makes a SpdyBufferProducer producing a frame with the data in the
|
| @@ -63,9 +60,13 @@ int ProducerToInt(scoped_ptr<SpdyBufferProducer> producer) {
|
| // -- be careful to not call any functions that expect the session to
|
| // be there.
|
| SpdyStream* MakeTestStream(RequestPriority priority) {
|
| - return new SpdyStream(
|
| - SPDY_BIDIRECTIONAL_STREAM, base::WeakPtr<SpdySession>(),
|
| - GURL(), priority, 0, 0, BoundNetLog());
|
| + return new SpdyStream(SPDY_BIDIRECTIONAL_STREAM,
|
| + base::WeakPtr<SpdySession>(),
|
| + GURL(),
|
| + priority,
|
| + 0,
|
| + 0,
|
| + BoundNetLog());
|
| }
|
|
|
| // Add some frame producers of different priority. The producers
|
| @@ -85,9 +86,10 @@ TEST_F(SpdyWriteQueueTest, DequeuesByPriority) {
|
| LOW, SYN_STREAM, producer_low.Pass(), base::WeakPtr<SpdyStream>());
|
| write_queue.Enqueue(
|
| MEDIUM, SYN_REPLY, producer_medium.Pass(), stream_medium->GetWeakPtr());
|
| - write_queue.Enqueue(
|
| - HIGHEST, RST_STREAM, producer_highest.Pass(),
|
| - stream_highest->GetWeakPtr());
|
| + write_queue.Enqueue(HIGHEST,
|
| + RST_STREAM,
|
| + producer_highest.Pass(),
|
| + stream_highest->GetWeakPtr());
|
|
|
| SpdyFrameType frame_type = DATA;
|
| scoped_ptr<SpdyBufferProducer> frame_producer;
|
| @@ -123,12 +125,12 @@ TEST_F(SpdyWriteQueueTest, DequeuesFIFO) {
|
| scoped_ptr<SpdyStream> stream2(MakeTestStream(DEFAULT_PRIORITY));
|
| scoped_ptr<SpdyStream> stream3(MakeTestStream(DEFAULT_PRIORITY));
|
|
|
| - write_queue.Enqueue(DEFAULT_PRIORITY, SYN_STREAM, producer1.Pass(),
|
| - stream1->GetWeakPtr());
|
| - write_queue.Enqueue(DEFAULT_PRIORITY, SYN_REPLY, producer2.Pass(),
|
| - stream2->GetWeakPtr());
|
| - write_queue.Enqueue(DEFAULT_PRIORITY, RST_STREAM, producer3.Pass(),
|
| - stream3->GetWeakPtr());
|
| + write_queue.Enqueue(
|
| + DEFAULT_PRIORITY, SYN_STREAM, producer1.Pass(), stream1->GetWeakPtr());
|
| + write_queue.Enqueue(
|
| + DEFAULT_PRIORITY, SYN_REPLY, producer2.Pass(), stream2->GetWeakPtr());
|
| + write_queue.Enqueue(
|
| + DEFAULT_PRIORITY, RST_STREAM, producer3.Pass(), stream3->GetWeakPtr());
|
|
|
| SpdyFrameType frame_type = DATA;
|
| scoped_ptr<SpdyBufferProducer> frame_producer;
|
| @@ -200,12 +202,13 @@ TEST_F(SpdyWriteQueueTest, RemovePendingWritesForStreamsAfter) {
|
| // No stream id assigned.
|
| scoped_ptr<SpdyStream> stream4(MakeTestStream(DEFAULT_PRIORITY));
|
| base::WeakPtr<SpdyStream> streams[] = {
|
| - stream1->GetWeakPtr(), stream2->GetWeakPtr(),
|
| - stream3->GetWeakPtr(), stream4->GetWeakPtr()
|
| - };
|
| + stream1->GetWeakPtr(), stream2->GetWeakPtr(), stream3->GetWeakPtr(),
|
| + stream4->GetWeakPtr()};
|
|
|
| for (int i = 0; i < 100; ++i) {
|
| - write_queue.Enqueue(DEFAULT_PRIORITY, SYN_STREAM, IntToProducer(i),
|
| + write_queue.Enqueue(DEFAULT_PRIORITY,
|
| + SYN_STREAM,
|
| + IntToProducer(i),
|
| streams[i % arraysize(streams)]);
|
| }
|
|
|
| @@ -235,7 +238,9 @@ TEST_F(SpdyWriteQueueTest, Clear) {
|
| SpdyWriteQueue write_queue;
|
|
|
| for (int i = 0; i < 100; ++i) {
|
| - write_queue.Enqueue(DEFAULT_PRIORITY, SYN_STREAM, IntToProducer(i),
|
| + write_queue.Enqueue(DEFAULT_PRIORITY,
|
| + SYN_STREAM,
|
| + IntToProducer(i),
|
| base::WeakPtr<SpdyStream>());
|
| }
|
|
|
|
|