OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/runner/context.h" | 5 #include "mojo/runner/context.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 #if defined(OS_ANDROID) | 125 #if defined(OS_ANDROID) |
126 // TODO(eseidel): On Android we pass command line arguments is via the | 126 // TODO(eseidel): On Android we pass command line arguments is via the |
127 // 'parameters' key on the intent, which we specify during 'am shell start' | 127 // 'parameters' key on the intent, which we specify during 'am shell start' |
128 // via --esa, however that expects comma-separated values and says: | 128 // via --esa, however that expects comma-separated values and says: |
129 // am shell --help: | 129 // am shell --help: |
130 // [--esa <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]] | 130 // [--esa <EXTRA_KEY> <EXTRA_STRING_VALUE>[,<EXTRA_STRING_VALUE...]] |
131 // (to embed a comma into a string escape it using "\,") | 131 // (to embed a comma into a string escape it using "\,") |
132 // Whatever takes 'parameters' and constructs a CommandLine is failing to | 132 // Whatever takes 'parameters' and constructs a CommandLine is failing to |
133 // un-escape the commas, we need to move this fix to that file. | 133 // un-escape the commas, we need to move this fix to that file. |
134 ReplaceSubstringsAfterOffset(&handlers_spec, 0, "\\,", ","); | 134 base::ReplaceSubstringsAfterOffset(&handlers_spec, 0, "\\,", ","); |
135 #endif | 135 #endif |
136 | 136 |
137 std::vector<std::string> parts; | 137 std::vector<std::string> parts; |
138 base::SplitString(handlers_spec, ',', &parts); | 138 base::SplitString(handlers_spec, ',', &parts); |
139 if (parts.size() % 2 != 0) { | 139 if (parts.size() % 2 != 0) { |
140 LOG(ERROR) << "Invalid value for switch " << switches::kContentHandlers | 140 LOG(ERROR) << "Invalid value for switch " << switches::kContentHandlers |
141 << ": must be a comma-separated list of mimetype/url pairs." | 141 << ": must be a comma-separated list of mimetype/url pairs." |
142 << handlers_spec; | 142 << handlers_spec; |
143 return; | 143 return; |
144 } | 144 } |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { | 376 if (app_urls_.empty() && base::MessageLoop::current()->is_running()) { |
377 DCHECK_EQ(base::MessageLoop::current()->task_runner(), | 377 DCHECK_EQ(base::MessageLoop::current()->task_runner(), |
378 task_runners_->shell_runner()); | 378 task_runners_->shell_runner()); |
379 base::MessageLoop::current()->Quit(); | 379 base::MessageLoop::current()->Quit(); |
380 } | 380 } |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 } // namespace runner | 384 } // namespace runner |
385 } // namespace mojo | 385 } // namespace mojo |
OLD | NEW |