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

#include "client_state.h"

Inheritance diagram for net_instaweb::ClientState:
net_instaweb::AbstractClientState

List of all members.

Public Member Functions

virtual bool InCache (const GoogleString &url)
virtual void Set (const GoogleString &url, int64 expire_ms)
virtual void Clear ()
 Clears cached knowledge for this client.
virtual const GoogleStringClientId () const
 Returns the client ID associated with this ClientState object.
virtual bool InitFromPropertyCache (const GoogleString &client_id, PropertyCache *property_cache, PropertyPage *property_page, Timer *timer)
virtual void WriteBackToPropertyCache ()

Static Public Attributes

static const char kClientStateCohort []
 Cohort descriptor for PropertyCache lookups of ClientState objects.
static const char kClientStatePropertyValue []
 PropertyValue descriptor for PropertyCache lookups of ClientState objects.
static const uint32 kClientStateMaxUrls
 Maximum number of URLs tracked for each client.
static const int64 kClientStateExpiryTimeThresholdMs
 URLs with expiry times below this threshold will not be tracked.

Friends

class ClientStateTest

Detailed Description

Basic implementation of AbstractClientState which uses a FIFO queue to track the most recently accessed URLs by a given client.

See AbstractClientState for a description of the interface.


Member Function Documentation

virtual bool net_instaweb::ClientState::InCache ( const GoogleString url) [virtual]

Returns an estimate of whether the client is caching this URL. Note that this is a best-effort guess and may not be accurate with respect to the true client cache state.

Implements net_instaweb::AbstractClientState.

virtual bool net_instaweb::ClientState::InitFromPropertyCache ( const GoogleString client_id,
PropertyCache property_cache,
PropertyPage property_page,
Timer timer 
) [virtual]

Initialize a ClientState from a property cache read. If the PropertyPage does not contain a ClientState object (e.g., due to a cache lookup failure), this method returns false. Otherwise, returns true. The ClientState takes ownership of the property_page in both cases.

Implements net_instaweb::AbstractClientState.

virtual void net_instaweb::ClientState::Set ( const GoogleString url,
int64  expire_ms 
) [virtual]

Used to indicate that the given client is storing this URL for up to expire_ms.

Implements net_instaweb::AbstractClientState.

Write this ClientState back to the property cache. It is an error to call this method without first having called InitFromPropertyCache() and having 'true' returned from that method.

Implements net_instaweb::AbstractClientState.


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