Fill out the rest of the StringPiece functions for 16-bit.
I was originally opposed to these since we didn't need them and they were complicated. But I'm wanting to use some of these functions in a different patch, so it seems like a good time to fill out the std::string-like finding functions for StringPiece16.
This deletes the old StringPieceDetails for which the only point was to share the common stuff between the two BasicStringPiece specializations.
I used the pattern of having two versions of each function declared in the header and then expanding the template in the .cc file, to avoid template bloat in the header.
This replaces all of the size_type goop with size_t. Chrome code assumes these are the same and we encourage people to just use size_t in loops, for example, rather than using the size_type of the template they're iterating over. This makes the code more readable in many places. It also solves a problem with declaration ordering since most of the functions that used size_type are now moved above where the size_type is actually declared.
[email protected]
TBR=akalin, ben
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255397
Review URL: https://codereview.chromium.org/187793004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256311 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/websockets/websocket_basic_handshake_stream.cc b/net/websockets/websocket_basic_handshake_stream.cc
index 85dad8c..d4ed6f8 100644
--- a/net/websockets/websocket_basic_handshake_stream.cc
+++ b/net/websockets/websocket_basic_handshake_stream.cc
@@ -225,7 +225,7 @@
bool DeflateError(std::string* message, const base::StringPiece& piece) {
*message = "Error in permessage-deflate: ";
- AppendToString(piece, message);
+ piece.AppendToString(message);
return false;
}