Bug 138987 - Add cancelable version of willSendRequest
Summary: Add cancelable version of willSendRequest
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Vicki Pfau
URL:
Keywords: InRadar
Depends on:
Blocks: 138675
  Show dependency treegraph
 
Reported: 2014-11-21 15:26 PST by Vicki Pfau
Modified: 2014-12-01 20:28 PST (History)
3 users (show)

See Also:


Attachments
Patch (4.68 KB, patch)
2014-11-21 15:31 PST, Vicki Pfau
no flags Details | Formatted Diff | Diff
Patch (4.66 KB, patch)
2014-11-21 16:27 PST, Vicki Pfau
andersca: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vicki Pfau 2014-11-21 15:26:41 PST
In some cases, we need a way to asynchronously cancel pending loads. Patch incoming.
Comment 1 Vicki Pfau 2014-11-21 15:31:04 PST
Created attachment 242083 [details]
Patch
Comment 2 Anders Carlsson 2014-11-21 15:37:40 PST
Comment on attachment 242083 [details]
Patch

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

> Source/WebCore/loader/ResourceLoader.cpp:289
> +void ResourceLoader::maybeSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse, std::function<void(ResourceRequest&, bool)> callback)

Weren't you going to make ResourceRequest be null instead of having a boolean flag?
Comment 3 Vicki Pfau 2014-11-21 15:39:11 PST
(In reply to comment #2)
> Comment on attachment 242083 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=242083&action=review
> 
> > Source/WebCore/loader/ResourceLoader.cpp:289
> > +void ResourceLoader::maybeSendRequest(ResourceRequest& request, const ResourceResponse& redirectResponse, std::function<void(ResourceRequest&, bool)> callback)
> 
> Weren't you going to make ResourceRequest be null instead of having a
> boolean flag?

Yes...I think that version of the patch must have gotten lost on my other computer. Will fix now.
Comment 4 Vicki Pfau 2014-11-21 16:27:01 PST
Created attachment 242092 [details]
Patch
Comment 5 Anders Carlsson 2014-12-01 17:25:12 PST
Comment on attachment 242092 [details]
Patch

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

> Source/WebCore/loader/ResourceLoader.h:96
> +    virtual void maybeSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse, std::function<void(ResourceRequest&)> callback);

I think you should either call this willSendRequest or willSendRequestAsync. It should also take a ResourceRequest&&.
Comment 6 Vicki Pfau 2014-12-01 17:37:12 PST
(In reply to comment #5)
> Comment on attachment 242092 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=242092&action=review
> 
> > Source/WebCore/loader/ResourceLoader.h:96
> > +    virtual void maybeSendRequest(ResourceRequest&, const ResourceResponse& redirectResponse, std::function<void(ResourceRequest&)> callback);
> 
> I think you should either call this willSendRequest or willSendRequestAsync.
> It should also take a ResourceRequest&&.

I wanted to call it willSendRequestAsync, but due to C++ overloading rules and the fact that there's already a function called that that's protected, with a different signature, it didn't let me.

I'll change the signature though.
Comment 7 Vicki Pfau 2014-12-01 18:54:08 PST
<rdar://problem/19110616>
Comment 8 Vicki Pfau 2014-12-01 20:28:02 PST
Committed r176626: <http://trac.webkit.org/changeset/176626>