|
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
Committed: https://crrev.com/3a2c6907279aca02c1ecfa971237068338ba49d8
Cr-Commit-Position: refs/heads/master@{#337445}
Total comments: 15
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+285 lines, -257 lines) |
Patch |
 |
M |
base/strings/string_split.cc
|
View
|
1
2
|
1 chunk |
+0 lines, -1 line |
0 comments
|
Download
|
 |
M |
base/strings/string_util.h
|
View
|
1
2
3
4
|
1 chunk |
+10 lines, -6 lines |
0 comments
|
Download
|
 |
M |
base/strings/string_util.cc
|
View
|
|
1 chunk |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
M |
net/base/data_url.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
net/base/host_mapping_rules.cc
|
View
|
1
2
5
6
|
1 chunk |
+3 lines, -4 lines |
0 comments
|
Download
|
 |
M |
net/base/host_port_pair.cc
|
View
|
1
|
2 chunks |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
net/base/ip_address_number.h
|
View
|
1
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
net/base/ip_address_number.cc
|
View
|
1
|
2 chunks |
+7 lines, -5 lines |
0 comments
|
Download
|
 |
M |
net/base/ip_pattern.cc
|
View
|
1
2
|
2 chunks |
+19 lines, -20 lines |
0 comments
|
Download
|
 |
M |
net/base/mime_util.cc
|
View
|
1
2
3
4
5
6
7
|
4 chunks |
+17 lines, -16 lines |
0 comments
|
Download
|
 |
M |
net/base/net_util_icu.cc
|
View
|
1
2
|
2 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
 |
M |
net/cert/x509_certificate_unittest.cc
|
View
|
1
2
|
2 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
 |
M |
net/cookies/cookie_monster_unittest.cc
|
View
|
1
2
|
2 chunks |
+10 lines, -14 lines |
0 comments
|
Download
|
 |
M |
net/dns/dns_config_service_unittest.cc
|
View
|
1
|
1 chunk |
+5 lines, -8 lines |
0 comments
|
Download
|
 |
M |
net/dns/dns_config_service_win.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -6 lines |
0 comments
|
Download
|
 |
M |
net/dns/host_resolver.cc
|
View
|
1
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
net/dns/host_resolver_impl.cc
|
View
|
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/dns/mock_host_resolver.cc
|
View
|
1
|
1 chunk |
+4 lines, -5 lines |
0 comments
|
Download
|
 |
M |
net/filter/filter.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
net/ftp/ftp_directory_listing_parser_ls.cc
|
View
|
1
2
|
3 chunks |
+9 lines, -6 lines |
0 comments
|
Download
|
 |
M |
net/ftp/ftp_directory_listing_parser_netware.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/ftp/ftp_directory_listing_parser_os2.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/ftp/ftp_directory_listing_parser_vms.cc
|
View
|
1
2
|
6 chunks |
+19 lines, -13 lines |
0 comments
|
Download
|
 |
M |
net/ftp/ftp_directory_listing_parser_windows.cc
|
View
|
1
2
|
2 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/ftp/ftp_network_transaction.cc
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/ftp/ftp_util.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
 |
M |
net/http/http_auth_cache.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
net/http/http_response_headers.cc
|
View
|
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/http/http_stream_factory.cc
|
View
|
1
2
|
3 chunks |
+8 lines, -6 lines |
0 comments
|
Download
|
 |
M |
net/http/http_util.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/proxy/proxy_bypass_rules.cc
|
View
|
1
2
3
4
5
6
7
|
1 chunk |
+3 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/proxy/proxy_config_service_linux.cc
|
View
|
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
 |
M |
net/quic/quic_utils.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
net/server/http_server_unittest.cc
|
View
|
1
2
|
5 chunks |
+16 lines, -9 lines |
0 comments
|
Download
|
 |
M |
net/spdy/spdy_test_util_common.cc
|
View
|
1
|
1 chunk |
+4 lines, -5 lines |
0 comments
|
Download
|
 |
M |
net/ssl/ssl_cipher_suite_names.cc
|
View
|
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/test/embedded_test_server/embedded_test_server.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
net/test/embedded_test_server/http_request.cc
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/test/spawned_test_server/remote_test_server.cc
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/tools/balsa/balsa_frame.cc
|
View
|
1
|
4 chunks |
+5 lines, -4 lines |
0 comments
|
Download
|
 |
M |
net/tools/balsa/balsa_headers_token_utils.cc
|
View
|
1
2
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/tools/balsa/string_piece_utils.h
|
View
|
1
2
3
4
5
|
7 chunks |
+21 lines, -33 lines |
0 comments
|
Download
|
 |
M |
net/tools/disk_cache_memory_test/disk_cache_memory_test.cc
|
View
|
1
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/tools/flip_server/flip_in_mem_edsm_server.cc
|
View
|
1
|
3 chunks |
+6 lines, -6 lines |
0 comments
|
Download
|
 |
M |
net/tools/flip_server/loadtime_measurement.h
|
View
|
1
|
2 chunks |
+10 lines, -9 lines |
0 comments
|
Download
|
 |
M |
net/tools/gdig/gdig.cc
|
View
|
1
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
M |
net/tools/net_watcher/net_watcher.cc
|
View
|
1
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
net/tools/quic/quic_client_bin.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/tools/quic/quic_in_memory_cache.cc
|
View
|
|
1 chunk |
+4 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/tools/quic/quic_simple_client_bin.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
net/url_request/url_request_unittest.cc
|
View
|
1
|
3 chunks |
+10 lines, -10 lines |
0 comments
|
Download
|
 |
M |
pdf/pdfium/pdfium_engine.cc
|
View
|
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 27 (11 generated)
|