libadblockplus
 All Classes Namespaces Functions Variables Typedefs Enumerations Pages
Public Member Functions | List of all members
AdblockPlus::ReferrerMapping Class Reference

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...
 

Detailed Description

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().

Constructor & Destructor Documentation

AdblockPlus::ReferrerMapping::ReferrerMapping ( const int  maxCachedUrls = 5000)

Constructor.

Parameters
maxCachedUrlsNumber of URL mappings to store. The higher the better - clients typically cache requests, and a single cached request will break the referrer chain.

Member Function Documentation

void AdblockPlus::ReferrerMapping::Add ( const std::string &  url,
const std::string &  referrer 
)

Records the refferer for a URL.

Parameters
urlRequest URL.
referrerRequest 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.

Parameters
urlURL to build the chain for.
Returns
List of URLs, starting with url.

The documentation for this class was generated from the following file: