| Index: content/browser/renderer_host/p2p_socket_host.h
|
| diff --git a/content/browser/renderer_host/p2p_socket_host.h b/content/browser/renderer_host/p2p_socket_host.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..8692888292d5483fb5e79a5ddb8eb19230874788
|
| --- /dev/null
|
| +++ b/content/browser/renderer_host/p2p_socket_host.h
|
| @@ -0,0 +1,39 @@
|
| +// 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 CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
|
| +#define CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
|
| +
|
| +#include "content/common/p2p_sockets.h"
|
| +
|
| +class P2PSocketsHost;
|
| +
|
| +// Base class for P2P sockets used by P2PSocketsHost.
|
| +class P2PSocketHost {
|
| + public:
|
| + // Creates P2PSocketHost for the current platform. Must be
|
| + // implemented in a platform-specific file.
|
| + static P2PSocketHost* Create(P2PSocketsHost* host, int routing_id, int id,
|
| + P2PSocketType type);
|
| +
|
| + virtual ~P2PSocketHost();
|
| +
|
| + // Initalizes the socket. Returns false when initiazations fails.
|
| + virtual bool Init() = 0;
|
| +
|
| + // Sends |data| on the socket to |socket_address|.
|
| + virtual void Send(P2PSocketAddress socket_address,
|
| + const std::vector<char>& data) = 0;
|
| +
|
| + protected:
|
| + P2PSocketHost(P2PSocketsHost* host, int routing_id, int id);
|
| +
|
| + P2PSocketsHost* host_;
|
| + int routing_id_;
|
| + int id_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(P2PSocketHost);
|
| +};
|
| +
|
| +#endif // CONTENT_BROWSER_RENDERER_HOST_P2P_SOCKET_HOST_H_
|
|
|