Page Speed Optimization Libraries
1.8.31.3
|
#include "association_transformer.h"
Public Member Functions | |
AssociationTransformer (const GoogleUrl *base_url, const RewriteOptions *options, CssTagScanner::Transformer *backup_transformer, MessageHandler *handler) | |
StringStringMap * | map () |
virtual TransformStatus | Transform (GoogleString *str) |
Transformer that uses a std::map to specify which URLs to rewrite to which other URLs. Used by CssFilter to rewrite subresources in CSS even when it cannot be parsed, by using AssociationSlots to update the map before transforming.
net_instaweb::AssociationTransformer::AssociationTransformer | ( | const GoogleUrl * | base_url, |
const RewriteOptions * | options, | ||
CssTagScanner::Transformer * | backup_transformer, | ||
MessageHandler * | handler | ||
) | [inline] |
base_url is the URL all CSS url()s should be absolutified against, this is generally the URL for the CSS file or HTML file for inline CSS. backup_transformer is another transformer to be applied if no association has been set in AssociationTransformer's map_. It may be set to NULL if no backup is needed.
base_url, options, backup_transformer and handler must live longer than AssociationTransformer.
StringStringMap* net_instaweb::AssociationTransformer::map | ( | ) | [inline] |
Map is exposed so that you can set associations. Each key -> value specifies that every instance of the absolute URL key should be transformed to the absolute URL value.
virtual TransformStatus net_instaweb::AssociationTransformer::Transform | ( | GoogleString * | str | ) | [virtual] |
To do the actual transformation. Call CssTagScanner::TransformUrls() with this AssociationTransformer which will call Transform() on all URLs. Transform will lookup all (absolutified) URLs in map_ and rewrite them if present (otherwise it will pass them to the backup_transformer_).
Implements net_instaweb::CssTagScanner::Transformer.