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

Unified Diff: test/multiprocess_exec_win.cc

Issue 1352323002: win: Make reading NT_IMAGE_HEADERS work cross-bitness (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@cleanup-crashpad-info
Patch Set: fixes2 Created 5 years, 3 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 | « snapshot/win/process_snapshot_win_test.cc ('k') | test/test.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/multiprocess_exec_win.cc
diff --git a/test/multiprocess_exec_win.cc b/test/multiprocess_exec_win.cc
index 6a1262ba1234e2ef87213f33048263dbec278802..23853dd0acde0942e7b02170a81a6213b5645c24 100644
--- a/test/multiprocess_exec_win.cc
+++ b/test/multiprocess_exec_win.cc
@@ -17,48 +17,11 @@
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "gtest/gtest.h"
+#include "test/win/child_launcher.h"
namespace crashpad {
namespace test {
-namespace {
-
-// Ref: http://blogs.msdn.com/b/twistylittlepassagesallalike/archive/2011/04/23/everyone-quotes-arguments-the-wrong-way.aspx
-void AppendCommandLineArgument(const std::wstring& argument,
- std::wstring* command_line) {
- // Don't bother quoting if unnecessary.
- if (!argument.empty() &&
- argument.find_first_of(L" \t\n\v\"") == std::wstring::npos) {
- command_line->append(argument);
- } else {
- command_line->push_back(L'"');
- for (std::wstring::const_iterator i = argument.begin();; ++i) {
- size_t backslash_count = 0;
- while (i != argument.end() && *i == L'\\') {
- ++i;
- ++backslash_count;
- }
- if (i == argument.end()) {
- // Escape all backslashes, but let the terminating double quotation mark
- // we add below be interpreted as a metacharacter.
- command_line->append(backslash_count * 2, L'\\');
- break;
- } else if (*i == L'"') {
- // Escape all backslashes and the following double quotation mark.
- command_line->append(backslash_count * 2 + 1, L'\\');
- command_line->push_back(*i);
- } else {
- // Backslashes aren't special here.
- command_line->append(backslash_count, L'\\');
- command_line->push_back(*i);
- }
- }
- command_line->push_back(L'"');
- }
-}
-
-} // namespace
-
namespace internal {
struct MultiprocessInfo {
« no previous file with comments | « snapshot/win/process_snapshot_win_test.cc ('k') | test/test.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698