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

Side by Side Diff: content/test/net/url_request_abort_on_end_job.cc

Issue 1172753003: Move LowerCaseEqualsASCII to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: Created 5 years, 6 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 | « content/renderer/savable_resources.cc ('k') | content/test/plugin/plugin_test.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) 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 // This class simulates what wininet does when a dns lookup fails. 4 // This class simulates what wininet does when a dns lookup fails.
5 5
6 #include <algorithm> 6 #include <algorithm>
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void URLRequestAbortOnEndJob::AddUrlHandler() { 60 void URLRequestAbortOnEndJob::AddUrlHandler() {
61 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, 61 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
62 base::Bind(AddUrlHandlerOnIOThread)); 62 base::Bind(AddUrlHandlerOnIOThread));
63 } 63 }
64 64
65 // Private const version. 65 // Private const version.
66 void URLRequestAbortOnEndJob::GetResponseInfoConst( 66 void URLRequestAbortOnEndJob::GetResponseInfoConst(
67 net::HttpResponseInfo* info) const { 67 net::HttpResponseInfo* info) const {
68 // Send back mock headers. 68 // Send back mock headers.
69 std::string raw_headers; 69 std::string raw_headers;
70 if (LowerCaseEqualsASCII(k400AbortOnEndUrl, 70 if (base::LowerCaseEqualsASCII(k400AbortOnEndUrl,
71 request_->url().spec().c_str())) { 71 request_->url().spec().c_str())) {
72 raw_headers.append( 72 raw_headers.append(
73 "HTTP/1.1 400 This is not OK\n" 73 "HTTP/1.1 400 This is not OK\n"
74 "Content-type: text/plain\n"); 74 "Content-type: text/plain\n");
75 } else { 75 } else {
76 NOTREACHED(); 76 NOTREACHED();
77 } 77 }
78 // ParseRawHeaders expects \0 to end each header line. 78 // ParseRawHeaders expects \0 to end each header line.
79 ReplaceSubstringsAfterOffset(&raw_headers, 0, "\n", std::string("\0", 1)); 79 ReplaceSubstringsAfterOffset(&raw_headers, 0, "\n", std::string("\0", 1));
80 info->headers = new net::HttpResponseHeaders(raw_headers); 80 info->headers = new net::HttpResponseHeaders(raw_headers);
81 } 81 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return true; 120 return true;
121 } 121 }
122 122
123 SetStatus(net::URLRequestStatus(net::URLRequestStatus::FAILED, 123 SetStatus(net::URLRequestStatus(net::URLRequestStatus::FAILED,
124 net::ERR_CONNECTION_ABORTED)); 124 net::ERR_CONNECTION_ABORTED));
125 *bytes_read = -1; 125 *bytes_read = -1;
126 return false; 126 return false;
127 } 127 }
128 128
129 } // namespace content 129 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/savable_resources.cc ('k') | content/test/plugin/plugin_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698