Chromium Code Reviews| 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"); |
| } |