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

Side by Side Diff: pdf/document_loader.cc

Issue 448853002: Move StringToLowerASCII to base namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/websockets/websocket_handshake_handler.cc ('k') | pdf/pdfium/pdfium_page.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) 2010 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 "pdf/document_loader.h" 5 #include "pdf/document_loader.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "net/http/http_util.h" 9 #include "net/http/http_util.h"
10 #include "ppapi/c/pp_errors.h" 10 #include "ppapi/c/pp_errors.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 } 350 }
351 } 351 }
352 } 352 }
353 return false; 353 return false;
354 } 354 }
355 355
356 std::string DocumentLoader::GetMultiPartBoundary(const std::string& headers) { 356 std::string DocumentLoader::GetMultiPartBoundary(const std::string& headers) {
357 net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\n"); 357 net::HttpUtil::HeadersIterator it(headers.begin(), headers.end(), "\n");
358 while (it.GetNext()) { 358 while (it.GetNext()) {
359 if (LowerCaseEqualsASCII(it.name(), "content-type")) { 359 if (LowerCaseEqualsASCII(it.name(), "content-type")) {
360 std::string type = StringToLowerASCII(it.values()); 360 std::string type = base::StringToLowerASCII(it.values());
361 if (StartsWithASCII(type, "multipart/", true)) { 361 if (StartsWithASCII(type, "multipart/", true)) {
362 const char* boundary = strstr(type.c_str(), "boundary="); 362 const char* boundary = strstr(type.c_str(), "boundary=");
363 if (!boundary) { 363 if (!boundary) {
364 NOTREACHED(); 364 NOTREACHED();
365 break; 365 break;
366 } 366 }
367 367
368 return std::string(boundary + 9); 368 return std::string(boundary + 9);
369 } 369 }
370 } 370 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 uint32 DocumentLoader::GetRequestSize() const { 495 uint32 DocumentLoader::GetRequestSize() const {
496 // Document loading strategy: 496 // Document loading strategy:
497 // For first 10 requests, we use 32k chunk sizes, for the next 10 requests we 497 // For first 10 requests, we use 32k chunk sizes, for the next 10 requests we
498 // double the size (64k), and so on, until we cap max request size at 2M for 498 // double the size (64k), and so on, until we cap max request size at 2M for
499 // 71 or more requests. 499 // 71 or more requests.
500 uint32 limited_count = std::min(std::max(requests_count_, 10u), 70u); 500 uint32 limited_count = std::min(std::max(requests_count_, 10u), 70u);
501 return 32*1024 * (1 << ((limited_count - 1) / 10u)); 501 return 32*1024 * (1 << ((limited_count - 1) / 10u));
502 } 502 }
503 503
504 } // namespace chrome_pdf 504 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « net/websockets/websocket_handshake_handler.cc ('k') | pdf/pdfium/pdfium_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698