| Index: content/renderer/browser_plugin/browser_plugin.h
|
| diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
|
| index 17dcdcf5b3b340dfa0b6c0d243371883e2b3d219..c83d1a11a850dac30e8952f46165be2f0b7cbf76 100644
|
| --- a/content/renderer/browser_plugin/browser_plugin.h
|
| +++ b/content/renderer/browser_plugin/browser_plugin.h
|
| @@ -118,6 +118,12 @@ class CONTENT_EXPORT BrowserPlugin :
|
| void Reload();
|
| // A request to enable hardware compositing.
|
| void EnableCompositing(bool enable);
|
| + // A request from shim to track lifetime of a js object related to media
|
| + // access request object.
|
| + // This is used to clean up hanging media requests.
|
| + void PersistRequestObject(const NPVariant* request,
|
| + const std::string& type,
|
| + int id);
|
|
|
| // Returns true if |point| lies within the bounds of the plugin rectangle.
|
| // Not OK to use this function for making security-sensitive decision since it
|
| @@ -126,6 +132,9 @@ class CONTENT_EXPORT BrowserPlugin :
|
| bool InBounds(const gfx::Point& point) const;
|
|
|
| gfx::Point ToLocalCoordinates(const gfx::Point& point) const;
|
| + // Called by browser plugin binding.
|
| + void OnEmbedderDecidedPermission(int request_id, bool allow);
|
| +
|
|
|
| // WebKit::WebPlugin implementation.
|
| virtual WebKit::WebPluginContainer* container() const OVERRIDE;
|
| @@ -174,6 +183,11 @@ class CONTENT_EXPORT BrowserPlugin :
|
| // For unit/integration tests.
|
| friend class MockBrowserPlugin;
|
|
|
| + enum PermissionRequestType {
|
| + INVALID = -1,
|
| + MEDIA
|
| + };
|
| +
|
| // A BrowserPlugin object is a controller that represents an instance of a
|
| // browser plugin within the embedder renderer process. Each BrowserPlugin
|
| // within a process has a unique instance_id that is used to route messages
|
| @@ -243,6 +257,8 @@ class CONTENT_EXPORT BrowserPlugin :
|
| // Informs the BrowserPlugin that guest has changed its size in autosize mode.
|
| void SizeChangedDueToAutoSize(const gfx::Size& old_view_size);
|
|
|
| + bool HasEventListeners(const std::string& event_name);
|
| +
|
| // Indicates whether a damage buffer was used by the guest process for the
|
| // provided |params|.
|
| static bool UsesDamageBuffer(
|
| @@ -287,6 +303,24 @@ class CONTENT_EXPORT BrowserPlugin :
|
| void OnUpdatedName(int instance_id, const std::string& name);
|
| void OnUpdateRect(int instance_id,
|
| const BrowserPluginMsg_UpdateRect_Params& params);
|
| + // Requests permission from the embedder.
|
| + void OnRequestPermission(int instance_id,
|
| + const std::string& permission_type,
|
| + int request_id,
|
| + const base::DictionaryValue& request_info);
|
| + // Requests media access permission from the embedder.
|
| + void OnRequestMediaPermission(int request_id,
|
| + const base::DictionaryValue& request_info);
|
| + // Informs the BrowserPlugin that the guest's permission request has been
|
| + // allowed or denied by the embedder.
|
| + void RespondPermission(PermissionRequestType type,
|
| + int request_id,
|
| + bool allow);
|
| +
|
| + void RespondPermissionIfPending(int request_id, bool allow);
|
| + void OnRequestObjectGarbageCollected(int request_id);
|
| + static void WeakCallbackForPersistObject(v8::Persistent<v8::Value> object,
|
| + void* param);
|
|
|
| int instance_id_;
|
| base::WeakPtr<RenderViewImpl> render_view_;
|
| @@ -326,6 +360,16 @@ class CONTENT_EXPORT BrowserPlugin :
|
| bool size_changed_in_flight_;
|
| bool allocate_instance_id_sent_;
|
|
|
| + std::map<int, PermissionRequestType> pending_request_id_to_type_;
|
| +
|
| + typedef std::set<int> PendingPermissionRequestIds;
|
| + PendingPermissionRequestIds pending_permission_request_ids_;
|
| +
|
| + typedef std::pair<int, base::WeakPtr<BrowserPlugin> >
|
| + AliveV8PermissionRequestItem;
|
| + std::map<int, AliveV8PermissionRequestItem*>
|
| + alive_v8_permission_request_objects;
|
| +
|
| // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to
|
| // store the BrowserPlugin's BrowserPluginManager in a member variable to
|
| // avoid accessing the RenderViewImpl.
|
| @@ -348,6 +392,10 @@ class CONTENT_EXPORT BrowserPlugin :
|
| bool compositing_enabled_;
|
| scoped_refptr<BrowserPluginCompositingHelper> compositing_helper_;
|
|
|
| + // Weak factory used in v8 |MakeWeak| callback, since the v8 callback might
|
| + // get called after BrowserPlugin has been destroyed.
|
| + base::WeakPtrFactory<BrowserPlugin> weak_ptr_factory_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(BrowserPlugin);
|
| };
|
|
|
|
|