diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 19:49:25 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 19:49:25 +0000 |
commit | 86c6a0b5a5c08aa5ed1244e4a4fc2796393ad5a5 (patch) | |
tree | 14d8273e6669c54599466a7708b437cd51facb03 /net/server/web_socket.h | |
parent | 33a4aca7c65ed0bb2636615ef5e5c83cf50ff6a0 (diff) | |
download | chromium_src-86c6a0b5a5c08aa5ed1244e4a4fc2796393ad5a5.zip chromium_src-86c6a0b5a5c08aa5ed1244e4a4fc2796393ad5a5.tar.gz chromium_src-86c6a0b5a5c08aa5ed1244e4a4fc2796393ad5a5.tar.bz2 |
DevTools: no way to remote debug using ToT build as a client.
(rebaselined and brushed up loislo's http://codereview.chromium.org/7482041)
BUG=90743
TEST=
Review URL: http://codereview.chromium.org/7540023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95138 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/server/web_socket.h')
-rw-r--r-- | net/server/web_socket.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/net/server/web_socket.h b/net/server/web_socket.h new file mode 100644 index 0000000..baed07c --- /dev/null +++ b/net/server/web_socket.h @@ -0,0 +1,46 @@ +// Copyright (c) 2011 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 NET_SERVER_WEB_SOCKET_H_ +#define NET_SERVER_WEB_SOCKET_H_ +#pragma once + +#include <string> + +#include "base/basictypes.h" +#include "base/memory/scoped_ptr.h" + +namespace net { + +class HttpConnection; +class HttpServerRequestInfo; + +class WebSocket { + public: + enum ParseResult { + FRAME_OK, + FRAME_INCOMPLETE, + FRAME_ERROR + }; + + static WebSocket* CreateWebSocket(HttpConnection* connection, + const HttpServerRequestInfo& request, + size_t* pos); + + virtual void Accept(const HttpServerRequestInfo& request) = 0; + virtual ParseResult Read(std::string* message) = 0; + virtual void Send(const std::string& message) = 0; + virtual ~WebSocket() {} + + protected: + explicit WebSocket(HttpConnection* connection); + HttpConnection* connection_; + + private: + DISALLOW_COPY_AND_ASSIGN(WebSocket); +}; + +} // namespace net + +#endif // NET_SERVER_WEB_SOCKET_H_ |