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

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

Issue 379753002: Redo: Adding a mojo interface to the mojo spy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: bindings clash fix Created 6 years, 5 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
« no previous file with comments | « mojo/spy/spy.cc ('k') | mojo/spy/spy_server_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 spy_api::VersionPtr 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(const GURL& url);
42
43 ScopedMessagePipeHandle ServerPipe();
44
45 private:
46 friend class base::RefCounted<SpyServerImpl>;
47 virtual ~SpyServerImpl();
48
49 // Item models the entities that we track by IDs.
50 struct Item;
51
52 MessagePipe pipe_;
53 bool has_session_;
54 std::map<uint32_t, Item*> items_;
55 };
56
57 } // namespace mojo
58
59 #endif // MOJO_SPY_SPY_SERVER_IMPL_H_
OLDNEW
« no previous file with comments | « mojo/spy/spy.cc ('k') | mojo/spy/spy_server_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698