Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2172)

Unified Diff: content/renderer/pepper/pepper_broker_impl.h

Issue 10854040: Add hooks to content to request permission to connect to the PPAPI broker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..bd0490a1844e201087c0f7ccf4bdf66fac991334 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.
ddorwin 2012/08/13 22:27:04 It also adds it to pending_connects_. The name see
Bernhard Bauer 2012/08/13 22:42:14 Done.
+ 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 is_authorized;
+ 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.

Powered by Google App Engine
This is Rietveld 408576698