Page Speed Optimization Libraries
1.8.31.3
|
00001 /* 00002 * Copyright 2013 Google Inc. 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http:///www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00023 #ifndef NET_INSTAWEB_UTIL_PUBLIC_TWO_LEVEL_PROPERTY_STORE_H_ 00024 #define NET_INSTAWEB_UTIL_PUBLIC_TWO_LEVEL_PROPERTY_STORE_H_ 00025 00026 #include "net/instaweb/util/public/property_cache.h" 00027 #include "net/instaweb/util/public/property_store.h" 00028 #include "net/instaweb/util/public/string.h" 00029 #include "pagespeed/kernel/base/basictypes.h" 00030 00031 namespace net_instaweb { 00032 00033 class AbstractPropertyStoreGetCallback; 00034 class PropertyCacheValues; 00035 class ThreadSystem; 00036 00037 class TwoLevelPropertyStore : public PropertyStore { 00038 public: 00039 TwoLevelPropertyStore(PropertyStore* primary_property_store, 00040 PropertyStore* secondary_propery_store, 00041 ThreadSystem* thread_system); 00042 virtual ~TwoLevelPropertyStore(); 00043 00047 virtual void Get( 00048 const GoogleString& url, 00049 const GoogleString& options_signature_hash, 00050 const GoogleString& cache_key_suffix, 00051 const PropertyCache::CohortVector& cohort_list, 00052 PropertyPage* page, 00053 BoolCallback* done, 00054 AbstractPropertyStoreGetCallback** callback); 00055 00057 virtual void Put( 00058 const GoogleString& url, 00059 const GoogleString& options_signature_hash, 00060 const GoogleString& cache_key_suffix, 00061 const PropertyCache::Cohort* cohort, 00062 const PropertyCacheValues* values, 00063 BoolCallback* done); 00064 00065 virtual GoogleString Name() const; 00066 00067 private: 00068 PropertyStore* primary_property_store_; 00069 PropertyStore* secondary_property_store_; 00070 ThreadSystem* thread_system_; 00071 DISALLOW_COPY_AND_ASSIGN(TwoLevelPropertyStore); 00072 }; 00073 00074 } 00075 #endif ///< NET_INSTAWEB_UTIL_PUBLIC_TWO_LEVEL_PROPERTY_STORE_H_