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

A place storing a rewritable URL inside a CSS AST. More...

#include "css_resource_slot.h"

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

List of all members.

Public Member Functions

virtual void Render ()
virtual void Finished ()
virtual GoogleString LocationString ()
Css::Values * values () const
size_t value_index () const
void EnableTrim (const GoogleUrl &base_url)
 Enables trimming of URLs versus a given base.
virtual void DirectSetUrl (const StringPiece &url)
virtual bool CanDirectSetUrl ()

Protected Member Functions

 CssResourceSlot (const ResourcePtr &resource, Css::Values *values, size_t value_index)
 REFCOUNT_FRIEND_DECLARATION (CssResourceSlot)

Friends

class CssResourceSlotFactory

Detailed Description

A place storing a rewritable URL inside a CSS AST.


Member Function Documentation

virtual bool net_instaweb::CssResourceSlot::CanDirectSetUrl ( ) [inline, virtual]

Returns true if DirectSetUrl is supported by this slot (html and css right now).

Reimplemented from net_instaweb::ResourceSlot.

virtual void net_instaweb::CssResourceSlot::DirectSetUrl ( const StringPiece &  url) [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.

virtual void net_instaweb::CssResourceSlot::Finished ( ) [virtual]

Called after all contexts have had a chance to Render. This is especially useful for cases where Render was never called but you want something to be done to all slots.

Reimplemented from net_instaweb::ResourceSlot.

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

Implements net_instaweb::ResourceSlot.

virtual void net_instaweb::CssResourceSlot::Render ( ) [virtual]

Render is not thread-safe. This must be called from the thread that owns the DOM or CSS file. The RewriteContext state machine will only call ResourceSlot::Render() on slots that were optimized successfully, and whose partitions are safely url_relocatable(). (Note that this is different from RewriteContext::Render).

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