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

Side by Side Diff: net/test/url_request/url_request_failed_job.cc

Issue 567563002: Move url_request_failed_job to net/test/url_request/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error 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
« no previous file with comments | « net/test/url_request/url_request_failed_job.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) 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 "content/test/net/url_request_failed_job.h" 5 #include "net/test/url_request/url_request_failed_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "net/base/net_errors.h" 11 #include "net/base/net_errors.h"
12 #include "net/url_request/url_request.h" 12 #include "net/url_request/url_request.h"
13 #include "net/url_request/url_request_filter.h" 13 #include "net/url_request/url_request_filter.h"
14 14
15 namespace content { 15 namespace net {
16 namespace { 16 namespace {
17 17
18 const char kMockHostname[] = "mock.failed.request"; 18 const char kMockHostname[] = "mock.failed.request";
19 19
20 // Gets the numeric net error code from URL of the form: 20 // Gets the numeric net error code from URL of the form:
21 // scheme://kMockHostname/error_code. The error code must be a valid 21 // scheme://kMockHostname/error_code. The error code must be a valid
22 // net error code, and not net::OK or net::ERR_IO_PENDING. 22 // net error code, and not net::OK or net::ERR_IO_PENDING.
23 int GetErrorCode(net::URLRequest* request) { 23 int GetErrorCode(net::URLRequest* request) {
24 int net_error; 24 int net_error;
25 std::string path = request->url().path(); 25 std::string path = request->url().path();
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const std::string& scheme) { 100 const std::string& scheme) {
101 return new URLRequestFailedJob( 101 return new URLRequestFailedJob(
102 request, network_delegate, GetErrorCode(request)); 102 request, network_delegate, GetErrorCode(request));
103 } 103 }
104 104
105 void URLRequestFailedJob::StartAsync() { 105 void URLRequestFailedJob::StartAsync() {
106 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED, 106 NotifyStartError(net::URLRequestStatus(net::URLRequestStatus::FAILED,
107 net_error_)); 107 net_error_));
108 } 108 }
109 109
110 } // namespace content 110 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_failed_job.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698