22 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_PROPERTY_CACHE_UTIL_H_
23 #define NET_INSTAWEB_REWRITER_PUBLIC_PROPERTY_CACHE_UTIL_H_
27 #include "net/instaweb/util/public/property_cache.h"
34 namespace net_instaweb {
38 kPropertyCacheDecodeExpired,
39 kPropertyCacheDecodeParseError,
40 kPropertyCacheDecodeOk
46 const PropertyCache* cache,
47 AbstractPropertyPage* page,
48 const PropertyCache::Cohort* cohort,
49 StringPiece property_name,
64 StringPiece property_name,
69 cache_ttl_ms, status);
70 if (property_value == NULL) {
76 ArrayInputStream input(property_value->value().data(),
77 property_value->value().size());
78 if (!result->ParseFromZeroCopyStream(&input)) {
79 *status = kPropertyCacheDecodeParseError;
83 *status = kPropertyCacheDecodeOk;
84 return result.release();
92 StringPiece property_name,
95 return DecodeFromPropertyCache<T>(
96 driver->server_context()->page_property_cache(),
106 kPropertyCacheUpdateEncodeError,
107 kPropertyCacheUpdateOk
111 const protobuf::MessageLite& value,
112 const PropertyCache::Cohort* cohort,
113 StringPiece property_name,
115 AbstractPropertyPage* page);
126 return UpdateInPropertyCache(
127 value, cohort, property_name, write_cohort, page);
can't find existing value to update
Definition: property_cache_util.h:105
Abstract interface for implementing a PropertyPage.
Definition: property_cache.h:291
Holds the value & stability-metadata for a property.
Definition: property_cache.h:122
const PropertyValue * DecodeFromPropertyCacheHelper(const PropertyCache *cache, AbstractPropertyPage *page, const PropertyCache::Cohort *cohort, StringPiece property_name, int64 cache_ttl_ms, PropertyCacheDecodeResult *status)
Definition: property_cache.h:186
Adds property-semantics to a raw cache API.
Definition: property_cache.h:180
PropertyCacheUpdateResult
Definition: property_cache_util.h:104
T * DecodeFromPropertyCache(const PropertyCache *cache, AbstractPropertyPage *page, const PropertyCache::Cohort *cohort, StringPiece property_name, int64 cache_ttl_ms, PropertyCacheDecodeResult *status)
Definition: property_cache_util.h:61
Definition: scoped_ptr.h:30
PropertyPage * property_page() const
includes property cache not being enabled.
Definition: property_cache_util.h:37
Definition: rewrite_driver.h:100
PropertyCacheDecodeResult
Definition: property_cache_util.h:36