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