OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/weak_ptr.h" | 6 #include "base/memory/weak_ptr.h" |
7 #include "mojo/application/application_runner_chromium.h" | 7 #include "mojo/application/application_runner_chromium.h" |
8 #include "mojo/public/c/system/main.h" | 8 #include "mojo/public/c/system/main.h" |
9 #include "mojo/public/cpp/application/application_delegate.h" | 9 #include "mojo/public/cpp/application/application_delegate.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 url_ = "https://raw.githubusercontent.com/domokit/mojo/master/sky/" | 49 url_ = "https://raw.githubusercontent.com/domokit/mojo/master/sky/" |
50 "examples/home.sky"; | 50 "examples/home.sky"; |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 virtual bool ConfigureIncomingConnection( | 54 virtual bool ConfigureIncomingConnection( |
55 mojo::ApplicationConnection* connection) override { | 55 mojo::ApplicationConnection* connection) override { |
56 connection->ConnectToService(&debugger_); | 56 connection->ConnectToService(&debugger_); |
57 std::cout << "Loading " << url_ << std::endl; | 57 std::cout << "Loading " << url_ << std::endl; |
58 Reload(); | 58 Reload(); |
| 59 #if !defined(OS_ANDROID) |
| 60 // FIXME: To support device-centric development we need to re-write |
| 61 // prompt.cc to just be a server and have all the command handling move |
| 62 // to python (skydb). prompt.cc would just run until told to quit. |
| 63 // If we don't comment this out then prompt.cc just quits when run headless |
| 64 // as it immediately recieves EOF which it treats as quit. |
59 ScheduleWaitForInput(); | 65 ScheduleWaitForInput(); |
| 66 #endif |
60 return true; | 67 return true; |
61 } | 68 } |
62 | 69 |
63 bool ExecuteCommand(const std::string& command) { | 70 bool ExecuteCommand(const std::string& command) { |
64 if (command == "help" || command == "h") { | 71 if (command == "help" || command == "h") { |
65 PrintHelp(); | 72 PrintHelp(); |
66 return true; | 73 return true; |
67 } | 74 } |
68 if (command == "trace") { | 75 if (command == "trace") { |
69 ToggleTracing(); | 76 ToggleTracing(); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 DISALLOW_COPY_AND_ASSIGN(Prompt); | 162 DISALLOW_COPY_AND_ASSIGN(Prompt); |
156 }; | 163 }; |
157 | 164 |
158 } // namespace debugger | 165 } // namespace debugger |
159 } // namespace sky | 166 } // namespace sky |
160 | 167 |
161 MojoResult MojoMain(MojoHandle shell_handle) { | 168 MojoResult MojoMain(MojoHandle shell_handle) { |
162 mojo::ApplicationRunnerChromium runner(new sky::debugger::Prompt); | 169 mojo::ApplicationRunnerChromium runner(new sky::debugger::Prompt); |
163 return runner.Run(shell_handle); | 170 return runner.Run(shell_handle); |
164 } | 171 } |
OLD | NEW |