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

Side by Side Diff: content/browser/renderer_host/pepper_tcp_server_socket.h

Issue 9283022: Exposed Listen and Accept methods to plugin. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added Destroy message for initialized but cancelled sockets. Created 8 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h"
11
12 class PepperMessageFilter;
13 struct PP_NetAddress_Private;
14
15 namespace net {
16 class ServerSocket;
17 class StreamSocket;
18 }
19
20 using net::StreamSocket;
yzshen1 2012/02/10 22:40:15 You missed this one.
ygorshenin1 2012/02/13 14:59:46 Done.
21
22 // PepperTCPSocket is used by PepperMessageFilter to handle requests
23 // from the Pepper TCP server socket API
24 // (PPB_TCPServerSocket_Private).
25 class PepperTCPServerSocket {
26 public:
27 PepperTCPServerSocket(PepperMessageFilter* manager,
28 int32 routing_id,
29 uint32 plugin_dispatcher_id,
30 uint32 socket_id);
31 ~PepperTCPServerSocket();
32
33 void Listen(const PP_NetAddress_Private& addr, int32 backlog);
34 void Accept();
35
36 private:
37 enum State {
38 BEFORE_LISTENING,
39 LISTEN_IN_PROGRESS,
40 LISTENING,
41 ACCEPT_IN_PROGRESS,
42 };
43
44 void SendListenACKError();
45 void SendAcceptACKError();
46
47 void OnListenCompleted(int result);
48 void OnAcceptCompleted(int result);
49
50 PepperMessageFilter* manager_;
51 int32 routing_id_;
52 uint32 plugin_dispatcher_id_;
53 uint32 socket_id_;
54
55 State state_;
56
57 scoped_ptr<net::ServerSocket> socket_;
58 scoped_ptr<net::StreamSocket> socket_buffer_;
59
60 DISALLOW_COPY_AND_ASSIGN(PepperTCPServerSocket);
61 };
62
63 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_TCP_SERVER_SOCKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698