Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 29335462: Issue 3337 - Update adblockplus reference in libadblockplus to revision hg:813682c7161e (Closed)
Patch Set: Created Feb. 3, 2016, 1:26 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ensure_dependencies.py ('k') | lib/api.js » ('j') | test/FilterEngine.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FilterEngine.h
diff --git a/include/AdblockPlus/FilterEngine.h b/include/AdblockPlus/FilterEngine.h
index 96ca0506f8eba94de74dd67b4329498fb6e27400..b81828907428f76df05c6a9761871cf9fdea0ad0 100644
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -150,15 +150,28 @@ namespace AdblockPlus
{
public:
// Make sure to keep ContentType in sync with FilterEngine::contentTypes
+ // and with RegExpFilter.typeMap from filterClasses.js.
/**
* Possible resource content types.
*/
- enum ContentType {CONTENT_TYPE_OTHER, CONTENT_TYPE_SCRIPT,
- CONTENT_TYPE_IMAGE, CONTENT_TYPE_STYLESHEET,
- CONTENT_TYPE_OBJECT, CONTENT_TYPE_SUBDOCUMENT,
- CONTENT_TYPE_DOCUMENT, CONTENT_TYPE_XMLHTTPREQUEST,
- CONTENT_TYPE_OBJECT_SUBREQUEST, CONTENT_TYPE_FONT,
- CONTENT_TYPE_MEDIA, CONTENT_TYPE_ELEMHIDE};
+ enum ContentType
+ {
+ CONTENT_TYPE_OTHER = 1,
+ CONTENT_TYPE_SCRIPT = 2,
+ CONTENT_TYPE_IMAGE = 4,
+ CONTENT_TYPE_STYLESHEET = 8,
+ CONTENT_TYPE_OBJECT = 16,
+ CONTENT_TYPE_SUBDOCUMENT = 32,
+ CONTENT_TYPE_DOCUMENT = 64,
+ CONTENT_TYPE_PING = 1024,
+ CONTENT_TYPE_XMLHTTPREQUEST = 2048,
+ CONTENT_TYPE_OBJECT_SUBREQUEST = 4096,
+ CONTENT_TYPE_MEDIA = 16384,
+ CONTENT_TYPE_FONT = 32768,
+ CONTENT_TYPE_GENERICBLOCK = 0x20000000,
+ CONTENT_TYPE_ELEMHIDE = 0x40000000,
+ CONTENT_TYPE_GENERICHIDE = 0x80000000
+ };
/**
* Callback type invoked when an update becomes available.
@@ -269,7 +282,7 @@ namespace AdblockPlus
/**
* Checks if any active filter matches the supplied URL.
* @param url URL to match.
- * @param contentType Content type of the requested resource.
+ * @param contentTypeMask Content type mask of the requested resource.
* @param documentUrl URL of the document requesting the resource.
* Note that there will be more than one document if frames are
* involved, see
@@ -278,13 +291,13 @@ namespace AdblockPlus
* @throw `std::invalid_argument`, if an invalid `contentType` was supplied.
*/
FilterPtr Matches(const std::string& url,
- ContentType contentType,
+ int32_t contentTypeMask,
Eric 2016/02/09 15:43:03 It would seem better to use uint32_t here, given t
sergei 2016/02/09 17:15:47 Yes, however it will be converted into signed inte
const std::string& documentUrl) const;
/**
* Checks if any active filter matches the supplied URL.
* @param url URL to match.
- * @param contentType Content type of the requested resource.
+ * @param contentTypeMask Content type mask of the requested resource.
* @param documentUrls Chain of documents requesting the resource, starting
* with the current resource's parent frame, ending with the
* top-level frame.
@@ -295,7 +308,7 @@ namespace AdblockPlus
* @throw `std::invalid_argument`, if an invalid `contentType` was supplied.
*/
FilterPtr Matches(const std::string& url,
- ContentType contentType,
+ int32_t contentTypeMask,
const std::vector<std::string>& documentUrls) const;
/**
@@ -429,7 +442,7 @@ namespace AdblockPlus
void InitDone(JsValueList& params);
FilterPtr CheckFilterMatch(const std::string& url,
- ContentType contentType,
+ int32_t contentTypeMask,
const std::string& documentUrl) const;
void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params);
void UpdateCheckDone(const std::string& eventName,
@@ -438,9 +451,9 @@ namespace AdblockPlus
void ShowNotification(const ShowNotificationCallback& callback,
const JsValueList& params);
FilterPtr GetWhitelistingFilter(const std::string& url,
- ContentType contentType, const std::string& documentUrl) const;
+ int32_t contentTypeMask, const std::string& documentUrl) const;
FilterPtr GetWhitelistingFilter(const std::string& url,
- ContentType contentType,
+ int32_t contentTypeMask,
const std::vector<std::string>& documentUrls) const;
};
}
« no previous file with comments | « ensure_dependencies.py ('k') | lib/api.js » ('j') | test/FilterEngine.cpp » ('J')

Powered by Google App Engine
This is Rietveld