summaryrefslogtreecommitdiffstats
path: root/net/websockets/websocket_end_to_end_test.cc
diff options
context:
space:
mode:
authormgiuca <mgiuca@chromium.org>2015-02-04 23:31:18 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-05 07:32:17 +0000
commit77752c3e55c59747a62a362799ac6de5ff56fd45 (patch)
tree3335837d27339353c3dbef87320aadd90c0df664 /net/websockets/websocket_end_to_end_test.cc
parentbf7077883810ce30907c2d8e68bd50c1a5853af1 (diff)
downloadchromium_src-77752c3e55c59747a62a362799ac6de5ff56fd45.zip
chromium_src-77752c3e55c59747a62a362799ac6de5ff56fd45.tar.gz
chromium_src-77752c3e55c59747a62a362799ac6de5ff56fd45.tar.bz2
GURL::Replacements methods accept a StringPiece instead of std::string&.
Previously, it was unsafe to pass a char* because it would be implicitly converted to a string with a very short lifetime. Now, you can safely pass a char* as long as the memory pointed to by the char* outlives the Replacements (which is always true for string literals). All existing usage of Replacements should continue to work as usual. Updated every call to Replacements Set*Str methods that that could be simplified by the new StringPiece API (for example, passing string literals directly, instead of copying them into a string object). Internally, renamed StdStringReplacements to StringPieceReplacements. BUG=454274 Review URL: https://codereview.chromium.org/889463003 Cr-Commit-Position: refs/heads/master@{#314771}
Diffstat (limited to 'net/websockets/websocket_end_to_end_test.cc')
-rw-r--r--net/websockets/websocket_end_to_end_test.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index 4aa2f1c..1a3df04 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -338,9 +338,8 @@ TEST_F(WebSocketEndToEndTest, DISABLED_ON_ANDROID(HttpsProxyUsed)) {
// The test server doesn't have an unauthenticated proxy mode. WebSockets
// cannot provide auth information that isn't already cached, so it's
// necessary to preflight an HTTP request to authenticate against the proxy.
- std::string scheme("http");
GURL::Replacements replacements;
- replacements.SetSchemeStr(scheme);
+ replacements.SetSchemeStr("http");
// It doesn't matter what the URL is, as long as it is an HTTP navigation.
GURL http_page =
ws_server.GetURL("connect_check.html").ReplaceComponents(replacements);