summaryrefslogtreecommitdiffstats
path: root/mojo
diff options
context:
space:
mode:
authorvasilii@chromium.org <vasilii@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-23 10:06:29 +0000
committervasilii@chromium.org <vasilii@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-23 10:06:29 +0000
commit2f1ac4631f06ef7455aa09cb8a80f5705042bb19 (patch)
tree6f98d50f0a16b71525f5ed8a7dbe1274a7c89edc /mojo
parent48ff2c7f5748aa73208040eb95ad88834fd3c474 (diff)
downloadchromium_src-2f1ac4631f06ef7455aa09cb8a80f5705042bb19.zip
chromium_src-2f1ac4631f06ef7455aa09cb8a80f5705042bb19.tar.gz
chromium_src-2f1ac4631f06ef7455aa09cb8a80f5705042bb19.tar.bz2
Revert 272458 "Adding more guts to the mojo spy."
Compilation on Mac Builder (dbg) FAILED: /Volumes/data/b/build/goma/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/mojo/spy/mojo_spy.websocket_server.o.d -DV8_DEPRECATION_WARNINGS -DBLINK_SCALE_FILTERS_AT_RECORD_TIME -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=206824 -DCOMPONENT_BUILD -DUSE_LIBJPEG_TURBO=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_REMOTING=1 -DENABLE_WEBRTC=1 -DENABLE_PEPPER_CDMS -DENABLE_CONFIGURATION_POLICY -DENABLE_NOTIFICATIONS -DENABLE_HIDPI=1 -DDISCARDABLE_MEMORY_ALWAYS_SUPPORTED_NATIVELY -DSYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE -DENABLE_EGLIMAGE=1 -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_BACKGROUND=1 -DENABLE_GOOGLE_NOW=1 -DCLD_VERSION=2 -DENABLE_FULL_PRINTING=1 -DENABLE_PRINTING=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_MANAGED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_WIFI_BOOTSTRAPPING=1 -DMOJO_USE_SYSTEM_IMPL -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -I../.. -Igen -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -O0 -gdwarf-2 -fvisibility=hidden -Werror -Wnewline-eof -mmacosx-version-min=10.6 -arch i386 -Wall -Wendif-labels -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wheader-hygiene -Wno-c++11-narrowing -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-deprecated-register -Wno-selector-type-mismatch -std=gnu++11 -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -fno-threadsafe-statics -Xclang -load -Xclang /Volumes/data/b/build/slave/Mac_Builder__dbg_/build/src/tools/clang/scripts/../../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -fcolor-diagnostics -fno-strict-aliasing -fstack-protector-all -c ../../mojo/spy/websocket_server.cc -o obj/mojo/spy/mojo_spy.websocket_server.o ../../mojo/spy/websocket_server.cc:30:16:error: no member named 'SetClient' in 'mojo::spy_api::SpyServer' spy_server_->SetClient(this); ~~~~~~~~~~~ ^ > Adding more guts to the mojo spy. > > This CL fleshes out the basic architecture of the spy. Introducing SpyServerImpl and enough code to operate the "start" and "stop" commands of the front-end. > > Still a quite a few loose ends, specially on teardown. > > I updated the design doc to reflect this CL: > https://docs.google.com/a/chromium.org/document/d/11FKYXf9mSohlsgl4JmGlyWE1ScX3DKdssdjub63tkwA/edit?usp=sharing > > > BUG=360188 > TEST=manual via test/spy_repl_test.html > > Review URL: https://codereview.chromium.org/284743002 TBR=cpu@chromium.org Review URL: https://codereview.chromium.org/296453021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272463 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'mojo')
-rw-r--r--mojo/mojo.gyp7
-rw-r--r--mojo/spy/public/spy.mojom50
-rw-r--r--mojo/spy/spy.cc65
-rw-r--r--mojo/spy/spy.h9
-rw-r--r--mojo/spy/spy_server_impl.cc96
-rw-r--r--mojo/spy/spy_server_impl.h59
-rw-r--r--mojo/spy/websocket_server.cc75
-rw-r--r--mojo/spy/websocket_server.h28
8 files changed, 44 insertions, 345 deletions
diff --git a/mojo/mojo.gyp b/mojo/mojo.gyp
index a07e3a7..3893b6b 100644
--- a/mojo/mojo.gyp
+++ b/mojo/mojo.gyp
@@ -448,16 +448,9 @@
'../url/url.gyp:url_lib',
'mojo_service_manager',
],
- 'variables': {
- 'mojom_base_output_dir': 'mojo',
- },
- 'includes': [ 'public/tools/bindings/mojom_bindings_generator.gypi' ],
'sources': [
- 'spy/public/spy.mojom',
'spy/spy.cc',
'spy/spy.h',
- 'spy/spy_server_impl.h',
- 'spy/spy_server_impl.cc',
'spy/websocket_server.cc',
'spy/websocket_server.h',
],
diff --git a/mojo/spy/public/spy.mojom b/mojo/spy/public/spy.mojom
deleted file mode 100644
index 1217d58..0000000
--- a/mojo/spy/public/spy.mojom
+++ /dev/null
@@ -1,50 +0,0 @@
-// 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.
-
-module mojo.spy_api {
-
-enum Result {
- ALL_OK,
- INTERNAL_ERROR,
- INVALID_ID,
- NO_MORE_IDS,
- INVALID_CALL,
- INVALID_PARAMS,
- BAD_STATE,
- RESOURCE_LIMIT
-};
-
-struct Version {
- uint32 major;
- uint32 minor;
-};
-
-enum ConnectionOptions {
- SKIP,
- PAUSE,
- RESUME,
- PEEK_MESSAGES
-};
-
-struct Message {
- uint32 id;
- uint32 time;
- uint8[] data;
-};
-
-[Client=SpyClient]
-interface SpyServer {
- StartSession(Version version) => (Result result, string name);
- StopSession() => (Result result);
- TrackConnection(uint32 id, ConnectionOptions options) => (Result result);
-};
-
-interface SpyClient {
- OnFatalError(Result result);
- OnSessionEnd(Result result);
- OnClientConnection(string name, uint32 id, ConnectionOptions options);
- OnMessage(Message message);
-};
-
-}
diff --git a/mojo/spy/spy.cc b/mojo/spy/spy.cc
index c861bbb..eb20c5d 100644
--- a/mojo/spy/spy.cc
+++ b/mojo/spy/spy.cc
@@ -4,13 +4,10 @@
#include "mojo/spy/spy.h"
-#include <vector>
-
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
-#include "base/message_loop/message_loop_proxy.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/threading/thread.h"
@@ -18,10 +15,7 @@
#include "mojo/public/cpp/system/core.h"
#include "mojo/service_manager/service_manager.h"
-#include "mojo/spy/public/spy.mojom.h"
-#include "mojo/spy/spy_server_impl.h"
#include "mojo/spy/websocket_server.h"
-#include "url/gurl.h"
namespace {
@@ -39,9 +33,11 @@ void CloseHandles(MojoHandle* handles, size_t count) {
class MessageProcessor :
public base::RefCountedThreadSafe<MessageProcessor> {
public:
+
MessageProcessor()
: last_result_(MOJO_RESULT_OK),
bytes_transfered_(0) {
+
message_count_[0] = 0;
message_count_[1] = 0;
handle_count_[0] = 0;
@@ -111,30 +107,24 @@ class MessageProcessor :
}
private:
- friend class base::RefCountedThreadSafe<MessageProcessor>;
- virtual ~MessageProcessor() {}
-
- bool CheckResult(MojoResult mr) {
- if (mr == MOJO_RESULT_OK)
- return true;
- last_result_ = mr;
- return false;
- }
-
- MojoResult last_result_;
- uint32_t bytes_transfered_;
- uint32_t message_count_[2];
- uint32_t handle_count_[2];
+ friend class base::RefCountedThreadSafe<MessageProcessor>;
+ virtual ~MessageProcessor() {}
+
+ bool CheckResult(MojoResult mr) {
+ if (mr == MOJO_RESULT_OK)
+ return true;
+ last_result_ = mr;
+ return false;
+ }
+
+ MojoResult last_result_;
+ uint32_t bytes_transfered_;
+ uint32_t message_count_[2];
+ uint32_t handle_count_[2];
};
// In charge of intercepting access to the service manager.
class SpyInterceptor : public mojo::ServiceManager::Interceptor {
- public:
- explicit SpyInterceptor(scoped_refptr<mojo::SpyServerImpl> spy_server)
- : spy_server_(spy_server),
- proxy_(base::MessageLoopProxy::current()) {
- }
-
private:
virtual mojo::ScopedMessagePipeHandle OnConnectToClient(
const GURL& url, mojo::ScopedMessagePipeHandle real_client) OVERRIDE {
@@ -163,21 +153,15 @@ class SpyInterceptor : public mojo::ServiceManager::Interceptor {
bool MustIntercept(const GURL& url) {
// TODO(cpu): manage who and when to intercept.
- proxy_->PostTask(
- FROM_HERE,
- base::Bind(&mojo::SpyServerImpl::OnIntercept, spy_server_, url));
return true;
}
-
- scoped_refptr<mojo::SpyServerImpl> spy_server_;
- scoped_refptr<base::MessageLoopProxy> proxy_;
};
-mojo::WebSocketServer* ws_server = NULL;
+spy::WebSocketServer* ws_server = NULL;
-void StartWebServer(int port, mojo::ScopedMessagePipeHandle pipe) {
+void StartServer(int port) {
// TODO(cpu) figure out lifetime of the server. See Spy() dtor.
- ws_server = new mojo::WebSocketServer(port, pipe.Pass());
+ ws_server = new spy::WebSocketServer(port);
ws_server->Start();
}
@@ -212,23 +196,18 @@ namespace mojo {
Spy::Spy(mojo::ServiceManager* service_manager, const std::string& options) {
SpyOptions spy_options = ProcessOptions(options);
-
- spy_server_ = new SpyServerImpl();
-
// Start the tread what will accept commands from the frontend.
control_thread_.reset(new base::Thread("mojo_spy_control_thread"));
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
control_thread_->StartWithOptions(thread_options);
control_thread_->message_loop_proxy()->PostTask(
- FROM_HERE, base::Bind(&StartWebServer,
- spy_options.websocket_port,
- base::Passed(spy_server_->ServerPipe())));
+ FROM_HERE, base::Bind(&StartServer, spy_options.websocket_port));
// Start intercepting mojo services.
- service_manager->SetInterceptor(new SpyInterceptor(spy_server_));
+ service_manager->SetInterceptor(new SpyInterceptor());
}
-Spy::~Spy() {
+Spy::~Spy(){
// TODO(cpu): Do not leak the interceptor. Lifetime between the
// service_manager and the spy is still unclear hence the leak.
}
diff --git a/mojo/spy/spy.h b/mojo/spy/spy.h
index 020167f..c3673f4 100644
--- a/mojo/spy/spy.h
+++ b/mojo/spy/spy.h
@@ -6,17 +6,15 @@
#define MOJO_SPY_SPY_H_
#include <string>
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
namespace base {
-class Thread;
+ class Thread;
}
namespace mojo {
class ServiceManager;
-class SpyServerImpl;
// mojo::Spy is a troubleshooting and debugging aid. It helps tracking
// the mojo system core activities like messages, service creation, etc.
@@ -33,9 +31,8 @@ class Spy {
~Spy();
private:
- scoped_refptr<SpyServerImpl> spy_server_;
- // This thread runs the code that talks to the frontend.
- scoped_ptr<base::Thread> control_thread_;
+ // This thread runs the code that talks to the frontend.
+ scoped_ptr<base::Thread> control_thread_;
};
} // namespace mojo
diff --git a/mojo/spy/spy_server_impl.cc b/mojo/spy/spy_server_impl.cc
deleted file mode 100644
index 7fbce51..0000000
--- a/mojo/spy/spy_server_impl.cc
+++ /dev/null
@@ -1,96 +0,0 @@
-// 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.
-
-#include "mojo/spy/spy_server_impl.h"
-
-#include "mojo/public/cpp/bindings/allocation_scope.h"
-#include "mojo/public/cpp/system/core.h"
-
-namespace {
-
-bool NextId(uint32_t* out_id) {
- static uint32_t id = 1;
- if (!++id)
- return false;
- *out_id = id;
- return true;
-}
-
-} // namespace
-
-namespace mojo {
-
-struct SpyServerImpl::Item {
- enum Type {
- kServiceIntercept,
- kMessage
- };
-
- uint32_t id;
- Type type;
-
- Item(uint32_t id, Type type) : id(id), type(type) {}
-};
-
-SpyServerImpl::SpyServerImpl() : has_session_(false) {
- BindToPipe(this, pipe_.handle0.Pass());
-}
-
-SpyServerImpl::~SpyServerImpl() {
-}
-
-void SpyServerImpl::StartSession(
- const spy_api::Version& version,
- const mojo::Callback<void(spy_api::Result, mojo::String)>& callback) {
- AllocationScope scope;
- if (has_session_) {
- callback.Run(spy_api::RESOURCE_LIMIT, "");
- return;
- }
- callback.Run(spy_api::ALL_OK, "session 0");
- has_session_ = true;
-}
-
-void SpyServerImpl::StopSession(
- const mojo::Callback<void(spy_api::Result)>& callback) {
- AllocationScope scope;
- if (!has_session_) {
- callback.Run(spy_api::INVALID_CALL);
- return;
- }
- callback.Run(spy_api::ALL_OK);
- has_session_ = false;
-}
-
-void SpyServerImpl::TrackConnection(
- uint32_t id,
- spy_api::ConnectionOptions options,
- const mojo::Callback<void(spy_api::Result)>& callback) {
-}
-
-void SpyServerImpl::OnConnectionError() {
- // Pipe got disconnected.
-}
-
-void SpyServerImpl::OnIntercept(const GURL& url) {
- if (!has_session_)
- return;
-
- AllocationScope scope;
- uint32_t id;
- if (!NextId(&id)) {
- client()->OnFatalError(spy_api::NO_MORE_IDS);
- return;
- }
-
- items_[id] = new Item(id, Item::kServiceIntercept);
- client()->OnClientConnection(
- url.possibly_invalid_spec(), id, spy_api::PEEK_MESSAGES);
-}
-
-ScopedMessagePipeHandle SpyServerImpl::ServerPipe() {
- return ScopedMessagePipeHandle(pipe_.handle1.Pass()).Pass();
-}
-
-} // namespace mojo
diff --git a/mojo/spy/spy_server_impl.h b/mojo/spy/spy_server_impl.h
deleted file mode 100644
index b7d3f57..0000000
--- a/mojo/spy/spy_server_impl.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// 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(const GURL& url);
-
- ScopedMessagePipeHandle ServerPipe();
-
- private:
- friend class base::RefCounted<SpyServerImpl>;
- virtual ~SpyServerImpl();
-
- // Item models the entities that we track by IDs.
- struct Item;
-
- MessagePipe pipe_;
- bool has_session_;
- std::map<uint32_t, Item*> items_;
-};
-
-} // namespace mojo
-
-#endif // MOJO_SPY_SPY_SERVER_IMPL_H_
diff --git a/mojo/spy/websocket_server.cc b/mojo/spy/websocket_server.cc
index 15a0c4e..649a135 100644
--- a/mojo/spy/websocket_server.cc
+++ b/mojo/spy/websocket_server.cc
@@ -4,30 +4,20 @@
#include "mojo/spy/websocket_server.h"
-#include <string>
-
#include "base/bind.h"
#include "base/strings/stringprintf.h"
-
-#include "mojo/public/cpp/bindings/allocation_scope.h"
-#include "mojo/public/cpp/bindings/message.h"
-
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/server/http_server_request_info.h"
#include "net/server/http_server_response_info.h"
#include "net/socket/tcp_listen_socket.h"
-namespace mojo {
+namespace spy {
const int kNotConnected = -1;
-WebSocketServer::WebSocketServer(int port,
- mojo::ScopedMessagePipeHandle server_pipe)
- : port_(port),
- connection_id_(kNotConnected),
- spy_server_(MakeProxy<spy_api::SpyServer>(server_pipe.Pass())) {
- spy_server_->SetClient(this);
+WebSocketServer::WebSocketServer(int port)
+ : port_(port), connection_id_(kNotConnected) {
}
WebSocketServer::~WebSocketServer() {
@@ -35,9 +25,9 @@ WebSocketServer::~WebSocketServer() {
bool WebSocketServer::Start() {
net::TCPListenSocketFactory factory("0.0.0.0", port_);
- web_server_ = new net::HttpServer(factory, this);
+ server_ = new net::HttpServer(factory, this);
net::IPEndPoint address;
- int error = web_server_->GetLocalAddress(&address);
+ int error = server_->GetLocalAddress(&address);
port_ = address.port();
return (error == net::OK);
}
@@ -45,7 +35,7 @@ bool WebSocketServer::Start() {
void WebSocketServer::OnHttpRequest(
int connection_id,
const net::HttpServerRequestInfo& info) {
- web_server_->Send500(connection_id, "websockets protocol only");
+ server_->Send500(connection_id, "websockets protocol only");
}
void WebSocketServer::OnWebSocketRequest(
@@ -55,63 +45,26 @@ void WebSocketServer::OnWebSocketRequest(
// Reject connection since we already have our client.
base::MessageLoop::current()->PostTask(
FROM_HERE,
- base::Bind(&net::HttpServer::Close, web_server_, connection_id));
+ base::Bind(&net::HttpServer::Close, server_, connection_id));
return;
}
// Accept the connection.
- web_server_->AcceptWebSocket(connection_id, info);
+ server_->AcceptWebSocket(connection_id, info);
connection_id_ = connection_id;
}
void WebSocketServer::OnWebSocketMessage(
int connection_id,
const std::string& data) {
- AllocationScope scope;
- if (data == "\"start\"") {
- spy_api::Version::Builder vb;
- vb.set_major(0);
- vb.set_minor(1);
- spy_server_->StartSession(
- vb.Finish(),
- base::Bind(&WebSocketServer::OnStartSession, base::Unretained(this)));
- } else if (data == "\"stop\"") {
- spy_server_->StopSession(
- base::Bind(&WebSocketServer::OnSessionEnd, base::Unretained(this)));
- }
-}
-
-void WebSocketServer::OnFatalError(spy_api::Result result) {
- web_server_->SendOverWebSocket(connection_id_, "\"fatal error\"");
+ // TODO(cpu): remove this test code soon.
+ if (data == "\"hello\"")
+ server_->SendOverWebSocket(connection_id, "\"hi there!\"");
}
void WebSocketServer::OnClose(
int connection_id) {
- if (connection_id != connection_id_)
- return;
- connection_id_ = kNotConnected;
- AllocationScope scope;
- spy_server_->StopSession(
- base::Bind(&WebSocketServer::OnSessionEnd, base::Unretained(this)));
-}
-
-void WebSocketServer::OnSessionEnd(spy_api::Result result) {
- // Called when the spy session (not the websocket) ends.
-}
-
-void WebSocketServer::OnClientConnection(
- const mojo::String& name,
- uint32_t id,
- spy_api::ConnectionOptions options) {
- std::string cc("\"");
- cc += name.To<std::string>() + "\"";
- web_server_->SendOverWebSocket(connection_id_, cc);
-}
-
-void WebSocketServer::OnMessage(const spy_api::Message& message) {
-}
-
-void WebSocketServer::OnStartSession(spy_api::Result, mojo::String) {
- web_server_->SendOverWebSocket(connection_id_, "\"ok start\"");
+ if (connection_id == connection_id_)
+ connection_id_ = kNotConnected;
}
-} // namespace mojo
+} // namespace spy
diff --git a/mojo/spy/websocket_server.h b/mojo/spy/websocket_server.h
index a4d12cb..84830b8 100644
--- a/mojo/spy/websocket_server.h
+++ b/mojo/spy/websocket_server.h
@@ -5,18 +5,14 @@
#ifndef MOJO_SPY_WEBSOCKET_SERVER_H_
#define MOJO_SPY_WEBSOCKET_SERVER_H_
-#include <string>
-
-#include "mojo/spy/public/spy.mojom.h"
#include "net/server/http_server.h"
-namespace mojo {
+namespace spy {
-class WebSocketServer : public net::HttpServer::Delegate,
- public spy_api::SpyClient {
+class WebSocketServer : public net::HttpServer::Delegate {
public:
// Pass 0 in |port| to listen in one available port.
- explicit WebSocketServer(int port, ScopedMessagePipeHandle server_pipe);
+ explicit WebSocketServer(int port);
virtual ~WebSocketServer();
// Begin accepting HTTP requests. Must be called from an IO MessageLoop.
bool Start();
@@ -36,27 +32,13 @@ class WebSocketServer : public net::HttpServer::Delegate,
const std::string& data) OVERRIDE;
virtual void OnClose(int connection_id) OVERRIDE;
- // Overriden form spy_api::SpyClient.
- virtual void OnFatalError(spy_api::Result result) OVERRIDE;
- virtual void OnSessionEnd(spy_api::Result result) OVERRIDE;
- virtual void OnClientConnection(
- const mojo::String& name,
- uint32_t id,
- spy_api::ConnectionOptions options) OVERRIDE;
- virtual void OnMessage(const spy_api::Message& message) OVERRIDE;
-
- // Callbacks from calling spy_api::SpyServer.
- void OnStartSession(spy_api::Result, mojo::String);
-
private:
int port_;
int connection_id_;
- scoped_refptr<net::HttpServer> web_server_;
- spy_api::SpyServerPtr spy_server_;
-
+ scoped_refptr<net::HttpServer> server_;
DISALLOW_COPY_AND_ASSIGN(WebSocketServer);
};
-} // namespace mojo
+} // namespace spy
#endif // MOJO_SPY_WEBSOCKET_SERVER_H_