Page Speed Optimization Libraries
1.5.27.2
|
00001 // Copyright 2013 Google Inc. 00016 00017 #ifndef NET_INSTAWEB_SYSTEM_PUBLIC_SYSTEM_SERVER_CONTEXT_H_ 00018 #define NET_INSTAWEB_SYSTEM_PUBLIC_SYSTEM_SERVER_CONTEXT_H_ 00019 00020 #include "net/instaweb/rewriter/public/server_context.h" 00021 00022 #include "net/instaweb/util/public/abstract_mutex.h" 00023 #include "net/instaweb/util/public/basictypes.h" 00024 #include "net/instaweb/util/public/scoped_ptr.h" 00025 00026 namespace net_instaweb { 00027 00028 class Statistics; 00029 class SystemRewriteDriverFactory; 00030 class SystemRewriteOptions; 00031 class Variable; 00032 00034 class SystemServerContext : public ServerContext { 00035 public: 00036 explicit SystemServerContext(SystemRewriteDriverFactory* driver_factory); 00037 00046 void FlushCacheIfNecessary(); 00047 00048 SystemRewriteOptions* system_rewrite_options(); 00049 00050 static void InitStats(Statistics* statistics); 00051 00052 protected: 00065 virtual bool UpdateCacheFlushTimestampMs(int64 timestamp_ms); 00066 00067 private: 00071 scoped_ptr<AbstractMutex> cache_flush_mutex_; 00072 int64 last_cache_flush_check_sec_; 00073 00074 Variable* cache_flush_count_; 00075 Variable* cache_flush_timestamp_ms_; 00076 00077 DISALLOW_COPY_AND_ASSIGN(SystemServerContext); 00078 }; 00079 00080 } 00081 00082 #endif ///< NET_INSTAWEB_SYSTEM_PUBLIC_SYSTEM_SERVER_CONTEXT_H_