| 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..1bb8f9dcb111a9af6161c13e94726b2f64837177 100644
|
| --- a/content/renderer/browser_plugin/browser_plugin.h
|
| +++ b/content/renderer/browser_plugin/browser_plugin.h
|
| @@ -118,6 +118,10 @@ 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, 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 +130,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 OnListenerCallMediaAccess(int request_id, bool allow);
|
| +
|
|
|
| // WebKit::WebPlugin implementation.
|
| virtual WebKit::WebPluginContainer* container() const OVERRIDE;
|
| @@ -243,6 +250,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 +296,18 @@ class CONTENT_EXPORT BrowserPlugin :
|
| void OnUpdatedName(int instance_id, const std::string& name);
|
| void OnUpdateRect(int instance_id,
|
| const BrowserPluginMsg_UpdateRect_Params& params);
|
| + // Requests media access permission from the embedder.
|
| + void OnRequestMediaAccess(int instance_id,
|
| + int request_id,
|
| + const GURL& security_origin);
|
| + // Informs the BrowserPlugin that the guest's request for media access has
|
| + // been allowed or denied by the embedder.
|
| + void RespondMediaAccess(int request_id, bool allow);
|
| +
|
| + void RespondMediaAccessIfPending(int request_id, bool allow);
|
| + void OnMediaRequestGarbageCollected(int request_id);
|
| + static void WeakCallbackForPersistObject(v8::Persistent<v8::Value> object,
|
| + void* param);
|
|
|
| int instance_id_;
|
| base::WeakPtr<RenderViewImpl> render_view_;
|
| @@ -325,6 +346,12 @@ class CONTENT_EXPORT BrowserPlugin :
|
| gfx::Size last_view_size_;
|
| bool size_changed_in_flight_;
|
| bool allocate_instance_id_sent_;
|
| + typedef std::set<int> MediaAccessPendingRequestIds;
|
| + MediaAccessPendingRequestIds media_access_pending_request_ids_;
|
| +
|
| + typedef std::pair<int*, BrowserPlugin*> MediaAccessAliveV8RequestItem;
|
| + std::map<int, MediaAccessAliveV8RequestItem*>
|
| + media_access_alive_v8_request_objects_;
|
|
|
| // BrowserPlugin outlives RenderViewImpl in Chrome Apps and so we need to
|
| // store the BrowserPlugin's BrowserPluginManager in a member variable to
|
|
|