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

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

Issue 4192012: Convert implicit scoped_refptr constructor calls to explicit ones, part 1 (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: fix presubmit Created 10 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_stream_request.cc ('k') | net/proxy/multi_threaded_proxy_resolver.cc » ('j') | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_transaction_unittest.h" 5 #include "net/http/http_transaction_unittest.h"
6 6
7 #include "base/hash_tables.h" 7 #include "base/hash_tables.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 //----------------------------------------------------------------------------- 140 //-----------------------------------------------------------------------------
141 // helpers 141 // helpers
142 142
143 int ReadTransaction(net::HttpTransaction* trans, std::string* result) { 143 int ReadTransaction(net::HttpTransaction* trans, std::string* result) {
144 int rv; 144 int rv;
145 145
146 TestCompletionCallback callback; 146 TestCompletionCallback callback;
147 147
148 std::string content; 148 std::string content;
149 do { 149 do {
150 scoped_refptr<net::IOBuffer> buf = new net::IOBuffer(256); 150 scoped_refptr<net::IOBuffer> buf(new net::IOBuffer(256));
151 rv = trans->Read(buf, 256, &callback); 151 rv = trans->Read(buf, 256, &callback);
152 if (rv == net::ERR_IO_PENDING) 152 if (rv == net::ERR_IO_PENDING)
153 rv = callback.WaitForResult(); 153 rv = callback.WaitForResult();
154 if (rv > 0) { 154 if (rv > 0) {
155 content.append(buf->data(), rv); 155 content.append(buf->data(), rv);
156 } else if (rv < 0) { 156 } else if (rv < 0) {
157 return rv; 157 return rv;
158 } 158 }
159 } while (rv > 0); 159 } while (rv > 0);
160 160
161 result->swap(content); 161 result->swap(content);
162 return net::OK; 162 return net::OK;
163 } 163 }
OLDNEW
« no previous file with comments | « net/http/http_stream_request.cc ('k') | net/proxy/multi_threaded_proxy_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698