| 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/common/tracing.mojom.h" |
| 8 #include "mojo/public/c/system/main.h" | 9 #include "mojo/public/c/system/main.h" |
| 9 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
| 10 #include "mojo/public/cpp/application/application_impl.h" | 11 #include "mojo/public/cpp/application/application_impl.h" |
| 11 #include "sky/tools/debugger/debugger.mojom.h" | 12 #include "sky/tools/debugger/debugger.mojom.h" |
| 12 #include "sky/viewer/services/tracing.mojom.h" | |
| 13 #include <iostream> | 13 #include <iostream> |
| 14 | 14 |
| 15 namespace sky { | 15 namespace sky { |
| 16 namespace debugger { | 16 namespace debugger { |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 std::string GetCommand() { | 19 std::string GetCommand() { |
| 20 std::cout << "(skydb) "; | 20 std::cout << "(skydb) "; |
| 21 std::cout.flush(); | 21 std::cout.flush(); |
| 22 | 22 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 tracing_->Stop(); | 141 tracing_->Stop(); |
| 142 } else { | 142 } else { |
| 143 std::cout << "Starting trace (type 'trace' to stop tracing)" << std::endl; | 143 std::cout << "Starting trace (type 'trace' to stop tracing)" << std::endl; |
| 144 tracing_->Start(); | 144 tracing_->Start(); |
| 145 } | 145 } |
| 146 is_tracing_ = !is_tracing_; | 146 is_tracing_ = !is_tracing_; |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool is_tracing_; | 149 bool is_tracing_; |
| 150 DebuggerPtr debugger_; | 150 DebuggerPtr debugger_; |
| 151 TracingPtr tracing_; | 151 mojo::TracingPtr tracing_; |
| 152 std::string url_; | 152 std::string url_; |
| 153 base::WeakPtrFactory<Prompt> weak_ptr_factory_; | 153 base::WeakPtrFactory<Prompt> weak_ptr_factory_; |
| 154 | 154 |
| 155 DISALLOW_COPY_AND_ASSIGN(Prompt); | 155 DISALLOW_COPY_AND_ASSIGN(Prompt); |
| 156 }; | 156 }; |
| 157 | 157 |
| 158 } // namespace debugger | 158 } // namespace debugger |
| 159 } // namespace sky | 159 } // namespace sky |
| 160 | 160 |
| 161 MojoResult MojoMain(MojoHandle shell_handle) { | 161 MojoResult MojoMain(MojoHandle shell_handle) { |
| 162 mojo::ApplicationRunnerChromium runner(new sky::debugger::Prompt); | 162 mojo::ApplicationRunnerChromium runner(new sky::debugger::Prompt); |
| 163 return runner.Run(shell_handle); | 163 return runner.Run(shell_handle); |
| 164 } | 164 } |
| OLD | NEW |