Bug 143414

Summary: [Content Filtering] Tell the filter about requests and redirects
Product: WebKit Reporter: Andy Estes <aestes>
Component: New BugsAssignee: Andy Estes <aestes>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, ddkilzer, japhet, kling, mitz, mmaxfield, sam
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 128858, 143460    
Attachments:
Description Flags
Patch darin: review+

Description Andy Estes 2015-04-05 01:59:37 PDT
[Content Filtering] Tell the filter about requests and redirects
Comment 1 Andy Estes 2015-04-05 02:01:08 PDT
rdar://problem/19239549
Comment 2 Andy Estes 2015-04-05 02:15:13 PDT
Created attachment 250153 [details]
Patch
Comment 3 WebKit Commit Bot 2015-04-05 02:17:45 PDT
Attachment 250153 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/cocoa/NetworkExtensionContentFilter.mm:85:  Place brace on its own line for function definitions.  [whitespace/braces] [4]
Total errors found: 1 in 30 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 4 Darin Adler 2015-04-05 13:15:19 PDT
Comment on attachment 250153 [details]
Patch

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

> Source/WebCore/loader/DocumentLoader.cpp:541
> +        ASSERT(!newRequest.isNull());

Why do we assert this rather than handling this and having it cause cancellation/failure?
Comment 5 Andy Estes 2015-04-05 13:38:39 PDT
Comment on attachment 250153 [details]
Patch

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

>> Source/WebCore/loader/DocumentLoader.cpp:541
>> +        ASSERT(!newRequest.isNull());
> 
> Why do we assert this rather than handling this and having it cause cancellation/failure?

ContentFilter::willSendRequest() blocks by scheduling a substitute data load which cancels the in-progress load, but now that you mention it, it would make more sense to actually null out newRequest and cancel immediately. I'll do that instead.
Comment 6 Andy Estes 2015-04-05 17:24:39 PDT
Committed r182369: <http://trac.webkit.org/changeset/182369>
Comment 7 Myles C. Maxfield 2015-04-06 09:40:27 PDT
This made one test fail consistently on Win. https://build.webkit.org/builders/Apple%20Win%207%20Release%20(Tests)?numbuilds=50
Comment 8 Andy Estes 2015-04-06 17:31:17 PDT
https://bugs.webkit.org/show_bug.cgi?id=143460 tracks the Windows failure.