Bug 136325 - Pass the resource identifier in willSendRequest callback; and pass pageIsProvisionallyLoading flag in didInitiateLoadForResource.
Summary: Pass the resource identifier in willSendRequest callback; and pass pageIsProv...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-27 17:29 PDT by Yongjun Zhang
Modified: 2014-09-02 16:09 PDT (History)
5 users (show)

See Also:


Attachments
Patch. (4.97 KB, patch)
2014-08-27 17:33 PDT, Yongjun Zhang
no flags Details | Formatted Diff | Diff
Fix style issue. (4.61 KB, patch)
2014-08-27 17:45 PDT, Yongjun Zhang
no flags Details | Formatted Diff | Diff
Revise patch; falls back to old delegate methods if the new ones are not implemented by a client. (8.23 KB, patch)
2014-08-29 16:38 PDT, Yongjun Zhang
no flags Details | Formatted Diff | Diff
Fi style issues. (7.26 KB, patch)
2014-09-02 14:06 PDT, Yongjun Zhang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yongjun Zhang 2014-08-27 17:29:02 PDT
The delegate method webProcessPlugInBrowserContextController:frame:willSendRequest:redirectResponse: in WKWebProcessPlugInLoadDelegate doesn't pass the resource identifier, we should add it back, like we did with didInitialLoadForResource: method.
Comment 1 Yongjun Zhang 2014-08-27 17:33:22 PDT
Created attachment 237274 [details]
Patch.
Comment 2 WebKit Commit Bot 2014-08-27 17:36:13 PDT
Attachment 237274 [details] did not pass style-queue:


ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:234:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:236:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:237:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 3 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Yongjun Zhang 2014-08-27 17:45:42 PDT
Created attachment 237275 [details]
Fix style issue.
Comment 4 Darin Adler 2014-08-29 10:03:27 PDT
Comment on attachment 237275 [details]
Fix style issue.

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

> Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:54
> +- (NSURLRequest *)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame willSendRequestForResource:(uint64_t)resource request:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;

How can we just change a protocol like this in public API? Don’t we need to keep existing clients compatible? I think there’s a pattern we need to follow here to deprecate an old method signature and replace it with a new one, calling the old one if the new one isn’t present.

Or maybe this isn’t public API yet?
Comment 5 Yongjun Zhang 2014-08-29 10:55:48 PDT
(In reply to comment #4)
> (From update of attachment 237275 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=237275&action=review
> 
> > Source/WebKit2/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:54
> > +- (NSURLRequest *)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame willSendRequestForResource:(uint64_t)resource request:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse;
> 
> How can we just change a protocol like this in public API? Don’t we need to keep existing clients compatible? I think there’s a pattern we need to follow here to deprecate an old method signature and replace it with a new one, calling the old one if the new one isn’t present.
> 
> Or maybe this isn’t public API yet?

No, this is not public API yet and it is subject to change.  That said, I think it is better to follow the staging pattern that falls back to old signature if the new method isn't implemented by the delegate.  And we can remove the check when all client are moving to the new method.
Comment 6 Yongjun Zhang 2014-08-29 16:38:41 PDT
Created attachment 237389 [details]
Revise patch; falls back to old delegate methods if the new ones are not implemented by a client.
Comment 7 WebKit Commit Bot 2014-08-29 16:44:58 PDT
Attachment 237389 [details] did not pass style-queue:


ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:234:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:236:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:237:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:244:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:245:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:246:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:263:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
ERROR: Source/WebKit2/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:265:  Weird number of spaces at line-start.  Are you using a 4-space indent?  [whitespace/indent] [3]
Total errors found: 8 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 8 Yongjun Zhang 2014-09-02 14:06:10 PDT
Created attachment 237513 [details]
Fi style issues.
Comment 9 WebKit Commit Bot 2014-09-02 16:09:15 PDT
Comment on attachment 237513 [details]
Fi style issues.

Clearing flags on attachment: 237513

Committed r173191: <http://trac.webkit.org/changeset/173191>
Comment 10 WebKit Commit Bot 2014-09-02 16:09:18 PDT
All reviewed patches have been landed.  Closing bug.