Chromium Code Reviews| Index: remoting/host/host_status_service.h |
| diff --git a/remoting/host/host_status_service.h b/remoting/host/host_status_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e7c7ad1e31cabf77959a1579f702592b279b3831 |
| --- /dev/null |
| +++ b/remoting/host/host_status_service.h |
| @@ -0,0 +1,51 @@ |
| +// Copyright (c) 2012 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 REMOTING_HOST_HOST_STATUS_SERVICE_H_ |
| +#define REMOTING_HOST_HOST_STATUS_SERVICE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "remoting/host/websocket_listener.h" |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} // namespace remoting |
| + |
| +namespace remoting { |
| + |
| +class HostStatusService { |
|
alexeypa (please no reviews)
2012/11/15 19:45:56
nit: Add a comment explaining what is this class f
Sergey Ulanov
2012/11/16 00:52:10
Done.
|
| + public: |
| + HostStatusService(); |
| + ~HostStatusService(); |
| + |
| + void SetState(bool started, const std::string& host_id); |
|
alexeypa (please no reviews)
2012/11/15 19:45:56
nit: Add a comment explaining what this method doe
Wez
2012/11/15 23:34:59
nit: I think it's cleaner to have two separate set
Sergey Ulanov
2012/11/16 00:52:10
Done.
Sergey Ulanov
2012/11/16 00:52:10
Done.
|
| + |
| + private: |
| + class Connection; |
|
Wez
2012/11/15 23:34:59
We seem to be re-inventing the socket-server wheel
Sergey Ulanov
2012/11/16 00:52:10
I'm not sure what you mean. We need to allow multi
|
| + friend class Connection; |
| + |
| + bool IsAllowedOrigin(const std::string& origin); |
|
alexeypa (please no reviews)
2012/11/15 19:45:56
nit: Add a comment explaining what this method doe
Sergey Ulanov
2012/11/16 00:52:10
Added, but I think the name of the method is descr
Wez
2012/11/20 05:55:53
What I meant was a comment like "Returns true if |
Sergey Ulanov
2012/11/22 00:29:35
Done.
|
| + |
| + // Callback for WebsocketListener. |
| + void OnNewConnection(scoped_ptr<WebsocketConnection> connection); |
| + |
| + // Called from Connection instances. |
| + void OnConnectionClosed(Connection* connection); |
| + scoped_ptr<base::DictionaryValue> GetStatusMessage(); |
|
alexeypa (please no reviews)
2012/11/15 19:45:56
nit: Add a comment explaining what this method doe
Wez
2012/11/15 23:34:59
And similarly the comments for OnFoo should descri
Sergey Ulanov
2012/11/16 00:52:10
Done.
Sergey Ulanov
2012/11/16 00:52:10
Done.
|
| + |
| + WebsocketListener websocket_listener_; |
|
alexeypa (please no reviews)
2012/11/15 19:45:56
nit: Add comments explaining what these member var
Sergey Ulanov
2012/11/16 00:52:10
The purpose of |websocket_listener_| and |connecti
|
| + std::string host_name_; |
|
Wez
2012/11/15 23:34:59
nit: Add a comment explaining what this is used fo
Sergey Ulanov
2012/11/16 00:52:10
Done. Renamed to service_host_name_
|
| + std::set<Connection*> connections_; |
| + |
| + bool started_; |
| + std::string host_id_; |
|
Wez
2012/11/15 23:34:59
nit: Add a comment e.g. "State values to provide t
Sergey Ulanov
2012/11/16 00:52:10
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(HostStatusService); |
| +}; |
| + |
| +} // namespace remoting |
| + |
| +#endif // REMOTING_HOST_HOST_STATUS_SERVICE_H_ |