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.h" | 9 #include "base/process.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // There will be one of these objects in the browser per plugin process. It | 37 // There will be one of these objects in the browser per plugin process. It |
38 // lives entirely on the I/O thread. | 38 // lives entirely on the I/O thread. |
39 class CONTENT_EXPORT BrowserPpapiHost { | 39 class CONTENT_EXPORT BrowserPpapiHost { |
40 public: | 40 public: |
41 // Creates a browser host and sets up an out-of-process proxy for an external | 41 // Creates a browser host and sets up an out-of-process proxy for an external |
42 // pepper plugin process. | 42 // pepper plugin process. |
43 static BrowserPpapiHost* CreateExternalPluginProcess( | 43 static BrowserPpapiHost* CreateExternalPluginProcess( |
44 IPC::Sender* sender, | 44 IPC::Sender* sender, |
45 ppapi::PpapiPermissions permissions, | 45 ppapi::PpapiPermissions permissions, |
46 base::ProcessHandle plugin_child_process, | 46 base::ProcessHandle plugin_child_process, |
47 int plugin_child_process_id, | |
48 IPC::ChannelProxy* channel, | 47 IPC::ChannelProxy* channel, |
49 net::HostResolver* host_resolver, | 48 net::HostResolver* host_resolver, |
50 int render_process_id, | 49 int render_process_id, |
51 int render_view_id); | 50 int render_view_id); |
52 | 51 |
53 virtual ~BrowserPpapiHost() {} | 52 virtual ~BrowserPpapiHost() {} |
54 | 53 |
55 // Returns the PpapiHost object. | 54 // Returns the PpapiHost object. |
56 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; | 55 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; |
57 | 56 |
58 // Returns the handle to the plugin process. | 57 // Returns the handle to the plugin process. |
59 virtual base::ProcessHandle GetPluginProcessHandle() const = 0; | 58 virtual base::ProcessHandle GetPluginProcessHandle() const = 0; |
60 | 59 |
61 // Returns true if the given PP_Instance is valid. | 60 // Returns true if the given PP_Instance is valid. |
62 virtual bool IsValidInstance(PP_Instance instance) const = 0; | 61 virtual bool IsValidInstance(PP_Instance instance) const = 0; |
63 | 62 |
64 // Retrieves the process/view Ids associated with the RenderView containing | 63 // Retrieves the process/view Ids associated with the RenderView containing |
65 // the given instance and returns true on success. If the instance is | 64 // the given instance and returns true on success. If the instance is |
66 // invalid, the ids will be 0 and false will be returned. | 65 // invalid, the ids will be 0 and false will be returned. |
67 // | 66 // |
68 // When a resource is created, the PP_Instance should already have been | 67 // When a resource is created, the PP_Instance should already have been |
69 // validated, and the resource hosts will be deleted when the resource is | 68 // validated, and the resource hosts will be deleted when the resource is |
70 // destroyed. So it should not generally be necessary to check for errors | 69 // destroyed. So it should not generally be necessary to check for errors |
71 // from this function except as a last-minute sanity check if you convert the | 70 // from this function except as a last-minute sanity check if you convert the |
72 // IDs to a RenderView/ProcessHost on the UI thread. | 71 // IDs to a RenderView/ProcessHost on the UI thread. |
73 virtual bool GetRenderViewIDsForInstance(PP_Instance instance, | 72 virtual bool GetRenderViewIDsForInstance(PP_Instance instance, |
74 int* render_process_id, | 73 int* render_process_id, |
75 int* render_view_id) const = 0; | 74 int* render_view_id) const = 0; |
76 // Returns the name of the plugin. | |
77 virtual const std::string& GetPluginName() = 0; | |
78 | |
79 // Returns the user's profile data directory. | |
80 virtual const FilePath& GetProfileDataDirectory() = 0; | |
81 | |
82 // Returns the unique id of the child plugin process (this is NOT the pid). | |
83 virtual int GetPluginProcessID() = 0; | |
84 }; | 75 }; |
85 | 76 |
86 } // namespace content | 77 } // namespace content |
87 | 78 |
88 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ | 79 #endif // CONTENT_PUBLIC_BROWSER_BROWSER_PPAPI_HOST_H_ |
OLD | NEW |