Page Speed Optimization Libraries  1.9.32.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
net_instaweb::CriticalCssFinder Class Referenceabstract

Finds critical CSS rules (i.e. CSS needed for the initial page load). More...

#include "critical_css_finder.h"

Inheritance diagram for net_instaweb::CriticalCssFinder:
net_instaweb::MockCriticalCssFinder

Public Member Functions

 CriticalCssFinder (const PropertyCache::Cohort *cohort, Statistics *stats)
 
virtual CriticalCssResult * GetCriticalCssFromCache (RewriteDriver *driver)
 
virtual void ComputeCriticalCss (RewriteDriver *driver)=0
 Compute the critical css for the driver's url.
 
virtual bool UpdateCache (RewriteDriver *driver, const CriticalCssResult &result)
 Copy |critical_css_map| into property cache. Returns true on success.
 
virtual void UpdateCriticalCssInfoInDriver (RewriteDriver *driver)
 
virtual CriticalCssResult * GetCriticalCss (RewriteDriver *driver)
 
const PropertyCache::Cohortcohort () const
 

Static Public Member Functions

static void InitStats (Statistics *statistics)
 

Static Public Attributes

static const char kCriticalCssValidCount []
 
static const char kCriticalCssExpiredCount []
 
static const char kCriticalCssNotFoundCount []
 
static const char kCriticalCssPropertyName []
 

Detailed Description

Finds critical CSS rules (i.e. CSS needed for the initial page load).

Member Function Documentation

virtual CriticalCssResult* net_instaweb::CriticalCssFinder::GetCriticalCss ( RewriteDriver driver)
virtual

Gets the critical CSS rules from the driver if they are present. Otherwise calls UpdateCriticalCssInfoInDriver() to populate the ruleset in the driver and returns the rules. The ownership of the CriticalCssResult is not released and it stays with the driver.

virtual CriticalCssResult* net_instaweb::CriticalCssFinder::GetCriticalCssFromCache ( RewriteDriver driver)
virtual

Get critical css result from property cache. Ownership of the result is passed to the caller.

Reimplemented in net_instaweb::MockCriticalCssFinder.

virtual void net_instaweb::CriticalCssFinder::UpdateCriticalCssInfoInDriver ( RewriteDriver driver)
virtual

Collects the critical CSS rules from the property cache and updates the same in the rewrite driver. The ownership of the ruleset stays with the driver.


The documentation for this class was generated from the following file: