Page Speed Optimization Libraries
1.13.35.1
|
Public Member Functions | |
HtmlResourceSlot (const ResourcePtr &resource, HtmlElement *element, HtmlElement::Attribute *attribute, RewriteDriver *driver) | |
virtual HtmlElement * | element () const |
Return HTML element associated with slot, or NULL if none (CSS, IPRO) | |
HtmlElement::Attribute * | attribute () const |
virtual void | Render () |
virtual GoogleString | LocationString () const |
virtual bool | DirectSetUrl (const StringPiece &url) |
virtual bool | CanDirectSetUrl () |
UrlRelativity | url_relativity () 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 () |
RewriteContext * | LastContext () 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 | |
REFCOUNT_FRIEND_DECLARATION (HtmlResourceSlot) | |
Protected Member Functions inherited from net_instaweb::ResourceSlot | |
REFCOUNT_FRIEND_DECLARATION (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) |
|
inlinevirtual |
Returns true if DirectSetUrl is supported by this slot (html and css right now).
Reimplemented from net_instaweb::ResourceSlot.
|
virtual |
Update the URL in the slot target without touching the resource. This is intended for when we're inlining things as data: URLs and also for placing the rewritten version of the URL in the slot. The method returns true if it successfully updates the slot target. Resources that are not explicitly authorized will get rejected at this point. 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 |
Returns a human-readable description of where this slot occurs, for use in log messages.
Implements net_instaweb::ResourceSlot.
|
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.
|
inline |
How relative the original URL was. If PreserveUrlRelativity is enabled, Render will try to make the final URL just as relative.