| 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_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ |
| 7 | 7 |
| 8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
| 9 #include "base/process/process.h" | 9 #include "base/process/process.h" |
| 10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 namespace content { | 27 namespace content { |
| 28 | 28 |
| 29 // Interface that allows components in the embedder app to talk to the | 29 // Interface that allows components in the embedder app to talk to the |
| 30 // PpapiHost in the browser process. | 30 // PpapiHost in the browser process. |
| 31 // | 31 // |
| 32 // There will be one of these objects in the browser per plugin process. It | 32 // There will be one of these objects in the browser per plugin process. It |
| 33 // lives entirely on the I/O thread. | 33 // lives entirely on the I/O thread. |
| 34 class CONTENT_EXPORT BrowserPpapiHost { | 34 class CONTENT_EXPORT BrowserPpapiHost { |
| 35 public: | 35 public: |
| 36 struct OnKeepaliveInstanceStruct { | |
| 37 int render_process_id; | |
| 38 int render_frame_id; | |
| 39 GURL document_url; | |
| 40 }; | |
| 41 typedef std::vector<OnKeepaliveInstanceStruct> OnKeepaliveInstanceData; | |
| 42 typedef base::Callback< | |
| 43 void (const OnKeepaliveInstanceData& instance_data, | |
| 44 const base::FilePath& profile_data_directory)> | |
| 45 OnKeepaliveCallback; | |
| 46 | |
| 47 // Creates a browser host and sets up an out-of-process proxy for an external | 36 // Creates a browser host and sets up an out-of-process proxy for an external |
| 48 // pepper plugin process. | 37 // pepper plugin process. |
| 49 static BrowserPpapiHost* CreateExternalPluginProcess( | 38 static BrowserPpapiHost* CreateExternalPluginProcess( |
| 50 IPC::Sender* sender, | 39 IPC::Sender* sender, |
| 51 ppapi::PpapiPermissions permissions, | 40 ppapi::PpapiPermissions permissions, |
| 52 base::ProcessHandle plugin_child_process, | 41 base::ProcessHandle plugin_child_process, |
| 53 IPC::ChannelProxy* channel, | 42 IPC::ChannelProxy* channel, |
| 54 int render_process_id, | 43 int render_process_id, |
| 55 int render_view_id, | 44 int render_view_id, |
| 56 const base::FilePath& profile_directory); | 45 const base::FilePath& profile_directory); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 84 | 73 |
| 85 // Returns the path of the plugin. | 74 // Returns the path of the plugin. |
| 86 virtual const base::FilePath& GetPluginPath() = 0; | 75 virtual const base::FilePath& GetPluginPath() = 0; |
| 87 | 76 |
| 88 // Returns the user's profile data directory. | 77 // Returns the user's profile data directory. |
| 89 virtual const base::FilePath& GetProfileDataDirectory() = 0; | 78 virtual const base::FilePath& GetProfileDataDirectory() = 0; |
| 90 | 79 |
| 91 // Get the Document/Plugin URLs for the given PP_Instance. | 80 // Get the Document/Plugin URLs for the given PP_Instance. |
| 92 virtual GURL GetDocumentURLForInstance(PP_Instance instance) = 0; | 81 virtual GURL GetDocumentURLForInstance(PP_Instance instance) = 0; |
| 93 virtual GURL GetPluginURLForInstance(PP_Instance instance) = 0; | 82 virtual GURL GetPluginURLForInstance(PP_Instance instance) = 0; |
| 94 | |
| 95 // Sets a callback the BrowserPpapiHost will run when the plugin messages | |
| 96 // that it is active. | |
| 97 virtual void SetOnKeepaliveCallback(const OnKeepaliveCallback& callback) = 0; | |
| 98 }; | 83 }; |
| 99 | 84 |
| 100 } // namespace content | 85 } // namespace content |
| 101 | 86 |
| 102 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ | 87 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ |
| OLD | NEW |