Page Speed Optimization Libraries
1.5.27.2
|
Finds critical CSS rules (i.e. CSS needed for the initial page load). More...
#include "critical_css_finder.h"
Public Member Functions | |
CriticalCssFinder (Statistics *stats) | |
virtual CriticalCssResult * | GetCriticalCssFromCache (RewriteDriver *driver) |
virtual void | ComputeCriticalCss (StringPiece url, RewriteDriver *driver)=0 |
Compute the critical css for |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) |
virtual const char * | GetCohort () const =0 |
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 [] |
Protected Member Functions | |
PropertyValue * | GetPropertyValue (RewriteDriver *driver) |
Finds critical CSS rules (i.e. CSS needed for the initial page load).
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.