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

Unified Diff: shell/command_line_util.cc

Issue 873253003: Resolve URLs passed on the command line relative to the CWD. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Rebase Created 5 years, 11 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 | « shell/command_line_util.h ('k') | shell/command_line_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/command_line_util.cc
diff --git a/shell/command_line_util.cc b/shell/command_line_util.cc
index d8d693f25c39f295a80d02cc733c58844d3ccd73..0a307f676303c9632953b77b1c699bd4299cea72 100644
--- a/shell/command_line_util.cc
+++ b/shell/command_line_util.cc
@@ -20,7 +20,7 @@ namespace {
GURL GetAppURLAndSetArgs(const std::string& app_url_and_args,
Context* context) {
std::vector<std::string> args;
- GURL app_url = GetAppURLAndArgs(app_url_and_args, &args);
+ GURL app_url = GetAppURLAndArgs(context, app_url_and_args, &args);
if (args.size() > 1)
context->application_manager()->SetArgsForURL(args, app_url);
@@ -43,7 +43,8 @@ bool ParseArgsFor(const std::string& arg, std::string* value) {
return false;
}
-GURL GetAppURLAndArgs(const std::string& app_url_and_args,
+GURL GetAppURLAndArgs(Context* context,
+ const std::string& app_url_and_args,
std::vector<std::string>* args) {
// SplitString() returns empty strings for extra delimeter characters (' ').
base::SplitString(app_url_and_args, ' ', args);
@@ -53,7 +54,7 @@ GURL GetAppURLAndArgs(const std::string& app_url_and_args,
if (args->empty())
return GURL();
- GURL app_url((*args)[0]);
+ GURL app_url = context->ResolveCommandLineURL((*args)[0]);
if (!app_url.is_valid()) {
LOG(ERROR) << "Error: invalid URL: " << (*args)[0];
return app_url;
« no previous file with comments | « shell/command_line_util.h ('k') | shell/command_line_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698