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

Side by Side Diff: content/browser/renderer_host/pepper/content_browser_pepper_host_factory.h

Issue 24195004: PPB_TCPSocket: add support for TCP server socket operations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_ 5 #ifndef CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
6 #define CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_ 6 #define CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "net/socket/tcp_socket.h"
bbudge 2013/09/17 19:42:18 Could you forward declare net::TCPSocket?
yzshen1 2013/09/18 16:56:26 I tried but it wasn't allowed. net::TCPSocket is a
11 #include "ppapi/host/host_factory.h" 12 #include "ppapi/host/host_factory.h"
12 13 #include "ppapi/shared_impl/ppb_tcp_socket_shared.h"
13 namespace net {
14 class StreamSocket;
15 }
16 14
17 namespace ppapi { 15 namespace ppapi {
18 class PpapiPermissions; 16 class PpapiPermissions;
19 } 17 }
20 18
21 namespace content { 19 namespace content {
22 20
23 class BrowserPpapiHostImpl; 21 class BrowserPpapiHostImpl;
24 22
25 class ContentBrowserPepperHostFactory : public ppapi::host::HostFactory { 23 class ContentBrowserPepperHostFactory : public ppapi::host::HostFactory {
26 public: 24 public:
27 // Non-owning pointer to the filter must outlive this class. 25 // Non-owning pointer to the filter must outlive this class.
28 explicit ContentBrowserPepperHostFactory(BrowserPpapiHostImpl* host); 26 explicit ContentBrowserPepperHostFactory(BrowserPpapiHostImpl* host);
29 27
30 virtual ~ContentBrowserPepperHostFactory(); 28 virtual ~ContentBrowserPepperHostFactory();
31 29
32 virtual scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost( 30 virtual scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost(
33 ppapi::host::PpapiHost* host, 31 ppapi::host::PpapiHost* host,
34 const ppapi::proxy::ResourceMessageCallParams& params, 32 const ppapi::proxy::ResourceMessageCallParams& params,
35 PP_Instance instance, 33 PP_Instance instance,
36 const IPC::Message& message) OVERRIDE; 34 const IPC::Message& message) OVERRIDE;
37 35
38 // Creates ResourceHost for already accepted TCP |socket|. Takes 36 // Creates ResourceHost for already accepted TCP |socket|. In the case of
39 // ownership of the |socket|. In the case of failure returns wrapped 37 // failure returns wrapped NULL.
40 // NULL.
41 scoped_ptr<ppapi::host::ResourceHost> CreateAcceptedTCPSocket( 38 scoped_ptr<ppapi::host::ResourceHost> CreateAcceptedTCPSocket(
42 PP_Instance instance, 39 PP_Instance instance,
43 bool private_api, 40 ppapi::TCPSocketVersion version,
44 net::StreamSocket* socket); 41 scoped_ptr<net::TCPSocket> socket);
45 42
46 private: 43 private:
47 const ppapi::PpapiPermissions& GetPermissions() const; 44 const ppapi::PpapiPermissions& GetPermissions() const;
48 45
49 // Non-owning pointer. 46 // Non-owning pointer.
50 BrowserPpapiHostImpl* host_; 47 BrowserPpapiHostImpl* host_;
51 48
52 DISALLOW_COPY_AND_ASSIGN(ContentBrowserPepperHostFactory); 49 DISALLOW_COPY_AND_ASSIGN(ContentBrowserPepperHostFactory);
53 }; 50 };
54 51
55 } // namespace content 52 } // namespace content
56 53
57 #endif // CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_ 54 #endif // CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698