Bug 125941

Summary: Add Obj C API for injected bundle PageGroup class.
Product: WebKit Reporter: Yongjun Zhang <yongjun_zhang>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: andersca, commit-queue, mitz, sam
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Add Obj C API (WKWebProcessPlugInPageGroup) for injected bundle PageGroup class.
none
Use _bundlePageGroup->identifier() directly, instead of going through WFStringRef wrapper.
mitz: review+
Fix style issue and address review comments before landing. none

Description Yongjun Zhang 2013-12-18 12:51:35 PST
Need an Obj C API for injected bundle PageGroup class, and a method to expose the page group object from WKWebProcessPlugInBrowsingContextController.
Comment 1 Yongjun Zhang 2013-12-18 12:57:18 PST
Created attachment 219562 [details]
Add Obj C API (WKWebProcessPlugInPageGroup) for injected bundle PageGroup class.
Comment 2 mitz 2013-12-18 13:21:45 PST
Comment on attachment 219562 [details]
Add Obj C API (WKWebProcessPlugInPageGroup) for injected bundle PageGroup class.

View in context: https://bugs.webkit.org/attachment.cgi?id=219562&action=review

> Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm:46
> +    WKStringRef string = toCopiedAPI(_bundlePageGroup->identifier());
> +    return [wrapper(*toImpl(string)) autorelease];

You should be able to just return _bundlePageGroup->identifier(), since WTF::String converts to an NSString *.
Comment 3 Yongjun Zhang 2013-12-18 14:08:47 PST
Created attachment 219566 [details]
Use _bundlePageGroup->identifier() directly, instead of going through WFStringRef wrapper.
Comment 4 mitz 2013-12-18 14:49:02 PST
Comment on attachment 219566 [details]
Use _bundlePageGroup->identifier() directly, instead of going through WFStringRef wrapper.

View in context: https://bugs.webkit.org/attachment.cgi?id=219566&action=review

> Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.h:35
> +- (NSString *)identifier;

This is probably better expressed as @property (readonly) NSString *identifier;

> Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInPageGroup.mm:34
> +#import "WKAPICast.h"
> +#import "WKNSString.h"
> +#import "WKRetainPtr.h"

Probably don’t need these anymore.

> Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.h:47
> +@property(readonly) WKWebProcessPlugInFrame *mainFrame;
> +
> +@property(readonly) WKWebProcessPlugInPageGroup *pageGroup;

There needs to be a space before the (, even though some existing code is wrong.
Comment 5 Yongjun Zhang 2013-12-18 15:11:37 PST
Created attachment 219576 [details]
Fix style issue and address review comments before landing.
Comment 6 WebKit Commit Bot 2013-12-18 15:47:02 PST
Comment on attachment 219576 [details]
Fix style issue and address review comments before landing.

Clearing flags on attachment: 219576

Committed r160803: <http://trac.webkit.org/changeset/160803>
Comment 7 WebKit Commit Bot 2013-12-18 15:47:04 PST
All reviewed patches have been landed.  Closing bug.