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

Unified Diff: mojo/shell/desktop/mojo_main.cc

Issue 703753005: More Windows build fixes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove generated files Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/public/cpp/network/udp_socket_wrapper.cc ('k') | mojo/shell/dynamic_application_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/desktop/mojo_main.cc
diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc
index e03aa2a2c51baa2718c09d6ba067880d1ddb7c69..b4f61961336551f059d11b5a3fd3dedd2b201e48 100644
--- a/mojo/shell/desktop/mojo_main.cc
+++ b/mojo/shell/desktop/mojo_main.cc
@@ -25,16 +25,6 @@ namespace {
const char kEnableHarfBuzzRenderText[] = "enable-harfbuzz-rendertext";
#endif
-#if defined(OS_WIN)
-void SplitString(const base::string16& str, std::vector<std::string>* argv) {
- base::SplitString(base::UTF16ToUTF8(str), ' ', argv);
-}
-#elif defined(OS_POSIX)
-void SplitString(const std::string& str, std::vector<std::string>* argv) {
- base::SplitString(str, ' ', argv);
-}
-#endif
-
bool IsEmpty(const std::string& s) {
return s.empty();
}
@@ -43,11 +33,11 @@ bool IsEmpty(const std::string& s) {
// is a list of "configuration" arguments separated by spaces. If one or more
// arguments are specified they will be available when the Mojo application
// is initialized. See ApplicationImpl::args().
-GURL GetAppURLAndSetArgs(const base::CommandLine::StringType& app_url_and_args,
+GURL GetAppURLAndSetArgs(const std::string& app_url_and_args,
mojo::shell::Context* context) {
// SplitString() returns empty strings for extra delimeter characters (' ').
std::vector<std::string> argv;
- SplitString(app_url_and_args, &argv);
+ base::SplitString(app_url_and_args, ' ', &argv);
argv.erase(std::remove_if(argv.begin(), argv.end(), IsEmpty), argv.end());
if (argv.empty())
@@ -60,8 +50,15 @@ GURL GetAppURLAndSetArgs(const base::CommandLine::StringType& app_url_and_args,
void RunApps(mojo::shell::Context* context) {
const auto& command_line = *base::CommandLine::ForCurrentProcess();
- for (const auto& arg : command_line.GetArgs())
- context->Run(GetAppURLAndSetArgs(arg, context));
+ for (const auto& arg : command_line.GetArgs()) {
+ std::string arg2;
+#if defined(OS_WIN)
+ arg2 = base::UTF16ToUTF8(arg);
+#else
+ arg2 = arg;
+#endif
+ context->Run(GetAppURLAndSetArgs(arg2, context));
+ }
}
void Usage() {
« no previous file with comments | « mojo/services/public/cpp/network/udp_socket_wrapper.cc ('k') | mojo/shell/dynamic_application_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698