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_RENDERER_RENDERER_PPAPI_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/shared_memory.h" |
13 #include "base/process/process.h" | 14 #include "base/process/process.h" |
14 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
15 #include "ipc/ipc_platform_file.h" | 16 #include "ipc/ipc_platform_file.h" |
16 #include "ppapi/c/pp_instance.h" | 17 #include "ppapi/c/pp_instance.h" |
17 #include "url/gurl.h" | 18 #include "url/gurl.h" |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class FilePath; | 21 class FilePath; |
21 } | 22 } |
22 | 23 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // Shares a file handle (HANDLE / file descriptor) with the remote side. It | 114 // Shares a file handle (HANDLE / file descriptor) with the remote side. It |
114 // returns a handle that should be sent in exactly one IPC message. Upon | 115 // returns a handle that should be sent in exactly one IPC message. Upon |
115 // receipt, the remote side then owns that handle. Note: if sending the | 116 // receipt, the remote side then owns that handle. Note: if sending the |
116 // message fails, the returned handle is properly closed by the IPC system. If | 117 // message fails, the returned handle is properly closed by the IPC system. If |
117 // |should_close_source| is set to true, the original handle is closed by this | 118 // |should_close_source| is set to true, the original handle is closed by this |
118 // operation and should not be used again. | 119 // operation and should not be used again. |
119 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( | 120 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( |
120 base::PlatformFile handle, | 121 base::PlatformFile handle, |
121 bool should_close_source) = 0; | 122 bool should_close_source) = 0; |
122 | 123 |
| 124 // Shares a shared memory handle with the remote side. It |
| 125 // returns a handle that should be sent in exactly one IPC message. Upon |
| 126 // receipt, the remote side then owns that handle. Note: if sending the |
| 127 // message fails, the returned handle is properly closed by the IPC system. |
| 128 virtual base::SharedMemoryHandle ShareSharedMemoryHandleWithRemote( |
| 129 const base::SharedMemoryHandle& handle) = 0; |
| 130 |
123 // Returns true if the plugin is running in process. | 131 // Returns true if the plugin is running in process. |
124 virtual bool IsRunningInProcess() const = 0; | 132 virtual bool IsRunningInProcess() const = 0; |
125 | 133 |
126 virtual std::string GetPluginName() const = 0; | 134 virtual std::string GetPluginName() const = 0; |
127 | 135 |
128 // Used by the embedder to inform this RendererPpapiHost that the associated | 136 // Used by the embedder to inform this RendererPpapiHost that the associated |
129 // plugin module is a host for "external plugins." | 137 // plugin module is a host for "external plugins." |
130 // | 138 // |
131 // An embedder may, at the time a plugin module is created, configure it to | 139 // An embedder may, at the time a plugin module is created, configure it to |
132 // be a host for external plugins. Instances of such plugins go through two | 140 // be a host for external plugins. Instances of such plugins go through two |
(...skipping 26 matching lines...) Expand all Loading... |
159 // interface. Consider changing them to static helpers. | 167 // interface. Consider changing them to static helpers. |
160 virtual GURL GetDocumentURL(PP_Instance instance) const = 0; | 168 virtual GURL GetDocumentURL(PP_Instance instance) const = 0; |
161 | 169 |
162 protected: | 170 protected: |
163 virtual ~RendererPpapiHost() {} | 171 virtual ~RendererPpapiHost() {} |
164 }; | 172 }; |
165 | 173 |
166 } // namespace content | 174 } // namespace content |
167 | 175 |
168 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 176 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
OLD | NEW |