Stores a mapping between URLs and their referrers. More...
#include <ReferrerMapping.h>
Public Member Functions | |
ReferrerMapping (const int maxCachedUrls=5000) | |
Constructor. More... | |
void | Add (const std::string &url, const std::string &referrer) |
Records the refferer for a URL. More... | |
std::vector< std::string > | BuildReferrerChain (const std::string &url) const |
Builds a chain of referrers for the supplied URL. More... | |
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, see FilterEngine::Matches().
AdblockPlus::ReferrerMapping::ReferrerMapping | ( | const int | maxCachedUrls = 5000 | ) |
Constructor.
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. |
void AdblockPlus::ReferrerMapping::Add | ( | const std::string & | url, |
const std::string & | referrer | ||
) |
Records the refferer for a URL.
url | Request URL. |
referrer | Request referrer. |
std::vector<std::string> AdblockPlus::ReferrerMapping::BuildReferrerChain | ( | const std::string & | url | ) | const |
Builds a chain of referrers for the supplied URL.
This should reconstruct a document's parent frame URLs.
url | URL to build the chain for. |
url
.