| Summary: | [Content Extensions] resource-type and load-type should be independent | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||
| Component: | WebCore Misc. | Assignee: | Alex Christensen <achristensen> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, japhet | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Alex Christensen
2015-06-01 15:08:48 PDT
Created attachment 254015 [details]
Patch
Comment on attachment 254015 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=254015&action=review > Source/WebCore/ChangeLog:8 > + Covered by existing tests and a new API test. IMHO, you should explain the bug here. Having the explanation in bugzilla is not enough. > Source/WebCore/contentextensions/DFABytecodeInterpreter.cpp:81 > + bool shouldAppendAction = false; > + if (shouldCheckLoadType && shouldCheckResourceType) > + shouldAppendAction = (flagsToCheck & LoadTypeMask & flags) && (flagsToCheck & ResourceTypeMask & flags); > + else if (shouldCheckLoadType) > + shouldAppendAction = flagsToCheck & LoadTypeMask & flags; > + else { > + ASSERT(shouldCheckResourceType); > + shouldAppendAction = flagsToCheck & ResourceTypeMask & flags; > + } What about: uint16_t loadTypeFlags = flagsToCheck & LoadTypeMask; uint16_t ressourceTypeFlags = flagsToCheck & ResourceTypeMask; bool loadTypeMatches = loadTypeFlags ? (loadTypeFlags & flags) : true; bool ressourceTypeMatches = ressourceTypeFlags ? (ressourceTypeFlags & flags) : true; if (loadTypeMatches && ressourceTypeMatches) ... |