RESOLVED FIXED 103846
Add ObjC API for setting initialization data for the WKWebProcessPlugIn
https://bugs.webkit.org/show_bug.cgi?id=103846
Summary Add ObjC API for setting initialization data for the WKWebProcessPlugIn
Sam Weinig
Reported 2012-12-02 16:48:21 PST
Add ObjC API for setting initialization data for the WKWebProcessPlugIn
Attachments
Patch (7.11 KB, patch)
2012-12-02 16:53 PST, Sam Weinig
no flags
Patch (7.12 KB, patch)
2012-12-02 16:58 PST, Sam Weinig
darin: review+
Sam Weinig
Comment 1 2012-12-02 16:53:24 PST
Sam Weinig
Comment 2 2012-12-02 16:58:27 PST
Darin Adler
Comment 3 2012-12-03 09:58:20 PST
Comment on attachment 177163 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=177163&action=review > Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm:76 > + if ([processGroup.delegate respondsToSelector:@selector(processGroupWillCreateConnectionToWebProcessPlugIn:)]) { I suggest using early return here instead of nesting everything inside an if statement. > Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm:78 > + RetainPtr<id> initializationUserData = [processGroup.delegate processGroupWillCreateConnectionToWebProcessPlugIn:processGroup]; > + RefPtr<WebKit::ObjCObjectGraph> wkMessageBody = WebKit::ObjCObjectGraph::create(initializationUserData.get()); I don’t think we need a RetainPtr for the return value from a method that is just passed on to another function and then dropped. I suggest either using the type "id" here instead, or not using a local variable at all. Also, why is the message body called wkMessageBody instead of just body or messageBody? > Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm:79 > + return (WKTypeRef)wkMessageBody.release().leakRef(); Can we come up with some type checked cast for use in cases like this rather than using a straight C cast? > Source/WebKit2/UIProcess/API/mac/WKProcessGroup.mm:85 > +static void setUpInectedBundleClient(WKProcessGroup *processGroup, WKContextRef contextRef) Typo here: "inected". > Source/WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:114 > + RetainPtr<id> objCInitializationUserData; > + if (initializationUserData && initializationUserData->type() == APIObject::TypeObjCObjectGraph) > + objCInitializationUserData = static_cast<ObjCObjectGraph*>(initializationUserData)->rootObject(); > + [instance webProcessPlugIn:[WKWebProcessPlugInController _shared] initializeWithObject:objCInitializationUserData.get()]; Use of RetainPtr is OK here if the return type of rootObject is a RetainPtr. But if not, then I suggest just using "id" rather than "RetainPtr<id>".
Sam Weinig
Comment 4 2013-04-13 19:11:28 PDT
Note You need to log in before you can comment on or make changes to this bug.