diff options
author | brettw <brettw@chromium.org> | 2015-07-06 12:43:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-06 19:44:09 +0000 |
commit | 3a2c6907279aca02c1ecfa971237068338ba49d8 (patch) | |
tree | 635a77bc441a04a0c711d934d265f8cc09b64e86 /pdf | |
parent | f3793eb89ee07a241d94bb26907041d1ede33fab (diff) | |
download | chromium_src-3a2c6907279aca02c1ecfa971237068338ba49d8.zip chromium_src-3a2c6907279aca02c1ecfa971237068338ba49d8.tar.gz chromium_src-3a2c6907279aca02c1ecfa971237068338ba49d8.tar.bz2 |
New new versions of Starts/EndsWith and SplitString in net.
The new calls are longer but more explicit and also more general. I didn't want change the semantics. The old SplitString maps to TRIM_WHITESPACE, SPLIT_WANT_ALL so I generally kept that even if it's not clear if the calling code wants that particular behavior.
In places that obviously didn't need copies, use the StringPiece variant to avoid copies. I didn't expend too much effort in this area, especially in unit test code. It's like that more copies could be deleted with more effort.
Many places just used SplitString to fill a vector that is iterated over. In these places I updated it to use a range-based for loop over the result of the function call.
Add StringPiece versions of TrimWhitesace to match the existing Trim functions.
Update IPLiteralToNumber to take a string piece. This is commonly used in places that have string pieces so this saves a copy.
In net/dns/dns_config_service_win.cc I replaced a UTF16TOASCII call with assign(). This is what UTF16ToASCII actually does and avoids a copy because the current UTF16ToASCII doesn't support StringPiece. Updating this function call or adding an override is a big project due to the way it's use with Blink's WebString.
Removed parts of StringPieceUtils that duplicate base code. Made the remaining functions in that file not locale dependent (tolower is basically always wrong for non-ASCII).
BUG=506920,506255
Review URL: https://codereview.chromium.org/1215933004
Cr-Commit-Position: refs/heads/master@{#337445}
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdfium/pdfium_engine.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index 410b29b..026eeb4 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc @@ -3917,7 +3917,7 @@ bool PDFiumEngineExports::RenderPDFPageToDC(const void* pdf_buffer, doc, "Creator", WriteInto(&creator, buffer_bytes + 1), buffer_bytes); } bool use_bitmap = false; - if (base::StartsWith(creator, L"cairo", false)) + if (base::StartsWith(creator, L"cairo", base::CompareCase::INSENSITIVE_ASCII)) use_bitmap = true; // Another temporary hack. Some PDFs seems to render very slowly if |