Page Speed Optimization Libraries  1.9.32.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
net_instaweb::RequestProperties Class Reference

#include "request_properties.h"

Public Member Functions

 RequestProperties (UserAgentMatcher *matcher)
 
void SetUserAgent (const StringPiece &user_agent_string)
 Sets the user agent string on the underlying DeviceProperties object.
 
void ParseRequestHeaders (const RequestHeaders &request_headers)
 
bool SupportsImageInlining () const
 
bool SupportsLazyloadImages () const
 
bool SupportsCriticalCss () const
 
bool SupportsCriticalCssBeacon () const
 
bool SupportsCriticalImagesBeacon () const
 
bool SupportsJsDefer (bool enable_mobile) const
 
bool SupportsWebpInPlace () const
 
bool SupportsWebpRewrittenUrls () const
 
bool SupportsWebpLosslessAlpha () const
 
bool IsBot () const
 
bool SupportsSplitHtml (bool enable_mobile) const
 
bool CanPreloadResources () const
 
bool GetScreenResolution (int *width, int *height) const
 
UserAgentMatcher::DeviceType GetDeviceType () const
 
bool IsMobile () const
 
bool ForbidWebpInlining () const
 
void SetPreferredImageQualities (const std::vector< int > *webp, const std::vector< int > *jpeg)
 
bool GetPreferredImageQualities (DeviceProperties::ImageQualityPreference preference, int *webp, int *jpeg) const
 Returns true iff WebP and Jpeg image quality are set for the preference.
 
void LogDeviceInfo (AbstractLogRecord *log_record, bool enable_aggressive_rewriters_for_mobile)
 

Static Public Member Functions

static int GetPreferredImageQualityCount ()
 

Friends

class ImageRewriteTest
 

Detailed Description

This class keeps track of the request properties of the client, which are for the most part learned from the UserAgent string and specific request headers that indicate what optimizations are supported; most properties are described in device_properties.h. It relies on DeviceProperties and DownstreamCachingDirectives objects for deciding on support for a given capability.

Member Function Documentation

void net_instaweb::RequestProperties::ParseRequestHeaders ( const RequestHeaders &  request_headers)

Calls ParseCapabilityListFromRequestHeaders on the underlying DownstreamCachingDirectives object.

void net_instaweb::RequestProperties::SetPreferredImageQualities ( const std::vector< int > *  webp,
const std::vector< int > *  jpeg 
)

Does not own the vectors. Callers must ensure the lifetime of vectors exceeds that of the RequestProperties.

bool net_instaweb::RequestProperties::SupportsWebpInPlace ( ) const

Note that it's assumed that if the proxy cache SupportsWebp it also supports the Accept: image/webp header (since this represents a strict subset of the user agents for which SupportsWebpRewrittenUrls holds).


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