net_instaweb::UrlInputResource Class Reference

Inheritance diagram for net_instaweb::UrlInputResource:
net_instaweb::Resource net_instaweb::RefCounted< Resource > RefCountedThreadSafe

List of all members.

Public Member Functions

 UrlInputResource (RewriteDriver *rewrite_driver, const RewriteOptions *options, const ContentType *type, const StringPiece &url)
virtual bool IsValidAndCacheable () const
virtual GoogleString url () const
 Gets the absolute URL of the resource.
virtual const RewriteOptionsrewrite_options () const
virtual void Freshen (FreshenCallback *callback, MessageHandler *handler)

Protected Member Functions

virtual bool Load (MessageHandler *message_handler)
virtual void LoadAndCallback (NotCacheablePolicy not_cacheable_policy, AsyncCallback *callback, MessageHandler *message_handler)

Member Function Documentation

virtual void net_instaweb::UrlInputResource::Freshen ( FreshenCallback callback,
MessageHandler handler 
) [virtual]

Freshen a soon-to-expire resource so that we minimize the number of cache misses when serving live traffic. Note that callback may be NULL, and all subclasses must handle this.

Reimplemented from net_instaweb::Resource.

virtual bool net_instaweb::UrlInputResource::IsValidAndCacheable (  )  const [virtual]

Answers question: Are we allowed to rewrite the contents now?

Checks if the contents are loaded and valid and also if the resource is up-to-date and cacheable enought to be rewritten by us right now.

Reimplemented from net_instaweb::Resource.

virtual bool net_instaweb::UrlInputResource::Load ( MessageHandler message_handler  )  [protected, virtual]

Load the resource asynchronously, storing ResponseHeaders and contents in cache. Returns true, if the resource is already loaded or loaded synchronously. Never reports uncacheable resources.

Implements net_instaweb::Resource.

virtual void net_instaweb::UrlInputResource::LoadAndCallback ( NotCacheablePolicy  not_cacheable_policy,
AsyncCallback callback,
MessageHandler message_handler 
) [protected, virtual]

Same as Load, but calls a callback when finished. The ResourcePtr used to construct 'callback' must be the same as the resource used to invoke this method. If the resource is uncacheable, will only return true if not_cacheable_policy == kLoadEvenIfNotCacheable.

Reimplemented from net_instaweb::Resource.

virtual const RewriteOptions* net_instaweb::UrlInputResource::rewrite_options (  )  const [inline, virtual]

Obtain rewrite options for this. Any resources which return true for IsCacheable() but don't unconditionally return true for loaded() must override this in a useful way. Used in cache invalidation.

Implements net_instaweb::Resource.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:34:07 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3