Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: mojo/spy/spy_server_impl.h

Issue 284743002: Adding a mojo interface to the mojo spy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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_SERVER_IMPL_H_
6 #define MOJO_SPY_SPY_SERVER_IMPL_H_
7
8 #include <map>
9
10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h"
12 #include "mojo/public/cpp/system/core.h"
13 #include "mojo/spy/public/spy.mojom.h"
14 #include "url/gurl.h"
15
16 namespace mojo {
17
18 class SpyServerImpl :
19 public base::RefCounted<SpyServerImpl>,
20 public InterfaceImpl<spy_api::SpyServer> {
21 public:
22 SpyServerImpl();
23
24 // spy_api::SpyServer implementation.
25 virtual void StartSession(
26 const spy_api::Version& version,
27 const mojo::Callback<void(spy_api::Result,
28 mojo::String)>& callback) OVERRIDE;
29
30 virtual void StopSession(
31 const mojo::Callback<void(spy_api::Result)>& callback) OVERRIDE;
32
33 virtual void TrackConnection(
34 uint32_t id,
35 spy_api::ConnectionOptions options,
36 const mojo::Callback<void(spy_api::Result)>& callback) OVERRIDE;
37
38 virtual void OnConnectionError() OVERRIDE;
39
40 // SpyServerImpl own methods.
41 void OnIntercept(GURL url);
42
43 ScopedMessagePipeHandle ServerPipe();
44
45 // Iter models the entities that we track by IDs.
46 struct Item;
darin (slow to review) 2014/05/17 02:37:58 nit: does this need to be a public struct?
cpu_(ooo_6.6-7.5) 2014/05/19 20:09:34 Done.
47
48 private:
49 MessagePipe pipe_;
50 bool has_session_;
51 std::map<uint32_t, Item*> items_;
52 };
53
54 } // namespace mojo
55
56 #endif // MOJO_SPY_SPY_SERVER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698