| 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 27 matching lines...) Expand all Loading... |
| 38 BrowserPpapiHostImpl(IPC::Sender* sender, | 38 BrowserPpapiHostImpl(IPC::Sender* sender, |
| 39 const ppapi::PpapiPermissions& permissions, | 39 const ppapi::PpapiPermissions& permissions, |
| 40 const std::string& plugin_name, | 40 const std::string& plugin_name, |
| 41 const base::FilePath& plugin_path, | 41 const base::FilePath& plugin_path, |
| 42 const base::FilePath& profile_data_directory, | 42 const base::FilePath& profile_data_directory, |
| 43 bool in_process, | 43 bool in_process, |
| 44 bool external_plugin); | 44 bool external_plugin); |
| 45 virtual ~BrowserPpapiHostImpl(); | 45 virtual ~BrowserPpapiHostImpl(); |
| 46 | 46 |
| 47 // BrowserPpapiHost. | 47 // BrowserPpapiHost. |
| 48 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; | 48 virtual ppapi::host::PpapiHost* GetPpapiHost() override; |
| 49 virtual base::ProcessHandle GetPluginProcessHandle() const OVERRIDE; | 49 virtual base::ProcessHandle GetPluginProcessHandle() const override; |
| 50 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; | 50 virtual bool IsValidInstance(PP_Instance instance) const override; |
| 51 virtual bool GetRenderFrameIDsForInstance(PP_Instance instance, | 51 virtual bool GetRenderFrameIDsForInstance(PP_Instance instance, |
| 52 int* render_process_id, | 52 int* render_process_id, |
| 53 int* render_frame_id) const | 53 int* render_frame_id) const |
| 54 OVERRIDE; | 54 override; |
| 55 virtual const std::string& GetPluginName() OVERRIDE; | 55 virtual const std::string& GetPluginName() override; |
| 56 virtual const base::FilePath& GetPluginPath() OVERRIDE; | 56 virtual const base::FilePath& GetPluginPath() override; |
| 57 virtual const base::FilePath& GetProfileDataDirectory() OVERRIDE; | 57 virtual const base::FilePath& GetProfileDataDirectory() override; |
| 58 virtual GURL GetDocumentURLForInstance(PP_Instance instance) OVERRIDE; | 58 virtual GURL GetDocumentURLForInstance(PP_Instance instance) override; |
| 59 virtual GURL GetPluginURLForInstance(PP_Instance instance) OVERRIDE; | 59 virtual GURL GetPluginURLForInstance(PP_Instance instance) override; |
| 60 virtual void SetOnKeepaliveCallback( | 60 virtual void SetOnKeepaliveCallback( |
| 61 const BrowserPpapiHost::OnKeepaliveCallback& callback) OVERRIDE; | 61 const BrowserPpapiHost::OnKeepaliveCallback& callback) override; |
| 62 | 62 |
| 63 void set_plugin_process_handle(base::ProcessHandle handle) { | 63 void set_plugin_process_handle(base::ProcessHandle handle) { |
| 64 plugin_process_handle_ = handle; | 64 plugin_process_handle_ = handle; |
| 65 } | 65 } |
| 66 | 66 |
| 67 bool external_plugin() const { return external_plugin_; } | 67 bool external_plugin() const { return external_plugin_; } |
| 68 | 68 |
| 69 // These two functions are notifications that an instance has been created | 69 // These two functions are notifications that an instance has been created |
| 70 // or destroyed. They allow us to maintain a mapping of PP_Instance to data | 70 // or destroyed. They allow us to maintain a mapping of PP_Instance to data |
| 71 // associated with the instance including view IDs in the browser process. | 71 // associated with the instance including view IDs in the browser process. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 // Implementing MessageFilter on BrowserPpapiHostImpl makes it ref-counted, | 87 // Implementing MessageFilter on BrowserPpapiHostImpl makes it ref-counted, |
| 88 // preventing us from returning these to embedders without holding a | 88 // preventing us from returning these to embedders without holding a |
| 89 // reference. To avoid that, define a message filter object. | 89 // reference. To avoid that, define a message filter object. |
| 90 class HostMessageFilter : public IPC::MessageFilter { | 90 class HostMessageFilter : public IPC::MessageFilter { |
| 91 public: | 91 public: |
| 92 HostMessageFilter(ppapi::host::PpapiHost* ppapi_host, | 92 HostMessageFilter(ppapi::host::PpapiHost* ppapi_host, |
| 93 BrowserPpapiHostImpl* browser_ppapi_host_impl); | 93 BrowserPpapiHostImpl* browser_ppapi_host_impl); |
| 94 | 94 |
| 95 // IPC::MessageFilter. | 95 // IPC::MessageFilter. |
| 96 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 96 virtual bool OnMessageReceived(const IPC::Message& msg) override; |
| 97 | 97 |
| 98 void OnHostDestroyed(); | 98 void OnHostDestroyed(); |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 virtual ~HostMessageFilter(); | 101 virtual ~HostMessageFilter(); |
| 102 | 102 |
| 103 void OnKeepalive(); | 103 void OnKeepalive(); |
| 104 void OnHostMsgLogInterfaceUsage(int hash) const; | 104 void OnHostMsgLogInterfaceUsage(int hash) const; |
| 105 | 105 |
| 106 // Non owning pointers cleared in OnHostDestroyed() | 106 // Non owning pointers cleared in OnHostDestroyed() |
| (...skipping 27 matching lines...) Expand all Loading... |
| 134 scoped_refptr<HostMessageFilter> message_filter_; | 134 scoped_refptr<HostMessageFilter> message_filter_; |
| 135 | 135 |
| 136 BrowserPpapiHost::OnKeepaliveCallback on_keepalive_callback_; | 136 BrowserPpapiHost::OnKeepaliveCallback on_keepalive_callback_; |
| 137 | 137 |
| 138 DISALLOW_COPY_AND_ASSIGN(BrowserPpapiHostImpl); | 138 DISALLOW_COPY_AND_ASSIGN(BrowserPpapiHostImpl); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace content | 141 } // namespace content |
| 142 | 142 |
| 143 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ | 143 #endif // CONTENT_BROWSER_RENDERER_HOST_PEPPER_BROWSER_PPAPI_HOST_IMPL_H_ |
| OLD | NEW |