Page Speed Optimization Libraries
1.2.24.1
|
#include "property_cache.h"
Classes | |
struct | PropertyMapStruct |
Public Member Functions | |
PropertyValue * | GetProperty (const PropertyCache::Cohort *cohort, const StringPiece &property_name) |
void | DeleteProperty (const PropertyCache::Cohort *cohort, const StringPiece &property_name) |
const GoogleString & | key () const |
Protected Member Functions | |
PropertyPage (AbstractMutex *mutex, const StringPiece &key) | |
The Page takes ownership of the mutex. | |
virtual bool | IsCacheValid (int64 write_timestamp_ms) const |
virtual void | Done (bool success)=0 |
Called as a result of PropertyCache::Read when the data is available. | |
Friends | |
class | CallbackCollector |
class | PropertyCache::CacheInterfaceCallback |
class | PropertyCache |
Holds the property values associated with a single key. See more extensive comment for PropertyPage above.
void net_instaweb::PropertyPage::DeleteProperty | ( | const PropertyCache::Cohort * | cohort, |
const StringPiece & | property_name | ||
) |
Deletes a property given the property name.
This function deletes the PropertyValue if it already exists, otherwise it is a no-op function.
It is a programming error to call DeleteProperty on a PropertyPage that has not yet been read.
This function actually does not commit it to cache.
PropertyValue* net_instaweb::PropertyPage::GetProperty | ( | const PropertyCache::Cohort * | cohort, |
const StringPiece & | property_name | ||
) |
Gets a property given the property name. The property can then be mutated, prior to the PropertyPage being written back to the cache.
The returned PropertyValue object is owned by the PropertyPage and should not be deleted by the caller.
This function creates the PropertyValue if it didn't already exist, either from a previous call or a cache-read.
It is a programming error to call GetProperty on a PropertyPage that has not yet been read.
Note that all the properties in all the Cohorts on a Page are read via PropertyCache::Read. This allows cache implementations that support batching to do so on the read. However, properties are written back to cache one Cohort at a time, via PropertyCache::WriteCohort.
virtual bool net_instaweb::PropertyPage::IsCacheValid | ( | int64 | write_timestamp_ms | ) | const [inline, protected, virtual] |
Called immediatly after the underlying cache lookup is done, from PropertyCache::CacheInterfaceCallback::Done().
Reimplemented in net_instaweb::ProxyFetchPropertyCallback.