Bug 49836 - Add WebKit2 API relevant to customization of context menus
Summary: Add WebKit2 API relevant to customization of context menus
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-19 15:09 PST by Brady Eidson
Modified: 2010-11-19 16:38 PST (History)
0 users

See Also:


Attachments
Patch v1 (15.69 KB, patch)
2010-11-19 15:13 PST, Brady Eidson
darin: review-
beidson: commit-queue-
Details | Formatted Diff | Diff
Second patch v1 (3.28 KB, patch)
2010-11-19 16:07 PST, Brady Eidson
darin: review+
beidson: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2010-11-19 15:09:14 PST
Add WebKit2 API relevant to customization of context menus
Comment 1 Brady Eidson 2010-11-19 15:13:20 PST
Created attachment 74428 [details]
Patch v1
Comment 2 Brady Eidson 2010-11-19 15:21:34 PST
Comment on attachment 74428 [details]
Patch v1

Left something out accidentally, stay tuned
Comment 3 Brady Eidson 2010-11-19 15:24:42 PST
Comment on attachment 74428 [details]
Patch v1

Whoops, nope, this is the one I meant to post
Comment 4 Darin Adler 2010-11-19 15:25:50 PST
Comment on attachment 74428 [details]
Patch v1

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

review- because of the leak

> WebKit2/Shared/WebURLRequest.h:47
> +    static PassRefPtr<WebURLRequest> create(const WebCore::KURL& url);

Should leave argument name out here.

> WebKit2/Shared/API/c/WKURLRequest.cpp:40
> +    return toAPI(WebURLRequest::create(toImpl(url)->string()).leakRef());

Can you use toCopiedURLAPI here?

> WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:199
> +    if (equalIgnoringCase(url.protocol(), "file"))
> +        return true;

You should use the isLocalFile member function.

> WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:206
> +    NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];

You need to release this request, otherwise it will leak.

> WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:207
> +    [request setValue:(NSString*)(userAgent()) forHTTPHeaderField:@"User-Agent"];

Extra parentheses here around userAgent().

> WebKit2/WebProcess/WebPage/mac/WebPageMac.mm:219
> +    String scheme = request.url().protocol();
> +    // FIXME: Return true if this scheme is any one WebKit2 knows how to handle.
> +    return equalIgnoringCase(scheme, "applewebdata");

This should use the protocolIs.
Comment 5 Brady Eidson 2010-11-19 15:41:16 PST
Darin reviewed my fixing his comments over my shoulder.  Landed in r72446
Comment 6 Brady Eidson 2010-11-19 15:57:05 PST
Yup, I meant to include one other set of changes.  Another patch coming.
Comment 7 Brady Eidson 2010-11-19 16:07:52 PST
Created attachment 74438 [details]
Second patch v1
Comment 8 Brady Eidson 2010-11-19 16:38:59 PST
r72451