Chromium Code Reviews| Index: mojo/spy/spy_server_impl.h |
| diff --git a/mojo/spy/spy_server_impl.h b/mojo/spy/spy_server_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..95ecd82e513b9e02ff4d31aa1c8a1ad753665421 |
| --- /dev/null |
| +++ b/mojo/spy/spy_server_impl.h |
| @@ -0,0 +1,56 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MOJO_SPY_SPY_SERVER_IMPL_H_ |
| +#define MOJO_SPY_SPY_SERVER_IMPL_H_ |
| + |
| +#include <map> |
| + |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "mojo/public/cpp/system/core.h" |
| +#include "mojo/spy/public/spy.mojom.h" |
| +#include "url/gurl.h" |
| + |
| +namespace mojo { |
| + |
| +class SpyServerImpl : |
| + public base::RefCounted<SpyServerImpl>, |
| + public InterfaceImpl<spy_api::SpyServer> { |
| + public: |
| + SpyServerImpl(); |
| + |
| + // spy_api::SpyServer implementation. |
| + virtual void StartSession( |
| + const spy_api::Version& version, |
| + const mojo::Callback<void(spy_api::Result, |
| + mojo::String)>& callback) OVERRIDE; |
| + |
| + virtual void StopSession( |
| + const mojo::Callback<void(spy_api::Result)>& callback) OVERRIDE; |
| + |
| + virtual void TrackConnection( |
| + uint32_t id, |
| + spy_api::ConnectionOptions options, |
| + const mojo::Callback<void(spy_api::Result)>& callback) OVERRIDE; |
| + |
| + virtual void OnConnectionError() OVERRIDE; |
| + |
| + // SpyServerImpl own methods. |
| + void OnIntercept(GURL url); |
| + |
| + ScopedMessagePipeHandle ServerPipe(); |
| + |
| + // Iter models the entities that we track by IDs. |
| + 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.
|
| + |
| + private: |
| + MessagePipe pipe_; |
| + bool has_session_; |
| + std::map<uint32_t, Item*> items_; |
| +}; |
| + |
| +} // namespace mojo |
| + |
| +#endif // MOJO_SPY_SPY_SERVER_IMPL_H_ |