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

Side by Side Diff: chrome_frame/test_utils.cc

Issue 4366001: base: Move CaseInsensitiveCompare traits into the base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome_frame/test_utils.h" 5 #include "chrome_frame/test_utils.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlwin.h> 8 #include <atlwin.h>
9 #include <winternl.h> 9 #include <winternl.h>
10 10
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // should not have side-effects and should be idempotent. 271 // should not have side-effects and should be idempotent.
272 virtual bool Includes(const base::ProcessEntry& entry) const { 272 virtual bool Includes(const base::ProcessEntry& entry) const {
273 bool found = false; 273 bool found = false;
274 std::wstring command_line; 274 std::wstring command_line;
275 if (GetCommandLineForProcess(entry.pid(), &command_line)) { 275 if (GetCommandLineForProcess(entry.pid(), &command_line)) {
276 std::wstring::const_iterator it = 276 std::wstring::const_iterator it =
277 std::search(command_line.begin(), 277 std::search(command_line.begin(),
278 command_line.end(), 278 command_line.end(),
279 argument_to_find_.begin(), 279 argument_to_find_.begin(),
280 argument_to_find_.end(), 280 argument_to_find_.end(),
281 CaseInsensitiveCompareASCII<wchar_t>()); 281 base::CaseInsensitiveCompareASCII<wchar_t>());
282 found = (it != command_line.end()); 282 found = (it != command_line.end());
283 } 283 }
284 return found; 284 return found;
285 } 285 }
286 286
287 protected: 287 protected:
288 std::wstring argument_to_find_; 288 std::wstring argument_to_find_;
289 }; 289 };
290 290
291 } // namespace 291 } // namespace
292 292
293 bool KillAllNamedProcessesWithArgument(const std::wstring& process_name, 293 bool KillAllNamedProcessesWithArgument(const std::wstring& process_name,
294 const std::wstring& argument) { 294 const std::wstring& argument) {
295 bool result = true; 295 bool result = true;
296 ArgumentFilter filter(argument); 296 ArgumentFilter filter(argument);
297 base::NamedProcessIterator iter(process_name, &filter); 297 base::NamedProcessIterator iter(process_name, &filter);
298 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) { 298 while (const base::ProcessEntry* entry = iter.NextProcessEntry()) {
299 if (!base::KillProcessById(entry->pid(), 0, true)) { 299 if (!base::KillProcessById(entry->pid(), 0, true)) {
300 result = false; 300 result = false;
301 } 301 }
302 } 302 }
303 303
304 return result; 304 return result;
305 } 305 }
OLDNEW
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | net/base/net_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698