Chromium Code Reviews| Index: content/renderer/pepper/pepper_broker_impl.h |
| diff --git a/content/renderer/pepper/pepper_broker_impl.h b/content/renderer/pepper/pepper_broker_impl.h |
| index 091000ef8915c44b1d56e12f2b6f3d737a56f6d7..aecc56ad07af0884ea5c89840691fb7da164f042 100644 |
| --- a/content/renderer/pepper/pepper_broker_impl.h |
| +++ b/content/renderer/pepper/pepper_broker_impl.h |
| @@ -53,32 +53,46 @@ class PepperBrokerImpl : public webkit::ppapi::PluginDelegate::Broker, |
| PepperBrokerImpl(webkit::ppapi::PluginModule* plugin_module, |
| PepperPluginDelegateImpl* delegate_); |
| - // PepperBroker implementation. |
| - virtual void Connect(webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE; |
| + // webkit::ppapi::PluginDelegate::Broker implementation. |
| virtual void Disconnect(webkit::ppapi::PPB_Broker_Impl* client) OVERRIDE; |
| + // Called to balance out Disconnect() calls. |
| + void Connect(webkit::ppapi::PPB_Broker_Impl* client); |
| + |
| // Called when the channel to the broker has been established. |
| void OnBrokerChannelConnected(const IPC::ChannelHandle& channel_handle); |
| - // Connects the plugin to the broker via a pipe. |
| - void ConnectPluginToBroker(webkit::ppapi::PPB_Broker_Impl* client); |
| + // Called when we know whether permission to access the PPAPI broker was |
| + // granted. |
| + void OnBrokerPermissionResult(webkit::ppapi::PPB_Broker_Impl* client, |
| + bool result); |
| - // Asynchronously sends a pipe to the broker. |
| - int32_t SendHandleToBroker(PP_Instance instance, |
| - base::SyncSocket::Handle handle); |
| - |
| - protected: |
| + private: |
| friend class base::RefCountedThreadSafe<PepperBrokerImpl>; |
| + struct PendingConnection { |
| + PendingConnection(); |
| + ~PendingConnection(); |
| + |
| + bool authorized; |
|
ddorwin
2012/08/12 22:51:16
is_authorized
Bernhard Bauer
2012/08/13 09:02:12
Done.
|
| + base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> client; |
| + }; |
| + |
| virtual ~PepperBrokerImpl(); |
| + // Reports failure to all clients that had pending operations. |
| + void ReportFailureToClients(); |
| + |
| + // Connects the plugin to the broker via a pipe. |
| + void ConnectPluginToBroker(webkit::ppapi::PPB_Broker_Impl* client); |
| + |
| scoped_ptr<PepperBrokerDispatcherWrapper> dispatcher_; |
| // A map of pointers to objects that have requested a connection to the weak |
| // pointer we can use to reference them. The mapping is needed so we can clean |
| // up entries for objects that may have been deleted. |
| - typedef std::map<webkit::ppapi::PPB_Broker_Impl*, |
| - base::WeakPtr<webkit::ppapi::PPB_Broker_Impl> > ClientMap; |
| + typedef std::map<webkit::ppapi::PPB_Broker_Impl*, PendingConnection> |
| + ClientMap; |
| ClientMap pending_connects_; |
| // Pointer to the associated plugin module. |