Page Speed Optimization Libraries
1.3.25.1
|
#include "client_state.h"
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 GoogleString & | ClientId () 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 |
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.
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.
virtual void net_instaweb::ClientState::WriteBackToPropertyCache | ( | ) | [virtual] |
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.