| 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_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 struct PepperRendererInstanceData; | 23 struct PepperRendererInstanceData; |
| 24 | 24 |
| 25 class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { | 25 class CONTENT_EXPORT BrowserPpapiHostImpl : public BrowserPpapiHost { |
| 26 public: | 26 public: |
| 27 // The creator is responsible for calling set_plugin_process_handle as soon | 27 // The creator is responsible for calling set_plugin_process_handle as soon |
| 28 // as it is known (we start the process asynchronously so it won't be known | 28 // as it is known (we start the process asynchronously so it won't be known |
| 29 // when this object is created). | 29 // when this object is created). |
| 30 BrowserPpapiHostImpl(IPC::Sender* sender, | 30 BrowserPpapiHostImpl(IPC::Sender* sender, |
| 31 const ppapi::PpapiPermissions& permissions, | 31 const ppapi::PpapiPermissions& permissions, |
| 32 const std::string& plugin_name, | 32 const std::string& plugin_name, |
| 33 const FilePath& profile_data_directory, | 33 const base::FilePath& profile_data_directory, |
| 34 ProcessType plugin_process_type); | 34 ProcessType plugin_process_type); |
| 35 virtual ~BrowserPpapiHostImpl(); | 35 virtual ~BrowserPpapiHostImpl(); |
| 36 | 36 |
| 37 // BrowserPpapiHost. | 37 // BrowserPpapiHost. |
| 38 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; | 38 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; |
| 39 virtual base::ProcessHandle GetPluginProcessHandle() const OVERRIDE; | 39 virtual base::ProcessHandle GetPluginProcessHandle() const OVERRIDE; |
| 40 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; | 40 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; |
| 41 virtual bool GetRenderViewIDsForInstance(PP_Instance instance, | 41 virtual bool GetRenderViewIDsForInstance(PP_Instance instance, |
| 42 int* render_process_id, | 42 int* render_process_id, |
| 43 int* render_view_id) const OVERRIDE; | 43 int* render_view_id) const OVERRIDE; |
| 44 virtual const std::string& GetPluginName() OVERRIDE; | 44 virtual const std::string& GetPluginName() OVERRIDE; |
| 45 virtual const FilePath& GetProfileDataDirectory() OVERRIDE; | 45 virtual const base::FilePath& GetProfileDataDirectory() OVERRIDE; |
| 46 virtual GURL GetDocumentURLForInstance(PP_Instance instance) OVERRIDE; | 46 virtual GURL GetDocumentURLForInstance(PP_Instance instance) OVERRIDE; |
| 47 virtual GURL GetPluginURLForInstance(PP_Instance instance) OVERRIDE; | 47 virtual GURL GetPluginURLForInstance(PP_Instance instance) OVERRIDE; |
| 48 | 48 |
| 49 void set_plugin_process_handle(base::ProcessHandle handle) { | 49 void set_plugin_process_handle(base::ProcessHandle handle) { |
| 50 plugin_process_handle_ = handle; | 50 plugin_process_handle_ = handle; |
| 51 } | 51 } |
| 52 | 52 |
| 53 ProcessType plugin_process_type() { return plugin_process_type_; } | 53 ProcessType plugin_process_type() { return plugin_process_type_; } |
| 54 | 54 |
| 55 // These two functions are notifications that an instance has been created | 55 // These two functions are notifications that an instance has been created |
| (...skipping 24 matching lines...) Expand all Loading... |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 virtual ~HostMessageFilter() {} | 82 virtual ~HostMessageFilter() {} |
| 83 | 83 |
| 84 ppapi::host::PpapiHost* ppapi_host_; | 84 ppapi::host::PpapiHost* ppapi_host_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; | 87 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; |
| 88 base::ProcessHandle plugin_process_handle_; | 88 base::ProcessHandle plugin_process_handle_; |
| 89 std::string plugin_name_; | 89 std::string plugin_name_; |
| 90 FilePath profile_data_directory_; | 90 base::FilePath profile_data_directory_; |
| 91 ProcessType plugin_process_type_; | 91 ProcessType plugin_process_type_; |
| 92 | 92 |
| 93 // Tracks all PP_Instances in this plugin and associated renderer-related | 93 // Tracks all PP_Instances in this plugin and associated renderer-related |
| 94 // data. | 94 // data. |
| 95 typedef std::map<PP_Instance, PepperRendererInstanceData> InstanceMap; | 95 typedef std::map<PP_Instance, PepperRendererInstanceData> InstanceMap; |
| 96 InstanceMap instance_map_; | 96 InstanceMap instance_map_; |
| 97 | 97 |
| 98 scoped_refptr<HostMessageFilter> message_filter_; | 98 scoped_refptr<HostMessageFilter> message_filter_; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(BrowserPpapiHostImpl); | 100 DISALLOW_COPY_AND_ASSIGN(BrowserPpapiHostImpl); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace content | 103 } // namespace content |
| 104 | 104 |
| 105 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ | 105 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ |
| OLD | NEW |