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

Unified Diff: mojo/spy/spy.h

Issue 648573002: remove websocket server dependency from the mojo spy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small cleanup Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/shell/context.cc ('k') | mojo/spy/spy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/spy/spy.h
diff --git a/mojo/spy/spy.h b/mojo/spy/spy.h
index f2b6be9100c9ead0a292eca6e9166d4267d062dc..862630892b3203f229055a0cbf4658b8008c7232 100644
--- a/mojo/spy/spy.h
+++ b/mojo/spy/spy.h
@@ -8,8 +8,12 @@
#include <string>
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
+#include "mojo/public/cpp/system/message_pipe.h"
+#include "mojo/spy/common.h"
+#include "url/gurl.h"
namespace base {
+class Time;
class Thread;
}
@@ -17,6 +21,7 @@ namespace mojo {
class ApplicationManager;
class SpyServerImpl;
+struct SpyOptions;
// mojo::Spy is a troubleshooting and debugging aid. It helps tracking
// the mojo system core activities like messages, service creation, etc.
@@ -29,14 +34,30 @@ class SpyServerImpl;
//
class Spy {
public:
+ // Interface for the shell-provided websocket server.
+ class WebSocketDelegate {
+ public:
+ virtual void Start(int port, mojo::ScopedMessagePipeHandle server_pipe) = 0;
+ virtual void OnMessage(mojo::MojoMessageData* data,
+ const GURL& url,
+ const base::Time& time) = 0;
+ };
+
Spy(mojo::ApplicationManager* application_manager,
const std::string& options);
~Spy();
+ // non-owning reference to the websocket server.
+ void SetWebSocketDelegate(WebSocketDelegate* websocket_delegate);
+
private:
scoped_refptr<SpyServerImpl> spy_server_;
// This thread runs the code that talks to the frontend.
scoped_ptr<base::Thread> control_thread_;
+ // The delegate is in charge of talking to the html frontend.
+ WebSocketDelegate* websocket_delegate_;
+ ApplicationManager* application_manager_;
+ SpyOptions* spy_options_;
};
} // namespace mojo
« no previous file with comments | « mojo/shell/context.cc ('k') | mojo/spy/spy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698