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

Unified Diff: content/public/test/browser_test_utils.cc

Issue 889463003: GURL::Replacements methods accept a StringPiece instead of std::string&. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase (fixed some merge conflicts). Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 20d6f6c956fa702995dbcfff22395ebb29ce7bd7..5de8137fae17df19ad4697870ec5cd22409c0464 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -10,6 +10,7 @@
#include "base/process/kill.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/waitable_event.h"
#include "base/test/test_timeouts.h"
@@ -240,9 +241,8 @@ scoped_ptr<net::test_server::HttpResponse> CrossSiteRedirectResponseHandler(
return scoped_ptr<net::test_server::HttpResponse>();
// Replace the host of the URL with the one passed in the URL.
- std::string host = params.substr(0, slash);
GURL::Replacements replace_host;
- replace_host.SetHostStr(host);
+ replace_host.SetHostStr(base::StringPiece(params).substr(0, slash));
GURL redirect_server = server_base_url.ReplaceComponents(replace_host);
// Append the real part of the path to the new URL.
« no previous file with comments | « content/browser/web_contents/web_contents_impl_browsertest.cc ('k') | content/test/browser_test_utils_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698