[Session restore] Rename group name Enabled to Restore.
[chromium-blink-merge.git] / content / browser / renderer_host / pepper / content_browser_pepper_host_factory.h
blobdffa7fe83db7bd91738d8824746bdbf77f56812d
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.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "net/socket/tcp_socket.h"
12 #include "ppapi/c/pp_resource.h"
13 #include "ppapi/host/host_factory.h"
14 #include "ppapi/shared_impl/ppb_tcp_socket_shared.h"
16 namespace ppapi {
17 class PpapiPermissions;
20 namespace content {
22 class BrowserPpapiHostImpl;
24 class ContentBrowserPepperHostFactory : public ppapi::host::HostFactory {
25 public:
26 // Non-owning pointer to the filter must outlive this class.
27 explicit ContentBrowserPepperHostFactory(BrowserPpapiHostImpl* host);
29 ~ContentBrowserPepperHostFactory() override;
31 scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost(
32 ppapi::host::PpapiHost* host,
33 PP_Resource resource,
34 PP_Instance instance,
35 const IPC::Message& message) override;
37 // Creates ResourceHost for already accepted TCP |socket|. In the case of
38 // failure returns wrapped NULL.
39 scoped_ptr<ppapi::host::ResourceHost> CreateAcceptedTCPSocket(
40 PP_Instance instance,
41 ppapi::TCPSocketVersion version,
42 scoped_ptr<net::TCPSocket> socket);
44 private:
45 scoped_ptr<ppapi::host::ResourceHost> CreateNewTCPSocket(
46 PP_Instance instance,
47 PP_Resource resource,
48 ppapi::TCPSocketVersion version);
50 const ppapi::PpapiPermissions& GetPermissions() const;
52 // Non-owning pointer.
53 BrowserPpapiHostImpl* host_;
55 DISALLOW_COPY_AND_ASSIGN(ContentBrowserPepperHostFactory);
58 } // namespace content
60 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_