diff options
Diffstat (limited to 'webkit/plugins')
-rw-r--r-- | webkit/plugins/ppapi/plugin_delegate.h | 6 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_broker_impl.cc | 8 | ||||
-rw-r--r-- | webkit/plugins/ppapi/ppb_broker_impl.h | 4 |
3 files changed, 14 insertions, 4 deletions
diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h index 7418070..3e75cc5 100644 --- a/webkit/plugins/ppapi/plugin_delegate.h +++ b/webkit/plugins/ppapi/plugin_delegate.h @@ -299,12 +299,10 @@ class PluginDelegate { // Provides access to the ppapi broker. class Broker { public: - virtual void Connect(webkit::ppapi::PPB_Broker_Impl* client) = 0; - // Decrements the references to the broker. // When there are no more references, this renderer's dispatcher is // destroyed, allowing the broker to shutdown if appropriate. - // Callers should not reference this object after calling Disconnect. + // Callers should not reference this object after calling Disconnect(). virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) = 0; protected: @@ -404,7 +402,7 @@ class PluginDelegate { // A pointer is returned immediately, but it is not ready to be used until // BrokerConnected has been called. - // The caller is responsible for calling Release() on the returned pointer + // The caller is responsible for calling Disconnect() on the returned pointer // to clean up the corresponding resources allocated during this call. virtual Broker* ConnectToBroker(webkit::ppapi::PPB_Broker_Impl* client) = 0; diff --git a/webkit/plugins/ppapi/ppb_broker_impl.cc b/webkit/plugins/ppapi/ppb_broker_impl.cc index 2386e0d..49342fc 100644 --- a/webkit/plugins/ppapi/ppb_broker_impl.cc +++ b/webkit/plugins/ppapi/ppb_broker_impl.cc @@ -6,6 +6,9 @@ #include "base/logging.h" #include "ppapi/shared_impl/platform_file.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" #include "webkit/plugins/ppapi/common.h" #include "webkit/plugins/ppapi/plugin_module.h" #include "webkit/plugins/ppapi/resource_helper.h" @@ -75,6 +78,11 @@ int32_t PPB_Broker_Impl::GetHandle(int32_t* handle) { return PP_OK; } +GURL PPB_Broker_Impl::GetDocumentUrl() { + PluginInstance* plugin_instance = ResourceHelper::GetPluginInstance(this); + return plugin_instance->container()->element().document().url(); +} + // Transfers ownership of the handle to the plugin. void PPB_Broker_Impl::BrokerConnected(int32_t handle, int32_t result) { DCHECK(pipe_handle_ == diff --git a/webkit/plugins/ppapi/ppb_broker_impl.h b/webkit/plugins/ppapi/ppb_broker_impl.h index 6799c4f..ab02ae8 100644 --- a/webkit/plugins/ppapi/ppb_broker_impl.h +++ b/webkit/plugins/ppapi/ppb_broker_impl.h @@ -36,6 +36,10 @@ class WEBKIT_PLUGINS_EXPORT PPB_Broker_Impl scoped_refptr< ::ppapi::TrackedCallback> connect_callback) OVERRIDE; virtual int32_t GetHandle(int32_t* handle) OVERRIDE; + // Returns the URL of the document this plug-in runs in. This is necessary to + // decide whether to grant access to the PPAPI broker. + GURL GetDocumentUrl(); + void BrokerConnected(int32_t handle, int32_t result); private: |