Index: include/AdblockPlus/ReferrerMapping.h |
=================================================================== |
--- a/include/AdblockPlus/ReferrerMapping.h |
+++ b/include/AdblockPlus/ReferrerMapping.h |
@@ -25,11 +25,34 @@ |
namespace AdblockPlus |
{ |
+ /** |
+ * Stores a mapping between URLs and their referrers. |
+ * This can be used to build a chain of referrers for any URL |
+ * (see `BuildReferrerChain()`), which approximates the frame structure. |
+ */ |
class ReferrerMapping |
{ |
public: |
+ /** |
+ * Constructor. |
+ * @param maxCachedUrls Number of URL mappings to store. The higher the |
+ * better - clients typically cache requests, and a single cached |
+ * request will break the referrer chain. |
+ */ |
ReferrerMapping(const int maxCachedUrls = 5000); |
+ |
+ /** |
+ * Adds a new mapping from URL to referrer. |
Wladimir Palant
2014/08/29 18:42:27
"Records the referrer for a URL"?
Felix Dahlke
2014/09/01 17:00:15
Done.
|
+ * @param url Request URL. |
+ * @param referrer Request referrer. |
+ */ |
void Add(const std::string& url, const std::string& referrer); |
+ |
+ /** |
+ * Builds the referrer chain for the supplied URL. |
Wladimir Palant
2014/08/29 18:42:27
"Reconstructs the URLs of parent frames for a docu
|
+ * @param url URL to build the chain for. |
+ * @return List of URLs, starting with `url`. |
+ */ |
std::vector<std::string> BuildReferrerChain(const std::string& url) const; |
private: |