| 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 3e63f1179496355fd8433c0fee9b282653eb6214..14ea94980377ea2fb35fd82578198be17797745c 100644
|
| --- a/content/renderer/browser_plugin/browser_plugin.h
|
| +++ b/content/renderer/browser_plugin/browser_plugin.h
|
| @@ -14,6 +14,7 @@
|
| #if defined(OS_WIN)
|
| #include "base/shared_memory.h"
|
| #endif
|
| +#include "content/common/browser_plugin_message_enums.h"
|
| #include "content/renderer/browser_plugin/browser_plugin_backing_store.h"
|
| #include "content/renderer/browser_plugin/browser_plugin_bindings.h"
|
| #include "content/renderer/render_view_impl.h"
|
| @@ -114,12 +115,18 @@ class CONTENT_EXPORT BrowserPlugin :
|
| // Tells the BrowserPlugin to terminate the guest process.
|
| void TerminateGuest();
|
|
|
| - // A request from Javascript has been made to stop the loading of the page.
|
| + // A request from JavaScript has been made to stop the loading of the page.
|
| void Stop();
|
| - // A request from Javascript has been made to reload the page.
|
| + // A request from JavaScript has been made to reload the page.
|
| void Reload();
|
| // A request to enable hardware compositing.
|
| void EnableCompositing(bool enable);
|
| + // A request from content client to track lifetime of a JavaScript object
|
| + // related to a permission request object.
|
| + // This is used to clean up hanging permission request objects.
|
| + 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
|
| @@ -128,6 +135,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;
|
| @@ -245,6 +255,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(
|
| @@ -259,6 +271,26 @@ class CONTENT_EXPORT BrowserPlugin :
|
| // browser process.
|
| void SetInstanceID(int instance_id);
|
|
|
| + // Requests media access permission from the embedder.
|
| + void RequestMediaPermission(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(BrowserPluginPermissionType permission_type,
|
| + int request_id,
|
| + bool allow);
|
| +
|
| + // If the request with id |request_id| is pending then informs the
|
| + // BrowserPlugin that the guest's permission request has been allowed or
|
| + // denied by the embedder.
|
| + void RespondPermissionIfRequestIsPending(int request_id, bool allow);
|
| + // Cleans up pending permission request once the associated event.request
|
| + // object goes out of scope in JavaScript.
|
| + void OnRequestObjectGarbageCollected(int request_id);
|
| + // V8 garbage collection callback for |object|.
|
| + static void WeakCallbackForPersistObject(v8::Persistent<v8::Value> object,
|
| + void* param);
|
| +
|
| // IPC message handlers.
|
| // Please keep in alphabetical order.
|
| void OnAdvanceFocus(int instance_id, bool reverse);
|
| @@ -284,6 +316,11 @@ class CONTENT_EXPORT BrowserPlugin :
|
| bool is_top_level);
|
| void OnLoadStart(int instance_id, const GURL& url, bool is_top_level);
|
| void OnLoadStop(int instance_id);
|
| + // Requests permission from the embedder.
|
| + void OnRequestPermission(int instance_id,
|
| + BrowserPluginPermissionType permission_type,
|
| + int request_id,
|
| + const base::DictionaryValue& request_info);
|
| void OnSetCursor(int instance_id, const WebCursor& cursor);
|
| void OnShouldAcceptTouchEvents(int instance_id, bool accept);
|
| void OnUpdatedName(int instance_id, const std::string& name);
|
| @@ -328,6 +365,17 @@ class CONTENT_EXPORT BrowserPlugin :
|
| bool size_changed_in_flight_;
|
| bool allocate_instance_id_sent_;
|
|
|
| + // Each permission request item in the map is a pair of request id and
|
| + // permission type.
|
| + typedef std::map<int, std::pair<int, BrowserPluginPermissionType> >
|
| + PendingPermissionRequests;
|
| + PendingPermissionRequests pending_permission_requests_;
|
| +
|
| + 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.
|
| @@ -350,6 +398,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);
|
| };
|
|
|
|
|