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

#include "association_transformer.h"

Inheritance diagram for net_instaweb::AssociationSlot:
net_instaweb::ResourceSlot net_instaweb::RefCounted< ResourceSlot > RefCountedThreadSafe

List of all members.

Public Member Functions

 AssociationSlot (ResourcePtr resource, StringStringMap *map, const StringPiece &key)
 Note: map must outlive AssociationSlot.
virtual void Render ()
virtual void DirectSetUrl (const StringPiece &url)
virtual GoogleString LocationString ()

Detailed Description

Extremely simple slot which just sets an association in a std::map when it is Render()ed. It associates the key (input URL) with this slot's resource URL (the output URL). Can be used to set AssociationTransformer::map() so that AssocitationTransformer::Transform() will rewrite the rendered URLs.


Member Function Documentation

virtual void net_instaweb::AssociationSlot::DirectSetUrl ( const StringPiece &  url) [inline, virtual]

Update the URL in the slot target without touching the resource. This is intended for when we're inlining things as data: URLs. Note that if you call this you should also call set_disable_rendering(true), or otherwise the result will be overwritten. Does not alter the URL in any way. Not supported on all slot types --- presently only slots representing things within CSS and HTML have this operation (others will DCHECK-fail). Must be called from within a context's Render() method.

Reimplemented from net_instaweb::ResourceSlot.

Returns a human-readable description of where this slot occurs, for use in log messages.

Todo:
TODO(sligocki): Improve quality of this diagnostic. Also improve CssResourceSlot::LocationString() which is identical.

Implements net_instaweb::ResourceSlot.

virtual void net_instaweb::AssociationSlot::Render ( ) [inline, virtual]

All Render() calls are from the same thread, so this doesn't need to be thread-safe.

Implements net_instaweb::ResourceSlot.


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