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

Unified Diff: extensions/browser/api/bluetooth/bluetooth_private_api.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
Index: extensions/browser/api/bluetooth/bluetooth_private_api.cc
diff --git a/extensions/browser/api/bluetooth/bluetooth_private_api.cc b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
index 8de965d4bdcbd3e0f48dbbf0bba30e13bd249a19..41b3f3b0b0541c1408bb08d928ac2d9c72fc7e46 100644
--- a/extensions/browser/api/bluetooth/bluetooth_private_api.cc
+++ b/extensions/browser/api/bluetooth/bluetooth_private_api.cc
@@ -10,6 +10,7 @@
#include "base/callback.h"
#include "base/lazy_instance.h"
+#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
@@ -230,9 +231,8 @@ void BluetoothPrivateSetAdapterStateFunction::SendError() {
DCHECK(pending_properties_.empty());
DCHECK(!failed_properties_.empty());
- std::vector<std::string> failed_vector;
- std::copy(failed_properties_.begin(), failed_properties_.end(),
- std::back_inserter(failed_vector));
+ std::vector<base::StringPiece> failed_vector(failed_properties_.begin(),
+ failed_properties_.end());
std::vector<std::string> replacements(1);
replacements[0] = base::JoinString(failed_vector, ", ");

Powered by Google App Engine
This is Rietveld 408576698