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.
5 #ifndef MOJO_SPY_SPY_SERVER_IMPL_H_
6 #define MOJO_SPY_SPY_SERVER_IMPL_H_
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"
19 public base::RefCounted
<SpyServerImpl
>,
20 public InterfaceImpl
<spy_api::SpyServer
> {
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
;
30 virtual void StopSession(
31 const mojo::Callback
<void(spy_api::Result
)>& callback
) OVERRIDE
;
33 virtual void TrackConnection(
35 spy_api::ConnectionOptions options
,
36 const mojo::Callback
<void(spy_api::Result
)>& callback
) OVERRIDE
;
38 virtual void OnConnectionError() OVERRIDE
;
40 // SpyServerImpl own methods.
41 void OnIntercept(const GURL
& url
);
43 ScopedMessagePipeHandle
ServerPipe();
46 friend class base::RefCounted
<SpyServerImpl
>;
47 virtual ~SpyServerImpl();
49 // Item models the entities that we track by IDs.
54 std::map
<uint32_t, Item
*> items_
;
59 #endif // MOJO_SPY_SPY_SERVER_IMPL_H_