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