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

Side by Side Diff: mojo/runner/context.cc

Issue 1200393002: Add more string_util functions to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string
Patch Set: Android Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/infobars/confirm_infobar_controller.mm ('k') | mojo/util/filename_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 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
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
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
OLDNEW
« no previous file with comments | « ios/chrome/browser/infobars/confirm_infobar_controller.mm ('k') | mojo/util/filename_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698