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

#include "beacon_critical_images_finder.h"

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

List of all members.

Public Member Functions

 BeaconCriticalImagesFinder (const PropertyCache::Cohort *cohort, NonceGenerator *nonce_generator, Statistics *stats)
 All constructor args are owned by the caller.
virtual bool IsMeaningful (const RewriteDriver *driver) const
virtual int PercentSeenForCritical () const
virtual int NumSetsToKeep () const
virtual void ComputeCriticalImages (RewriteDriver *driver)
 Compute the critical images for the driver's url.
virtual const
PropertyCache::Cohort
GetCriticalImagesCohort () const

Static Public Member Functions

static bool UpdateCriticalImagesCacheEntry (const StringSet *html_critical_images_set, const StringSet *css_critical_images_set, const PropertyCache::Cohort *cohort, AbstractPropertyPage *page)

Detailed Description

Support critical (above the fold) image detection through a javascript beacon on the client.


Member Function Documentation

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

Implements net_instaweb::CriticalImagesFinder.

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

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

Implements net_instaweb::CriticalImagesFinder.

virtual int net_instaweb::BeaconCriticalImagesFinder::NumSetsToKeep ( ) const [inline, virtual]

The number of past critical image sets to keep. By default, we only keep the most recent one. The beacon critical image finder should override this to store a larger number of sets.

Reimplemented from net_instaweb::CriticalImagesFinder.

In order to handle varying critical image sets returned by the beacon, we store a history of the last N critical images, and only declare an image critical if it appears critical in the last M out of N sets reported. This function returns what percentage of the sets need to include the image for it be considered critical.

Reimplemented from net_instaweb::CriticalImagesFinder.

static bool net_instaweb::BeaconCriticalImagesFinder::UpdateCriticalImagesCacheEntry ( const StringSet *  html_critical_images_set,
const StringSet *  css_critical_images_set,
const PropertyCache::Cohort cohort,
AbstractPropertyPage page 
) [static]

Update the critical image entry in the property cache. This is meant to be called in the beacon handler, where there is no RewriteDriver available.


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