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

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
« no previous file with comments | « content/public/browser/web_contents_observer.cc ('k') | content/renderer/pepper/pepper_broker_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6ac31bb196bb761d6d8298726a289cd074c324a3 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;
+ // Adds a pending connection to the broker. Balances out Disconnect() calls.
+ void AddPendingConnect(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(int error_code);
+
+ // 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.
« no previous file with comments | « content/public/browser/web_contents_observer.cc ('k') | content/renderer/pepper/pepper_broker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698