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

Side by Side Diff: net/url_request/url_request_unittest.h

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « net/url_request/url_request_status.h ('k') | net/url_request/url_request_unittest.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_
6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_
7 #pragma once 7 #pragma once
8 8
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
11 #include <sstream> 11 #include <sstream>
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 virtual void OnResponseStarted(net::URLRequest* request) { 232 virtual void OnResponseStarted(net::URLRequest* request) {
233 // It doesn't make sense for the request to have IO pending at this point. 233 // It doesn't make sense for the request to have IO pending at this point.
234 DCHECK(!request->status().is_io_pending()); 234 DCHECK(!request->status().is_io_pending());
235 235
236 response_started_count_++; 236 response_started_count_++;
237 if (cancel_in_rs_) { 237 if (cancel_in_rs_) {
238 request->Cancel(); 238 request->Cancel();
239 OnResponseCompleted(request); 239 OnResponseCompleted(request);
240 } else if (!request->status().is_success()) { 240 } else if (!request->status().is_success()) {
241 DCHECK(request->status().status() == URLRequestStatus::FAILED || 241 DCHECK(request->status().status() == net::URLRequestStatus::FAILED ||
242 request->status().status() == URLRequestStatus::CANCELED); 242 request->status().status() == net::URLRequestStatus::CANCELED);
243 request_failed_ = true; 243 request_failed_ = true;
244 OnResponseCompleted(request); 244 OnResponseCompleted(request);
245 } else { 245 } else {
246 // Initiate the first read. 246 // Initiate the first read.
247 int bytes_read = 0; 247 int bytes_read = 0;
248 if (request->Read(buf_, kBufferSize, &bytes_read)) 248 if (request->Read(buf_, kBufferSize, &bytes_read))
249 OnReadCompleted(request, bytes_read); 249 OnReadCompleted(request, bytes_read);
250 else if (!request->status().is_io_pending()) 250 else if (!request->status().is_io_pending())
251 OnResponseCompleted(request); 251 OnResponseCompleted(request);
252 } 252 }
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 bool received_data_before_response_; 396 bool received_data_before_response_;
397 bool request_failed_; 397 bool request_failed_;
398 bool have_certificate_errors_; 398 bool have_certificate_errors_;
399 std::string data_received_; 399 std::string data_received_;
400 400
401 // our read buffer 401 // our read buffer
402 scoped_refptr<net::IOBuffer> buf_; 402 scoped_refptr<net::IOBuffer> buf_;
403 }; 403 };
404 404
405 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_ 405 #endif // NET_URL_REQUEST_URL_REQUEST_UNITTEST_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_status.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698