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

Side by Side Diff: net/http/http_stream_parser_unittest.cc

Issue 502163003: Remove implicit conversions from scoped_refptr to T* in net/http/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/http/http_stream_parser.h" 5 #include "net/http/http_stream_parser.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 TestCompletionCallback callback; 548 TestCompletionCallback callback;
549 EXPECT_EQ(OK, parser_->ReadResponseHeaders(callback.callback())); 549 EXPECT_EQ(OK, parser_->ReadResponseHeaders(callback.callback()));
550 } 550 }
551 551
552 void ReadBody(int user_buf_len, int* read_lengths) { 552 void ReadBody(int user_buf_len, int* read_lengths) {
553 TestCompletionCallback callback; 553 TestCompletionCallback callback;
554 scoped_refptr<IOBuffer> buffer = new IOBuffer(user_buf_len); 554 scoped_refptr<IOBuffer> buffer = new IOBuffer(user_buf_len);
555 int rv; 555 int rv;
556 int i = 0; 556 int i = 0;
557 while (true) { 557 while (true) {
558 rv = parser_->ReadResponseBody(buffer, user_buf_len, callback.callback()); 558 rv = parser_->ReadResponseBody(
559 buffer.get(), user_buf_len, callback.callback());
559 EXPECT_EQ(read_lengths[i], rv); 560 EXPECT_EQ(read_lengths[i], rv);
560 i++; 561 i++;
561 if (rv <= 0) 562 if (rv <= 0)
562 return; 563 return;
563 } 564 }
564 } 565 }
565 566
566 private: 567 private:
567 HttpRequestHeaders request_headers_; 568 HttpRequestHeaders request_headers_;
568 HttpResponseInfo response_info_; 569 HttpResponseInfo response_info_;
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
857 response_info.reset(); 858 response_info.reset();
858 859
859 scoped_refptr<IOBuffer> body_buffer(new IOBuffer(kBodySize)); 860 scoped_refptr<IOBuffer> body_buffer(new IOBuffer(kBodySize));
860 ASSERT_EQ(kBodySize, parser.ReadResponseBody( 861 ASSERT_EQ(kBodySize, parser.ReadResponseBody(
861 body_buffer.get(), kBodySize, callback.callback())); 862 body_buffer.get(), kBodySize, callback.callback()));
862 } 863 }
863 864
864 } // namespace 865 } // namespace
865 866
866 } // namespace net 867 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_request_unittest.cc ('k') | net/http/transport_security_persister.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698