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

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

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android 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 | « net/test/url_request/url_request_mock_http_job.cc ('k') | pdf/pdfium/pdfium_engine.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 4
5 #include "net/test/url_request/url_request_slow_download_job.h" 5 #include "net/test/url_request/url_request_slow_download_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 "Cache-Control: max-age=0\n"); 266 "Cache-Control: max-age=0\n");
267 267
268 if (base::LowerCaseEqualsASCII(kKnownSizeUrl, 268 if (base::LowerCaseEqualsASCII(kKnownSizeUrl,
269 request_->url().spec().c_str())) { 269 request_->url().spec().c_str())) {
270 raw_headers.append(base::StringPrintf( 270 raw_headers.append(base::StringPrintf(
271 "Content-Length: %d\n", kFirstDownloadSize + kSecondDownloadSize)); 271 "Content-Length: %d\n", kFirstDownloadSize + kSecondDownloadSize));
272 } 272 }
273 } 273 }
274 274
275 // ParseRawHeaders expects \0 to end each header line. 275 // ParseRawHeaders expects \0 to end each header line.
276 ReplaceSubstringsAfterOffset(&raw_headers, 0, "\n", std::string("\0", 1)); 276 base::ReplaceSubstringsAfterOffset(
277 &raw_headers, 0, "\n", base::StringPiece("\0", 1));
277 info->headers = new HttpResponseHeaders(raw_headers); 278 info->headers = new HttpResponseHeaders(raw_headers);
278 } 279 }
279 280
280 bool URLRequestSlowDownloadJob::GetMimeType(std::string* mime_type) const { 281 bool URLRequestSlowDownloadJob::GetMimeType(std::string* mime_type) const {
281 HttpResponseInfo info; 282 HttpResponseInfo info;
282 GetResponseInfoConst(&info); 283 GetResponseInfoConst(&info);
283 return info.headers.get() && info.headers->GetMimeType(mime_type); 284 return info.headers.get() && info.headers->GetMimeType(mime_type);
284 } 285 }
285 286
286 } // namespace net 287 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_mock_http_job.cc ('k') | pdf/pdfium/pdfium_engine.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698