21 #ifndef NET_INSTAWEB_UTIL_PUBLIC_PROPERTY_STORE_H_
22 #define NET_INSTAWEB_UTIL_PUBLIC_PROPERTY_STORE_H_
27 #include "pagespeed/kernel/base/basictypes.h"
28 #include "pagespeed/kernel/base/callback.h"
29 #include "pagespeed/kernel/base/scoped_ptr.h"
31 namespace net_instaweb {
34 class PropertyCacheValues;
35 class PropertyValueProtobuf;
43 typedef Callback1<bool> BoolCallback;
57 const GoogleString& url,
58 const GoogleString& options_signature_hash,
59 const GoogleString& cache_key_suffix,
60 const PropertyCache::CohortVector& cohort_list,
70 const GoogleString& url,
71 const GoogleString& options_signature_hash,
72 const GoogleString& cache_key_suffix,
74 const PropertyCacheValues* values,
75 BoolCallback* done) = 0;
81 void set_enable_get_cancellation(
bool x) { enable_get_cancellation_ = x; }
88 virtual GoogleString
Name()
const = 0;
91 bool enable_get_cancellation_;
92 DISALLOW_COPY_AND_ASSIGN(PropertyStore);
110 typedef Callback1<bool> BoolCallback;
112 AbstractMutex* mutex,
119 static void InitStats(Statistics* statistics);
132 const PropertyValueProtobuf& pcache_value,
133 int64 min_write_timestamp_ms);
137 void Done(
bool success);
140 AbstractMutex* mutex() {
return mutex_.get(); }
144 scoped_ptr<AbstractMutex> mutex_;
146 const bool is_cancellable_;
148 bool delete_when_done_;
151 int64 fast_finish_time_ms_;
virtual GoogleString Name() const =0
virtual void Get(const GoogleString &url, const GoogleString &options_signature_hash, const GoogleString &cache_key_suffix, const PropertyCache::CohortVector &cohort_list, PropertyPage *page, BoolCallback *done, AbstractPropertyStoreGetCallback **callback)=0
Definition: property_cache.h:186
Definition: property_store.h:41
bool enable_get_cancellation()
Definition: property_store.h:80
Definition: abstract_property_store_get_callback.h:31
Definition: property_cache.h:323
virtual void FastFinishLookup()
Definition: property_store.h:108
bool AddPropertyValueProtobufToPropertyPage(const PropertyCache::Cohort *cohort, const PropertyValueProtobuf &pcache_value, int64 min_write_timestamp_ms)
virtual void DeleteWhenDone()
Deletes the callback after done finishes.
virtual void Put(const GoogleString &url, const GoogleString &options_signature_hash, const GoogleString &cache_key_suffix, const PropertyCache::Cohort *cohort, const PropertyCacheValues *values, BoolCallback *done)=0