RESOLVED FIXED 117090
Need the ability to get the information for a plug-in with a particular process id that may be running on a page
https://bugs.webkit.org/show_bug.cgi?id=117090
Summary Need the ability to get the information for a plug-in with a particular proce...
Jessie Berlin
Reported 2013-05-31 13:35:14 PDT
Attachments
Patch (20.73 KB, patch)
2013-05-31 13:56 PDT, Jessie Berlin
andersca: review+
webkit-ews: commit-queue-
Patch (with build fixes) (20.74 KB, patch)
2013-05-31 14:16 PDT, Jessie Berlin
no flags
Jessie Berlin
Comment 1 2013-05-31 13:56:57 PDT
Early Warning System Bot
Comment 2 2013-05-31 14:03:04 PDT
EFL EWS Bot
Comment 3 2013-05-31 14:04:01 PDT
Jessie Berlin
Comment 4 2013-05-31 14:16:37 PDT
Created attachment 203466 [details] Patch (with build fixes)
Anders Carlsson
Comment 5 2013-05-31 14:19:06 PDT
Comment on attachment 203465 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=203465&action=review > Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm:496 > + if (!pluginProcessProxy) { > + callback->invalidate(); > + return; > + } I think this can be an assertion. > Source/WebKit2/WebProcess/WebPage/WebPage.h:354 > + void containsPlugInsWithProcessToken(uint64_t plugInProcessToken, uint64_t callbackID); Maybe call this containsPluginViewsWithPluginProcessToken to match the other two member functions.
Jessie Berlin
Comment 6 2013-05-31 14:53:16 PDT
(In reply to comment #5) > (From update of attachment 203465 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=203465&action=review > > > Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm:496 > > + if (!pluginProcessProxy) { > > + callback->invalidate(); > > + return; > > + } > > I think this can be an assertion. Done (removed the call to invalidate and the early return and replaced it with an assertion). > > > Source/WebKit2/WebProcess/WebPage/WebPage.h:354 > > + void containsPlugInsWithProcessToken(uint64_t plugInProcessToken, uint64_t callbackID); > > Maybe call this containsPluginViewsWithPluginProcessToken to match the other two member functions. Done. For those watching at home. Anders r+’d the second version of the patch with these same considerations.
Jessie Berlin
Comment 7 2013-05-31 15:01:32 PDT
Comment on attachment 203466 [details] Patch (with build fixes) Committed in http://trac.webkit.org/changeset/151043
Darin Adler
Comment 8 2013-05-31 15:05:41 PDT
Comment on attachment 203466 [details] Patch (with build fixes) View in context: https://bugs.webkit.org/attachment.cgi?id=203466&action=review I know Anders already reviewed it, but I did too. r=me > Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.h:39 > +typedef void (^WKPageGetInformationForPlugInWithProcessIDBlock)(WKDictionaryRef, WKErrorRef); > +WK_EXPORT void WKPageGetInformationForPlugInWithProcessID(WKPageRef, pid_t plugInProcessID, WKPageGetInformationForPlugInWithProcessIDBlock); I think these names are too wordy. How about PlugInInformation instead of InformationForPlugIn and omitting WithProcessID. Do we need other GetPlugInInformation functions that don’t take a process ID? > Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h:67 > + PluginProcessProxy* plugInProcessWithProcessID(pid_t plugInProcessID) const; > + PluginProcessProxy* plugInProcessWithToken(uint64_t plugInProcessToken) const; The naming here seems sort of “Cocoa method style”. I would probably have called these findPlugInProcessByID and findPlugInProcessByToken. > Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm:475 > + m_plugInInformationCallbacks.set(callbackID, callback.get()); Should be callback.release() rather than callback.get(). > Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.h:194 > + virtual uint64_t plugInProcessToken() const OVERRIDE { return 0; } Why protected instead of private?
Jessie Berlin
Comment 9 2013-05-31 15:46:38 PDT
(In reply to comment #8) > (From update of attachment 203466 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=203466&action=review > > I know Anders already reviewed it, but I did too. r=me > > > Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.h:39 > > +typedef void (^WKPageGetInformationForPlugInWithProcessIDBlock)(WKDictionaryRef, WKErrorRef); > > +WK_EXPORT void WKPageGetInformationForPlugInWithProcessID(WKPageRef, pid_t plugInProcessID, WKPageGetInformationForPlugInWithProcessIDBlock); > > I think these names are too wordy. How about PlugInInformation instead of InformationForPlugIn and omitting WithProcessID. Do we need other GetPlugInInformation functions that don’t take a process ID? I modeled this a bit off of WKContextGetInfoForInstalledPlugIns in WKContextPrivateMac.h, which does not take a process ID. However, I am fine with PlugInInformation given that the type of the argument is clearly pid_t. > > > Source/WebKit2/UIProcess/Plugins/PluginProcessManager.h:67 > > + PluginProcessProxy* plugInProcessWithProcessID(pid_t plugInProcessID) const; > > + PluginProcessProxy* plugInProcessWithToken(uint64_t plugInProcessToken) const; > > The naming here seems sort of “Cocoa method style”. I would probably have called these findPlugInProcessByID and findPlugInProcessByToken. Will do. > > > Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm:475 > > + m_plugInInformationCallbacks.set(callbackID, callback.get()); > > Should be callback.release() rather than callback.get(). Will fix. > > > Source/WebKit2/WebProcess/Plugins/PDF/SimplePDFPlugin.h:194 > > + virtual uint64_t plugInProcessToken() const OVERRIDE { return 0; } > > Why protected instead of private? I will make it private. I already committed the patch. rs=you on these changes? Thanks!
Jessie Berlin
Comment 10 2013-05-31 18:11:53 PDT
Committed the follow-up patch with a rubber-stamp from Anders in http://trac.webkit.org/changeset/151054
Note You need to log in before you can comment on or make changes to this bug.