RESOLVED FIXED Bug 132308
Shortcircuit shouldUseCredentialStorage callback
https://bugs.webkit.org/show_bug.cgi?id=132308
Summary Shortcircuit shouldUseCredentialStorage callback
Pratik Solanki
Reported 2014-04-28 15:59:13 PDT
If we are going to tell CFNetwork to use the credential storage then we don't really need a callback from them. Default answer is true.
Attachments
Patch (4.10 KB, patch)
2014-04-28 16:02 PDT, Pratik Solanki
no flags
Patch (9.47 KB, patch)
2014-05-01 22:52 PDT, Pratik Solanki
no flags
Patch (17.61 KB, patch)
2014-05-02 13:57 PDT, Pratik Solanki
ap: review+
For the bots (27.67 KB, patch)
2014-05-02 17:39 PDT, Pratik Solanki
no flags
Pratik Solanki
Comment 1 2014-04-28 16:02:58 PDT
Brady Eidson
Comment 2 2014-04-28 16:29:47 PDT
Comment on attachment 230330 [details] Patch Why is this important for ResourceHandleCF but not ResourceHandleMac?
Pratik Solanki
Comment 3 2014-04-28 17:03:43 PDT
(In reply to comment #2) > (From update of attachment 230330 [details]) > Why is this important for ResourceHandleCF but not ResourceHandleMac? How would we do this for ResourceHandleMac? How do we dynamically remove the objc method -[WebCoreResourceHandleAsOperationQueueDelegate connectionShouldUseCredentialStorage:]? We should do it for ResourceHandleMac if it is possible.
Pratik Solanki
Comment 4 2014-04-28 17:41:10 PDT
Comment on attachment 230330 [details] Patch Marking for review again unless someone has an idea for how to do this for ResourceHandleMac.
Brady Eidson
Comment 5 2014-04-28 18:22:50 PDT
(In reply to comment #3) > (In reply to comment #2) > > (From update of attachment 230330 [details] [details]) > > Why is this important for ResourceHandleCF but not ResourceHandleMac? > > How would we do this for ResourceHandleMac? How do we dynamically remove the objc method -[WebCoreResourceHandleAsOperationQueueDelegate connectionShouldUseCredentialStorage:]? We should do it for ResourceHandleMac if it is possible. You don't dynamically *remove* the objective-C method. You either dynamically *add* the method (which is possible, if not a little dirty), or you have a base-class delegate without the method, then subclass to add the method, and choose which class to instantiate.
Brady Eidson
Comment 6 2014-04-28 18:23:16 PDT
Comment on attachment 230330 [details] Patch I listed two ways this could be done for Mac in a comment.
Pratik Solanki
Comment 7 2014-05-01 22:52:43 PDT
Alexey Proskuryakov
Comment 8 2014-05-02 10:20:37 PDT
Comment on attachment 230653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=230653&action=review > Source/WebCore/ChangeLog:4 > + Shortcircuit shouldUseCredentialStorage callback > + https://bugs.webkit.org/show_bug.cgi?id=132308 This looks like a good idea to me. The code is very confusing, so I think that this change should balance that by cleaning up at least some of the cruft right away. In particular, shouldn't shouldUseCredentialStorageAsync be eliminated? As we hardcode the answer (in NetworkProcess) by either providing or not providing a callback, all this complicated machinery is essentially dead code. > Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:338 > +- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection This function looks like it should always return NO (or YES? I'm confused). Is there a reason to still jump to the main thread?
Pratik Solanki
Comment 9 2014-05-02 13:29:58 PDT
Comment on attachment 230653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=230653&action=review >> Source/WebCore/ChangeLog:4 >> + https://bugs.webkit.org/show_bug.cgi?id=132308 > > This looks like a good idea to me. > > The code is very confusing, so I think that this change should balance that by cleaning up at least some of the cruft right away. In particular, shouldn't shouldUseCredentialStorageAsync be eliminated? As we hardcode the answer (in NetworkProcess) by either providing or not providing a callback, all this complicated machinery is essentially dead code. That's true. I realized that and was going to do in a followup path but maybe I can just clean this up now. Will definitely be easier. >> Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:338 >> +- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection > > This function looks like it should always return NO (or YES? I'm confused). > > Is there a reason to still jump to the main thread? Yeah, we don't need to jump to main thread. We can just return NO.
Pratik Solanki
Comment 10 2014-05-02 13:57:10 PDT
Alexey Proskuryakov
Comment 11 2014-05-02 14:56:42 PDT
Comment on attachment 230694 [details] Patch r=me Please unbreak the builds before landing.
Pratik Solanki
Comment 12 2014-05-02 17:39:00 PDT
Created attachment 230723 [details] For the bots Updated patch for the bots. I also removed continueShouldUseCredentialStorage() with this version.
Pratik Solanki
Comment 13 2014-05-03 17:06:24 PDT
Pratik Solanki
Comment 14 2014-05-03 17:18:04 PDT
Andreas Kling
Comment 15 2014-05-03 22:42:30 PDT
Mavericks WK2 Debug is crashing on a couple of tests after this change: http://build.webkit.org/builders/Apple%20Mavericks%20Debug%20WK2%20%28Tests%29/builds/4408 Could you take a look, or should we roll it out?
WebKit Commit Bot
Comment 16 2014-05-03 23:24:20 PDT
Re-opened since this is blocked by bug 132543
Pratik Solanki
Comment 17 2014-05-04 15:54:26 PDT
Note You need to log in before you can comment on or make changes to this bug.