Page Speed Optimization Libraries  1.4.26.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Protected Member Functions
net_instaweb::DataUrlInputResource Class Reference
Inheritance diagram for net_instaweb::DataUrlInputResource:
net_instaweb::Resource net_instaweb::RefCounted< Resource >

List of all members.

Public Member Functions

virtual bool IsValidAndCacheable () const
virtual void FillInPartitionInputInfo (HashHint include_content_hash, InputInfo *input)
 Set OutputPartition's input info used for expiration validation.
virtual GoogleString url () const
 Gets the absolute URL of the resource.
virtual const RewriteOptionsrewrite_options () const
virtual bool UseHttpCache () const

Static Public Member Functions

static ResourcePtr Make (const StringPiece &url, ServerContext *resource_manager)
 We expose a factory; parse failure returns NULL.

Protected Member Functions

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

Member Function Documentation

Checks if the contents are loaded and valid and also if the resource is up-to-date and cacheable by a proxy like us.

Reimplemented from net_instaweb::Resource.

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

Load the resource asynchronously, storing ResponseHeaders and contents in object. Calls 'callback' when finished. The ResourcePtr used to construct 'callback' must be the same as the resource used to invoke this method.

Setting not_cacheable_policy to kLoadEvenIfNotCacheable will permit it to consider loading to be successful on Cache-Control:private and Cache-Control:no-cache resources. It should not affect /whether/ the callback gets involved, only whether it gets true or false.

Implements net_instaweb::Resource.

static ResourcePtr net_instaweb::DataUrlInputResource::Make ( const StringPiece &  url,
ServerContext resource_manager 
) [inline, static]

We expose a factory; parse failure returns NULL.

We create the local copy of the url early, because encoded_contents will in general be a substring of this local copy and must have the same lifetime.

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

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

Implements net_instaweb::Resource.

virtual bool net_instaweb::DataUrlInputResource::UseHttpCache ( ) const [inline, virtual]

Returns whether this type of resource should use the HTTP Cache. This method is based on properties of the class, not the resource itself, and helps short-circuit pointless cache lookups for file-based and data URLs.

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