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

Unified Diff: remoting/base/capabilities.cc

Issue 2695883003: Change uses of base::JoinString to pass StringPieces where possible. (Closed)
Patch Set: Remove dependency CL. Created 3 years, 9 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
« no previous file with comments | « gpu/config/gpu_util.cc ('k') | remoting/base/capabilities_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/capabilities.cc
diff --git a/remoting/base/capabilities.cc b/remoting/base/capabilities.cc
index 4903aedfe5fab84b1cb3086500d6bf2dc67f738e..490bb5abee5b4aebfaddf59c79074d7a4407c2b9 100644
--- a/remoting/base/capabilities.cc
+++ b/remoting/base/capabilities.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/stl_util.h"
+#include "base/strings/string_piece.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -22,19 +23,18 @@ bool HasCapability(const std::string& capabilities, const std::string& key) {
std::string IntersectCapabilities(const std::string& client_capabilities,
const std::string& host_capabilities) {
- std::vector<std::string> client_caps = base::SplitString(
- client_capabilities, " ", base::KEEP_WHITESPACE,
- base::SPLIT_WANT_NONEMPTY);
+ std::vector<base::StringPiece> client_caps =
+ base::SplitStringPiece(client_capabilities, " ", base::KEEP_WHITESPACE,
+ base::SPLIT_WANT_NONEMPTY);
std::sort(client_caps.begin(), client_caps.end());
- std::vector<std::string> host_caps = base::SplitString(
- host_capabilities, " ", base::KEEP_WHITESPACE,
- base::SPLIT_WANT_NONEMPTY);
+ std::vector<base::StringPiece> host_caps = base::SplitStringPiece(
+ host_capabilities, " ", base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
std::sort(host_caps.begin(), host_caps.end());
- std::vector<std::string> result =
- base::STLSetIntersection<std::vector<std::string> >(
- client_caps, host_caps);
+ std::vector<base::StringPiece> result =
+ base::STLSetIntersection<std::vector<base::StringPiece>>(client_caps,
+ host_caps);
return base::JoinString(result, " ");
}
« no previous file with comments | « gpu/config/gpu_util.cc ('k') | remoting/base/capabilities_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698