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

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

Issue 690433004: Add inspect command to skydb (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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
Index: sky/tools/debugger/prompt/prompt.cc
diff --git a/sky/tools/debugger/prompt/prompt.cc b/sky/tools/debugger/prompt/prompt.cc
index d411c82618f058ba524ac245a14879794f66cb95..6bcc464b34635acb05918c62df7395d43368cc04 100644
--- a/sky/tools/debugger/prompt/prompt.cc
+++ b/sky/tools/debugger/prompt/prompt.cc
@@ -73,6 +73,10 @@ class Prompt : public mojo::ApplicationDelegate {
Reload();
return true;
}
+ if (command == "inspect") {
+ Inspect();
+ return true;
+ }
if (command.size() == 1) {
char c = command[0];
if (c == 'h')
@@ -111,16 +115,25 @@ class Prompt : public mojo::ApplicationDelegate {
<< "Sky Debugger" << std::endl
<< "============" << std::endl
<< "Type a URL to load in the debugger, enter to reload." << std::endl
- << "Commands: help -- Help" << std::endl
- << " trace -- Capture a trace" << std::endl
- << " reload -- Reload the current page" << std::endl
- << " q -- Quit" << std::endl;
+ << "Commands: help -- Help" << std::endl
+ << " trace -- Capture a trace" << std::endl
+ << " reload -- Reload the current page" << std::endl
+ << " inspect -- Inspect the current page" << std::endl
+ << " q -- Quit" << std::endl;
}
void Reload() {
debugger_->NavigateToURL(url_);
}
+ void Inspect() {
+ debugger_->InjectInspector();
+ std::cout
+ << "Open the following URL in Chrome:" << std::endl
+ << "chrome-devtools://devtools/bundled/devtools.html?ws=localhost:9898"
+ << std::endl;
+ }
+
void Quit() {
std::cout << "quitting" << std::endl;
exit(0);

Powered by Google App Engine
This is Rietveld 408576698