Page Speed Optimization Libraries  1.2.24.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::CssUrlEncoder Class Reference

#include "css_url_encoder.h"

Inheritance diagram for net_instaweb::CssUrlEncoder:
net_instaweb::UrlSegmentEncoder

List of all members.

Public Member Functions

virtual void Encode (const StringVector &urls, const ResourceContext *encoding, GoogleString *rewritten_url) const
virtual bool Decode (const StringPiece &url_segment, StringVector *urls, ResourceContext *dim, MessageHandler *handler) const

Detailed Description

This class implements the encoding of css urls with optional additional dimension metadata. It prepends characters indicating whether the user-agent allows for inlining or webp. We may need to employ distinct CSS files to these types of browsers. This information is conveyed in the ResourceContext. http://..path../W.cssfile... CSS file optimized for webp-capable browsers. http://..path../I.cssfile... CSS file optimzed for for non-webp browsers that inline. http://..path../A.cssfile... Archaic browser (ie6+7) does neither.

Note that a legacy CSS URL beginning with W., I., or A. will be misinterpreted and will not be fetchable since the Decode function will strip off the leading 2 characters.


Member Function Documentation

virtual bool net_instaweb::CssUrlEncoder::Decode ( const StringPiece &  url_segment,
StringVector *  urls,
ResourceContext *  out_data,
MessageHandler handler 
) const [virtual]

Decode URLs from "url_segment". Note that there may be other meta-data encoded in url_segment, which this function will write into out_data, if present.

Reimplemented from net_instaweb::UrlSegmentEncoder.

virtual void net_instaweb::CssUrlEncoder::Encode ( const StringVector &  urls,
const ResourceContext *  data,
GoogleString url_segment 
) const [virtual]

Encodes arbitrary text so it can be used in a url segment. A url segment must contain only characters that are legal in URLs, and exclude "/" and "." which are used for a higher level encoding scheme into which this must fit.

'data' is optional -- it can be NULL and it is up to the encoder to decide what to do.

Reimplemented from net_instaweb::UrlSegmentEncoder.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines