Home | History | Annotate | Download | only in pepper
      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_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
      6 #define CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
      7 
      8 #include "base/compiler_specific.h"
      9 #include "base/memory/ref_counted.h"
     10 #include "content/browser/renderer_host/pepper/pepper_message_filter.h"
     11 #include "ppapi/host/host_factory.h"
     12 
     13 namespace ppapi {
     14 class PpapiPermissions;
     15 }
     16 
     17 namespace content {
     18 
     19 class BrowserPpapiHostImpl;
     20 
     21 class ContentBrowserPepperHostFactory : public ppapi::host::HostFactory {
     22  public:
     23   // Non-owning pointer to the filter must outlive this class.
     24   ContentBrowserPepperHostFactory(
     25       BrowserPpapiHostImpl* host,
     26       // TODO (ygorshenin@): remove this once TCP sockets are
     27       // converted to the new design.
     28       const scoped_refptr<PepperMessageFilter>& pepper_message_filter);
     29   virtual ~ContentBrowserPepperHostFactory();
     30 
     31   virtual scoped_ptr<ppapi::host::ResourceHost> CreateResourceHost(
     32       ppapi::host::PpapiHost* host,
     33       const ppapi::proxy::ResourceMessageCallParams& params,
     34       PP_Instance instance,
     35       const IPC::Message& message) OVERRIDE;
     36 
     37  private:
     38   const ppapi::PpapiPermissions& GetPermissions() const;
     39 
     40   // Non-owning pointer.
     41   BrowserPpapiHostImpl* host_;
     42 
     43   scoped_refptr<PepperMessageFilter> pepper_message_filter_;
     44 
     45   DISALLOW_COPY_AND_ASSIGN(ContentBrowserPepperHostFactory);
     46 };
     47 
     48 }  // namespace content
     49 
     50 #endif  // CONTENT_BROWSER_PEPPER_CONTENT_BROWSER_PEPPER_HOST_FACTORY_H_
     51