| 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 #ifndef MOJO_SPY_SPY_H_ | 5 #ifndef MOJO_SPY_SPY_H_ |
| 6 #define MOJO_SPY_SPY_H_ | 6 #define MOJO_SPY_SPY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "base/memory/ref_counted.h" | |
| 10 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 11 | 10 |
| 12 namespace base { | 11 namespace base { |
| 13 class Thread; | 12 class Thread; |
| 14 } | 13 } |
| 15 | 14 |
| 16 namespace mojo { | 15 namespace mojo { |
| 17 | 16 |
| 18 class ServiceManager; | 17 class ServiceManager; |
| 19 class SpyServerImpl; | |
| 20 | 18 |
| 21 // mojo::Spy is a troubleshooting and debugging aid. It helps tracking | 19 // mojo::Spy is a troubleshooting and debugging aid. It helps tracking |
| 22 // the mojo system core activities like messages, service creation, etc. | 20 // the mojo system core activities like messages, service creation, etc. |
| 23 // | 21 // |
| 24 // The |options| parameter in the constructor comes from the command | 22 // The |options| parameter in the constructor comes from the command |
| 25 // line of the mojo_shell. Which takes --spy=<options>. Each option is | 23 // line of the mojo_shell. Which takes --spy=<options>. Each option is |
| 26 // separated by ',' and each option is a key+ value pair separated by ':'. | 24 // separated by ',' and each option is a key+ value pair separated by ':'. |
| 27 // | 25 // |
| 28 // For example --spy=port:13333 | 26 // For example --spy=port:13333 |
| 29 // | 27 // |
| 30 class Spy { | 28 class Spy { |
| 31 public: | 29 public: |
| 32 Spy(mojo::ServiceManager* service_manager, const std::string& options); | 30 Spy(mojo::ServiceManager* service_manager, const std::string& options); |
| 33 ~Spy(); | 31 ~Spy(); |
| 34 | 32 |
| 35 private: | 33 private: |
| 36 scoped_refptr<SpyServerImpl> spy_server_; | 34 // This thread runs the code that talks to the frontend. |
| 37 // This thread runs the code that talks to the frontend. | 35 scoped_ptr<base::Thread> control_thread_; |
| 38 scoped_ptr<base::Thread> control_thread_; | |
| 39 }; | 36 }; |
| 40 | 37 |
| 41 } // namespace mojo | 38 } // namespace mojo |
| 42 | 39 |
| 43 #endif // MOJO_SPY_SPY_H_ | 40 #endif // MOJO_SPY_SPY_H_ |
| OLD | NEW |