Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
net_instaweb::InlineResourceSlot Class Reference

#include "inline_resource_slot.h"

Inheritance diagram for net_instaweb::InlineResourceSlot:
net_instaweb::ResourceSlot net_instaweb::RefCounted< ResourceSlot >

Public Member Functions

 InlineResourceSlot (const ResourcePtr &resource, HtmlCharactersNode *char_node, StringPiece location)
virtual HtmlElementelement () const
virtual void Render ()
virtual GoogleString LocationString () const
- Public Member Functions inherited from net_instaweb::ResourceSlot
 ResourceSlot (const ResourcePtr &resource)
ResourcePtr resource () const
void SetResource (const ResourcePtr &resource)
void set_preserve_urls (bool x)
bool preserve_urls () const
void set_disable_rendering (bool x)
bool disable_rendering () const
void RequestDeleteElement ()
bool should_delete_element () const
bool was_optimized () const
void set_was_optimized (bool x)
 Marks the slot as having been optimized.
void set_disable_further_processing (bool x)
bool disable_further_processing () const
void set_need_aggregate_input_info (bool x)
bool need_aggregate_input_info () const
void ReportInput (const InputInfo &input)
const std::vector< InputInfo > * inputs () const
 may be nullptr.
virtual void Finished ()
virtual bool DirectSetUrl (const StringPiece &url)
virtual bool CanDirectSetUrl ()
RewriteContextLastContext () const
void AddContext (RewriteContext *context)
 Adds a new context to this slot.
void DetachContext (RewriteContext *context)
- Public Member Functions inherited from net_instaweb::RefCounted< ResourceSlot >
void Release ()
void AddRef ()
bool HasOneRef ()

Protected Member Functions

- Protected Member Functions inherited from net_instaweb::ResourceSlot

Additional Inherited Members

- Static Public Member Functions inherited from net_instaweb::ResourceSlot
static GoogleString RelativizeOrPassthrough (const RewriteOptions *options, StringPiece url, UrlRelativity url_relativity, const GoogleUrl &base_url)

Detailed Description

ResourceSlot for inline CSS or JS (which are the contents of a Characters block instead of being the result of an HTTP fetch). Note: Inline JS does not currently use this class. Instead it is rewritten in the parsing thread.

TODO(sligocki): This is currently being used for CSS attribute rewriting too. Use a separate Slot for that.

Constructor & Destructor Documentation

net_instaweb::InlineResourceSlot::InlineResourceSlot ( const ResourcePtr resource,
HtmlCharactersNode char_node,
StringPiece  location 
TODO(sligocki): Construct resource in this function??

Member Function Documentation

virtual HtmlElement* net_instaweb::InlineResourceSlot::element ( ) const

Debug information should be placed next to <style> or <script> block surrounding the Characters node.

Implements net_instaweb::ResourceSlot.

virtual GoogleString net_instaweb::InlineResourceSlot::LocationString ( ) const

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

Implements net_instaweb::ResourceSlot.

virtual void net_instaweb::InlineResourceSlot::Render ( )

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: