Page Speed Optimization Libraries  1.3.25.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
net_instaweb::CriticalImagesFinder Class Reference

#include "critical_images_finder.h"

Inheritance diagram for net_instaweb::CriticalImagesFinder:
net_instaweb::BeaconCriticalImagesFinder

List of all members.

Public Member Functions

 CriticalImagesFinder (Statistics *stats)
virtual bool IsMeaningful (const RewriteDriver *driver) const =0
virtual bool IsCriticalImage (const GoogleString &image_url, const RewriteDriver *driver) const
virtual void UpdateCriticalImagesSetInDriver (RewriteDriver *driver)
virtual void ComputeCriticalImages (StringPiece url, RewriteDriver *driver)=0
 Compute the critical images for the given url.
virtual const char * GetCriticalImagesCohort () const =0
bool UpdateCriticalImagesCacheEntryFromDriver (RewriteDriver *driver, StringSet *critical_images_set, StringSet *css_critical_images_set)
bool UpdateCriticalImagesCacheEntry (PropertyPage *page, PropertyCache *page_property_cache, StringSet *critical_images_set, StringSet *css_critical_images_set)

Static Public Member Functions

static void InitStats (Statistics *statistics)

Static Public Attributes

static const char kCriticalImagesValidCount []
static const char kCriticalImagesExpiredCount []
static const char kCriticalImagesNotFoundCount []

Friends

class CriticalImagesFinderTestBase

Detailed Description

Finds critical images i.e. images which are above the fold for a given url. This information may be used by DelayImagesFilter.


Member Function Documentation

virtual const char* net_instaweb::CriticalImagesFinder::GetCriticalImagesCohort ( ) const [pure virtual]

Identifies which cohort in the PropertyCache the critical image information is located in.

Implemented in net_instaweb::BeaconCriticalImagesFinder.

virtual bool net_instaweb::CriticalImagesFinder::IsCriticalImage ( const GoogleString image_url,
const RewriteDriver driver 
) const [virtual]

Checks whether the requested image is present in the critical set or not. Users of this function should also check IsMeaningful() to see if the implementation of this function returns meaningful results and provide a default behavior if it does not.

Reimplemented in net_instaweb::BeaconCriticalImagesFinder.

virtual bool net_instaweb::CriticalImagesFinder::IsMeaningful ( const RewriteDriver driver) const [pure virtual]

Checks whether IsCriticalImage will return meaningful results about critical images. Users of IsCriticalImage should check this function and supply a default behavior if IsMeaningful returns false.

Implemented in net_instaweb::BeaconCriticalImagesFinder.

bool net_instaweb::CriticalImagesFinder::UpdateCriticalImagesCacheEntry ( PropertyPage page,
PropertyCache page_property_cache,
StringSet *  critical_images_set,
StringSet *  css_critical_images_set 
)

Alternative interface to update the critical images cache entry. This is useful in contexts like the beacon handler where the RewriteDriver for the original request no longer exists. This will take ownership of critical_images_set.

bool net_instaweb::CriticalImagesFinder::UpdateCriticalImagesCacheEntryFromDriver ( RewriteDriver driver,
StringSet *  critical_images_set,
StringSet *  css_critical_images_set 
)

Updates the critical images property cache entry. This will take the ownership of the critical_images_set. Returns whether the update succeeded or not. Note that this base implementation does not call WriteCohort. This should be called in the subclass if the cohort is not written elsewhere.

Gets critical images if present in the property cache and updates the critical_images set in RewriteDriver with the obtained set.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines