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

Unified Diff: sandbox/win/src/named_pipe_dispatcher.cc

Issue 1284833004: Remove remaining legacy SplitString calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « rlz/win/lib/machine_deal.cc ('k') | skia/ext/image_operations_bench.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/named_pipe_dispatcher.cc
diff --git a/sandbox/win/src/named_pipe_dispatcher.cc b/sandbox/win/src/named_pipe_dispatcher.cc
index 6bf982a9424e8b15657ba26ff12f35dc03ec4880..53bb7c4c658d0d81d3f9222271eac1b69e8061ae 100644
--- a/sandbox/win/src/named_pipe_dispatcher.cc
+++ b/sandbox/win/src/named_pipe_dispatcher.cc
@@ -56,16 +56,15 @@ bool NamedPipeDispatcher::CreateNamedPipe(IPCInfo* ipc,
ipc->return_info.win32_result = ERROR_ACCESS_DENIED;
ipc->return_info.handle = INVALID_HANDLE_VALUE;
- std::vector<base::string16> paths;
- std::vector<base::string16> innerpaths;
- base::SplitString(*name, '/', &paths);
-
- for (std::vector<base::string16>::const_iterator iter = paths.begin();
- iter != paths.end(); ++iter) {
- base::SplitString(*iter, '\\', &innerpaths);
- for (std::vector<base::string16>::const_iterator iter2 = innerpaths.begin();
- iter2 != innerpaths.end(); ++iter2) {
- if (*iter2 == L"..")
+ base::StringPiece16 dotdot(L"..");
+
+ for (const base::StringPiece16& path : base::SplitStringPiece(
+ *name, base::string16(1, '/'),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
+ for (const base::StringPiece16& inner : base::SplitStringPiece(
+ path, base::string16(1, '\\'),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
+ if (inner == dotdot)
return true;
}
}
« no previous file with comments | « rlz/win/lib/machine_deal.cc ('k') | skia/ext/image_operations_bench.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698