|
| OutputResource (const RewriteDriver *driver, StringPiece resolved_base, StringPiece unmapped_base, StringPiece original_base, const ResourceNamer &resource_id, OutputResourceKind kind) |
|
virtual void | LoadAndCallback (NotCacheablePolicy not_cacheable_policy, const RequestContextPtr &request_context, AsyncCallback *callback) |
|
virtual GoogleString | url () const |
|
GoogleString | UrlEvenIfHashNotSet () |
|
void | DumpToDisk (MessageHandler *handler) |
|
void | UpdateCachedResultPreservingInputInfo (CachedResult *to_update) const |
|
virtual GoogleString | name_key () const |
|
GoogleString | HttpCacheKey () const |
|
const GoogleString & | resolved_base () const |
| output-specific
|
|
const GoogleString & | unmapped_base () const |
|
const GoogleString & | original_base () const |
|
const ResourceNamer & | full_name () const |
|
ResourceNamer * | mutable_full_name () |
|
StringPiece | name () const |
|
StringPiece | experiment () const |
|
StringPiece | suffix () const |
|
StringPiece | filter_prefix () const |
|
StringPiece | hash () const |
|
StringPiece | signature () const |
|
bool | has_hash () const |
|
void | clear_hash () |
|
GoogleString | decoded_base () const |
|
bool | IsWritten () const |
|
virtual void | SetType (const ContentType *type) |
| Sets the type of the output resource, and thus also its suffix.
|
|
const CachedResult * | cached_result () const |
|
CachedResult * | EnsureCachedResultCreated () |
|
void | clear_cached_result () |
|
void | set_cached_result (CachedResult *cached_result) |
|
OutputResourceKind | kind () const |
|
void | SetWritten (bool written) |
| This is called by CacheCallback::Done in rewrite_driver.cc.
|
|
virtual const RewriteOptions * | rewrite_options () const |
|
Writer * | BeginWrite (MessageHandler *message_handler) |
|
void | EndWrite (MessageHandler *message_handler) |
|
virtual bool | UseHttpCache () const |
|
const GoogleString & | cache_control_suffix () const |
|
void | set_cache_control_suffix (const GoogleString &x) |
|
| Resource (const RewriteDriver *driver, const ContentType *type) |
|
ServerContext * | server_context () const |
| Common methods across all deriviations.
|
|
virtual bool | IsValidAndCacheable () const |
|
bool | is_authorized_domain () |
|
void | set_is_authorized_domain (bool is_authorized) |
|
bool | IsSafeToRewrite (bool rewrite_uncacheable, GoogleString *reason) const |
|
bool | IsSafeToRewrite (bool rewrite_uncacheable) const |
|
bool | loaded () const |
|
bool | HttpStatusOk () const |
|
void | LoadAsync (NotCacheablePolicy not_cacheable_policy, const RequestContextPtr &request_context, AsyncCallback *callback) |
|
virtual void | RefreshIfImminentlyExpiring () |
|
GoogleString | ContentsHash () const |
|
void | AddInputInfoToPartition (HashHint suggest_include_content_hash, int index, CachedResult *partition) |
|
virtual void | FillInPartitionInputInfo (HashHint suggest_include_content_hash, InputInfo *input) |
|
void | FillInPartitionInputInfoFromResponseHeaders (const ResponseHeaders &headers, InputInfo *input) |
|
int64 | CacheExpirationTimeMs () const |
|
StringPiece | ExtractUncompressedContents () const |
|
size_t | UncompressedContentsSize () const |
|
StringPiece | raw_contents () const |
|
ResponseHeaders * | response_headers () |
|
const ResponseHeaders * | response_headers () const |
|
const ContentType * | type () const |
|
bool | IsContentsEmpty () const |
|
StringPiece | charset () const |
| Note: this is empty if the header is not specified.
|
|
void | set_charset (StringPiece c) |
|
virtual bool | has_url () const |
|
virtual GoogleString | UrlForDebug () const |
| Override if resource does not have a URL.
|
|
virtual GoogleString | cache_key () const |
|
void | DetermineContentType () |
|
bool | Link (HTTPValue *source, MessageHandler *handler) |
|
virtual void | Freshen (FreshenCallback *callback, MessageHandler *handler) |
|
void | LinkFallbackValue (HTTPValue *value) |
| Links the stale fallback value that can be used in case a fetch fails.
|
|
void | set_is_background_fetch (bool x) |
|
bool | is_background_fetch () const |
|
FetchResponseStatus | fetch_response_status () |
|
void | set_fetch_response_status (FetchResponseStatus x) |
|
void | Release () |
|
void | AddRef () |
|
bool | HasOneRef () |
|
const CachedResult* net_instaweb::OutputResource::cached_result |
( |
| ) |
const |
|
inline |
Whenever output resources are created via RewriteDriver (except DecodeOutputResource) it looks up cached information on any previous creation of that resource, including the full filename and any filter-specific metadata. If such information is available, this method will return non-NULL.
Note: cached_result() will also be non-NULL if you explicitly create the result from a filter by calling EnsureCachedResultCreated()
The output is const because we do not check that the CachedResult has not been written. If you want to modify the CachedResult, use EnsureCachedResultCreated instead.
GoogleString net_instaweb::OutputResource::HttpCacheKey |
( |
| ) |
const |
Builds a canonical URL in a form for use with the HTTP cache. The DomainLawyer from options is used to find the proper domain in case there is a fetch for the unsharded form, or the wrong shard.
For example, if you have a resource styles.css ModPagespeedMapRewriteDomain master alias ModPagespeedShardDomain master shard1,shard2 then all HTTP cache puts/gets will use the key "http://master/style.css", which can be obtained from an output resource using this method.
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.
virtual GoogleString net_instaweb::OutputResource::url |
( |
| ) |
const |
|
virtual |
NOTE: url() will crash if resource has does not have a hash set yet. Specifically, this will occur if the resource has not been completely written yet. Before that point, the final URL cannot be known.
Note: the OutputResource will never have a query string, even when ModPagespeedAddOptionsToUrls is on.
Implements net_instaweb::Resource.
Reimplemented in net_instaweb::InlineOutputResource.