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

Unified Diff: sky/tools/debugger/prompt/prompt.cc

Issue 875183002: Make it possible to pass a default url to sky_debugger (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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 | « sky/tools/debugger/debugger.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/debugger/prompt/prompt.cc
diff --git a/sky/tools/debugger/prompt/prompt.cc b/sky/tools/debugger/prompt/prompt.cc
index f5340c4521815afcab56e252789085ccd0b87eaa..c53554c1420989e9b17abd73db8e23b72237358f 100644
--- a/sky/tools/debugger/prompt/prompt.cc
+++ b/sky/tools/debugger/prompt/prompt.cc
@@ -42,10 +42,11 @@ class Prompt : public mojo::ApplicationDelegate,
// Overridden from mojo::ApplicationDelegate:
virtual void Initialize(mojo::ApplicationImpl* app) override {
app->ConnectToService("mojo:tracing", &tracing_);
- // app_url, command_port, url_to_load
+ // Format: --args-for="app_url command_port"
if (app->args().size() < 2) {
LOG(ERROR) << "--args-for required to specify command_port";
- exit(2);
+ mojo::ApplicationImpl::Terminate();
+ return;
}
base::StringToUint(app->args()[1], &command_port_);
@@ -54,10 +55,9 @@ class Prompt : public mojo::ApplicationDelegate,
new net::TCPServerSocket(NULL, net::NetLog::Source()));
int result = server_socket->ListenWithAddressAndPort("0.0.0.0", command_port_, 1);
if (result != net::OK) {
- // FIXME: Should we quit here?
LOG(ERROR) << "Failed to bind to port " << command_port_
- << " skydb commands will not work, exiting.";
- exit(2);
+ << " skydb commands will not work.";
+ mojo::ApplicationImpl::Terminate();
return;
}
web_server_.reset(new net::HttpServer(server_socket.Pass(), this));
« no previous file with comments | « sky/tools/debugger/debugger.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698