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

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

Issue 829183005: Always use mojo_shell in over-http mode (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Fix pprof 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
Index: sky/tools/debugger/prompt/prompt.cc
diff --git a/sky/tools/debugger/prompt/prompt.cc b/sky/tools/debugger/prompt/prompt.cc
index 23f1c5dfb8038f8da1d1dd79fa9f6e74a010669b..5a05b16177cbb988b41274046d22fb3b79ce9613 100644
--- a/sky/tools/debugger/prompt/prompt.cc
+++ b/sky/tools/debugger/prompt/prompt.cc
@@ -102,12 +102,16 @@ class Prompt : public mojo::ApplicationDelegate,
void OnWebSocketRequest(
int connection_id, const net::HttpServerRequestInfo& info) override {
- web_server_->Send500(connection_id, "http only");
+ Error(connection_id, "OnWebSocketRequest not implemented");
}
void OnWebSocketMessage(
int connection_id, const std::string& data) override {
- web_server_->Send500(connection_id, "http only");
+ Error(connection_id, "OnWebSocketMessage not implemented");
+ }
+
+ void Error(int connection_id, std::string message) {
+ web_server_->Send500(connection_id, message);
}
void Respond(int connection_id, std::string response) {
@@ -177,11 +181,21 @@ class Prompt : public mojo::ApplicationDelegate,
}
void StartProfiling(int connection_id) {
+#if !defined(NDEBUG) || !defined(ENABLE_PROFILING)
+ Error(connection_id,
+ "Profiling requires debug=false and enable_profiling=true");
abarth-chromium 2015/01/21 22:18:49 debug=false -> is_debug=false
eseidel 2015/01/21 22:44:43 Done.
+ return;
+#else
base::debug::StartProfiling("sky_viewer.pprof");
Respond(connection_id, "Starting profiling (stop with 'stop_profiling')");
+#endif
}
void StopProfiling(int connection_id) {
+ if (!base::debug::BeingProfiled()) {
+ Error(connection_id, "Profiling not started");
+ return;
+ }
base::debug::StopProfiling();
Respond(connection_id, "Stopped profiling");
}

Powered by Google App Engine
This is Rietveld 408576698