Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(885)

Side by Side Diff: content/public/renderer/renderer_ppapi_host.h

Issue 290553004: PPAPI: Refactor MessageChannel to prep for sync postMessae (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix in-process. Make Chrome tell content when a plugin is a host for external plugins (i.e., NaCl) Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/pepper/pepper_helper.cc ('k') | content/renderer/pepper/message_channel.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // message fails, the returned handle is properly closed by the IPC system. If 116 // 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 117 // |should_close_source| is set to true, the original handle is closed by this
118 // operation and should not be used again. 118 // operation and should not be used again.
119 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( 119 virtual IPC::PlatformFileForTransit ShareHandleWithRemote(
120 base::PlatformFile handle, 120 base::PlatformFile handle,
121 bool should_close_source) = 0; 121 bool should_close_source) = 0;
122 122
123 // Returns true if the plugin is running in process. 123 // Returns true if the plugin is running in process.
124 virtual bool IsRunningInProcess() const = 0; 124 virtual bool IsRunningInProcess() const = 0;
125 125
126 virtual std::string GetPluginName() const = 0;
127
128 // Used by the embedder to inform this RendererPpapiHost that the associated
129 // plugin module is a host for "external plugins."
raymes 2014/05/22 00:25:31 nit: "external plugins".
dmichael (off chromium) 2014/05/22 20:18:02 Technically, the period should be inside the quote
raymes 2014/05/22 23:42:33 Haha ok, I guess I'm used to the "British style" :
130 //
131 // 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
133 // two stages of initialization; the first stage initializes a host plugin
134 // instance, which then loads and initializes a child plugin which takes
135 // over control. These are treated as one Pepper Instance, because despite the
136 // two-stage initialization process, the host and child appear to blink as
137 // one plugin instance.
138 //
139 // The host plugin appears as an in-process plugin, while we interact with the
140 // child plugin via the Pepper proxy.
141 virtual void SetToExternalPluginHost() = 0;
raymes 2014/05/22 00:25:31 Can we do this without modifying the content API?
dmichael (off chromium) 2014/05/22 20:18:02 Unfortunately, that wouldn't work. That function b
raymes 2014/05/22 23:42:33 I see, thanks for the explanation.
142
126 // There are times when the renderer needs to create a ResourceHost in the 143 // There are times when the renderer needs to create a ResourceHost in the
127 // browser. This function does so asynchronously. |nested_msgs| is a list of 144 // browser. This function does so asynchronously. |nested_msgs| is a list of
128 // resource host creation messages and |instance| is the PP_Instance which 145 // resource host creation messages and |instance| is the PP_Instance which
129 // the resource will belong to. |callback| will be called asynchronously with 146 // the resource will belong to. |callback| will be called asynchronously with
130 // the pending host IDs when the ResourceHosts have been created. This can be 147 // the pending host IDs when the ResourceHosts have been created. This can be
131 // passed back to the plugin to attach to the ResourceHosts. Pending IDs of 0 148 // passed back to the plugin to attach to the ResourceHosts. Pending IDs of 0
132 // will be passed to the callback if a ResourceHost fails to be created. 149 // will be passed to the callback if a ResourceHost fails to be created.
133 virtual void CreateBrowserResourceHosts( 150 virtual void CreateBrowserResourceHosts(
134 PP_Instance instance, 151 PP_Instance instance,
135 const std::vector<IPC::Message>& nested_msgs, 152 const std::vector<IPC::Message>& nested_msgs,
136 const base::Callback<void(const std::vector<int>&)>& callback) const = 0; 153 const base::Callback<void(const std::vector<int>&)>& callback) const = 0;
137 154
138 // Gets the URL of the document containing the given PP_Instance. 155 // Gets the URL of the document containing the given PP_Instance.
139 // Returns an empty URL if the instance is invalid. 156 // Returns an empty URL if the instance is invalid.
140 // TODO(yzshen): Some methods such as this one don't need to be pure virtual. 157 // TODO(yzshen): Some methods such as this one don't need to be pure virtual.
141 // Instead, they could be directly implemented using other methods in this 158 // Instead, they could be directly implemented using other methods in this
142 // interface. Consider changing them to static helpers. 159 // interface. Consider changing them to static helpers.
143 virtual GURL GetDocumentURL(PP_Instance instance) const = 0; 160 virtual GURL GetDocumentURL(PP_Instance instance) const = 0;
144 161
145 protected: 162 protected:
146 virtual ~RendererPpapiHost() {} 163 virtual ~RendererPpapiHost() {}
147 }; 164 };
148 165
149 } // namespace content 166 } // namespace content
150 167
151 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ 168 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_
OLDNEW
« no previous file with comments | « chrome/renderer/pepper/pepper_helper.cc ('k') | content/renderer/pepper/message_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698