Chromium Code Reviews| OLD | NEW |
|---|---|
| 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" | |
| 12 #include "ppapi/c/pp_resource.h" | |
| 11 #include "ppapi/host/host_factory.h" | 13 #include "ppapi/host/host_factory.h" |
| 12 | 14 #include "ppapi/shared_impl/ppb_tcp_socket_shared.h" |
| 13 namespace net { | |
| 14 class StreamSocket; | |
| 15 } | |
| 16 | 15 |
| 17 namespace ppapi { | 16 namespace ppapi { |
| 18 class PpapiPermissions; | 17 class PpapiPermissions; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace content { | 20 namespace content { |
| 22 | 21 |
| 23 class BrowserPpapiHostImpl; | 22 class BrowserPpapiHostImpl; |
| 24 | 23 |
| 25 class ContentBrowserPepperHostFactory : public ppapi::host::HostFactory { | 24 class ContentBrowserPepperHostFactory : public ppapi::host::HostFactory { |
| 26 public: | 25 public: |
| 27 // Non-owning pointer to the filter must outlive this class. | 26 // Non-owning pointer to the filter must outlive this class. |
| 28 explicit ContentBrowserPepperHostFactory(BrowserPpapiHostImpl* host); | 27 explicit ContentBrowserPepperHostFactory(BrowserPpapiHostImpl* host); |
| 29 | 28 |
| 30 virtual ~ContentBrowserPepperHostFactory(); | 29 virtual ~ContentBrowserPepperHostFactory(); |
| 31 | 30 |
| 32 virtual scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost( | 31 virtual scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost( |
| 33 ppapi::host::PpapiHost* host, | 32 ppapi::host::PpapiHost* host, |
| 34 const ppapi::proxy::ResourceMessageCallParams& params, | 33 const ppapi::proxy::ResourceMessageCallParams& params, |
| 35 PP_Instance instance, | 34 PP_Instance instance, |
| 36 const IPC::Message& message) OVERRIDE; | 35 const IPC::Message& message) OVERRIDE; |
| 37 | 36 |
| 38 // Creates ResourceHost for already accepted TCP |socket|. Takes | 37 // Creates ResourceHost for already accepted TCP |socket|. In the case of |
| 39 // ownership of the |socket|. In the case of failure returns wrapped | 38 // failure returns wrapped NULL. |
| 40 // NULL. | |
| 41 scoped_ptr<ppapi::host::ResourceHost> CreateAcceptedTCPSocket( | 39 scoped_ptr<ppapi::host::ResourceHost> CreateAcceptedTCPSocket( |
| 42 PP_Instance instance, | 40 PP_Instance instance, |
| 43 bool private_api, | 41 ppapi::TCPSocketVersion version, |
| 44 net::StreamSocket* socket); | 42 scoped_ptr<net::TCPSocket> socket); |
| 45 | 43 |
| 46 private: | 44 private: |
| 45 scoped_ptr<ppapi::host::ResourceHost> CreateNewTCPSocket( | |
|
bbudge
2013/09/19 19:41:47
Indent is off by 1.
yzshen1
2013/09/19 21:12:15
Done.
| |
| 46 PP_Instance instance, | |
| 47 PP_Resource resource, | |
| 48 ppapi::TCPSocketVersion version); | |
| 49 | |
| 47 const ppapi::PpapiPermissions& GetPermissions() const; | 50 const ppapi::PpapiPermissions& GetPermissions() const; |
| 48 | 51 |
| 49 // Non-owning pointer. | 52 // Non-owning pointer. |
| 50 BrowserPpapiHostImpl* host_; | 53 BrowserPpapiHostImpl* host_; |
| 51 | 54 |
| 52 DISALLOW_COPY_AND_ASSIGN(ContentBrowserPepperHostFactory); | 55 DISALLOW_COPY_AND_ASSIGN(ContentBrowserPepperHostFactory); |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 } // namespace content | 58 } // namespace content |
| 56 | 59 |
| 57 #endif // CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_ | 60 #endif // CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_ |
| OLD | NEW |