From: Francesco Chemolli Date: Thu, 10 Jul 2008 17:59:14 +0000 (+0200) Subject: Yet more caller refactoring. X-Git-Tag: SQUID_3_1_0_1~49^2~143^2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=231b787a1a5098c25bb2d509863ff2181fb43d5b;p=thirdparty%2Fsquid.git Yet more caller refactoring. --- diff --git a/include/profiling.h b/include/profiling.h index c34e6c6dd0..88d354a593 100644 --- a/include/profiling.h +++ b/include/profiling.h @@ -214,7 +214,7 @@ SQUIDCEXTERN void xprof_start(xprof_type type, const char *timer); SQUIDCEXTERN void xprof_stop(xprof_type type, const char *timer); SQUIDCEXTERN void xprof_event(void *data); #if __cplusplus -extern void xprofRegisterWithCacheManager(CacheManager & manager); +extern void xprofRegisterWithCacheManager(void); #endif #define PROF_start(type) xprof_start(XPROF_##type, #type) diff --git a/src/ProfStats.cc b/src/ProfStats.cc index 1bd47da4d9..eb9506fa8f 100644 --- a/src/ProfStats.cc +++ b/src/ProfStats.cc @@ -278,9 +278,10 @@ xprof_Init(void) } void -xprofRegisterWithCacheManager(CacheManager & manager) +xprofRegisterWithCacheManager(void) { - manager.registerAction("cpu_profile", "CPU Profiling Stats", xprof_summary, 0, 1); + CacheManager::GetInstance()-> + registerAction("cpu_profile", "CPU Profiling Stats", xprof_summary, 0, 1); } void diff --git a/src/Store.h b/src/Store.h index ced3cdf175..4dce408fac 100644 --- a/src/Store.h +++ b/src/Store.h @@ -339,7 +339,7 @@ SQUIDCEXTERN StoreEntry *storeCreateEntry(const char *, const char *, request_fl SQUIDCEXTERN void storeInit(void); /// \ingroup StoreAPI -extern void storeRegisterWithCacheManager(CacheManager & manager); +extern void storeRegisterWithCacheManager(void); /// \ingroup StoreAPI SQUIDCEXTERN void storeConfigure(void); diff --git a/src/main.cc b/src/main.cc index 2d21849167..ca45286966 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1027,8 +1027,8 @@ mainInitialize(void) statRegisterWithCacheManager(); storeDigestRegisterWithCacheManager(); StoreFileSystem::RegisterAllFsWithCacheManager(*manager); - storeRegisterWithCacheManager(*manager); - storeLogRegisterWithCacheManager(*manager); + storeRegisterWithCacheManager(); + storeLogRegisterWithCacheManager(); #if DEBUGSTRINGS StringRegistry::Instance().registerWithCacheManager(); @@ -1036,7 +1036,7 @@ mainInitialize(void) #if USE_XPROF_STATS - xprofRegisterWithCacheManager(*manager); + xprofRegisterWithCacheManager(); #endif } diff --git a/src/protos.h b/src/protos.h index 2973fb0a21..2d44db917d 100644 --- a/src/protos.h +++ b/src/protos.h @@ -538,7 +538,7 @@ SQUIDCEXTERN void storeLog(int tag, const StoreEntry * e); SQUIDCEXTERN void storeLogRotate(void); SQUIDCEXTERN void storeLogClose(void); SQUIDCEXTERN void storeLogOpen(void); -SQUIDCEXTERN void storeLogRegisterWithCacheManager(CacheManager &); +SQUIDCEXTERN void storeLogRegisterWithCacheManager(void); /* diff --git a/src/store.cc b/src/store.cc index 72fcc92cd1..f22c4cba50 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1400,17 +1400,13 @@ storeInit(void) } void -storeRegisterWithCacheManager(CacheManager & manager) +storeRegisterWithCacheManager(void) { - manager.registerAction("storedir", - "Store Directory Stats", - Store::Stats, 0, 1); - manager.registerAction("store_check_cachable_stats", - "storeCheckCachable() Stats", + CacheManager *manager=CacheManager::GetInstance(); + manager->registerAction("storedir", "Store Directory Stats", Store::Stats, 0, 1); + manager->registerAction("store_io", "Store IO Interface Stats", storeIOStats, 0, 1); + manager->registerAction("store_check_cachable_stats", "storeCheckCachable() Stats", storeCheckCachableStats, 0, 1); - manager.registerAction("store_io", - "Store IO Interface Stats", - storeIOStats, 0, 1); } void diff --git a/src/store_log.cc b/src/store_log.cc index dfa95feeb0..e370ed659b 100644 --- a/src/store_log.cc +++ b/src/store_log.cc @@ -136,11 +136,11 @@ storeLogOpen(void) } void -storeLogRegisterWithCacheManager(CacheManager & manager) +storeLogRegisterWithCacheManager(void) { - manager.registerAction("store_log_tags", - "Histogram of store.log tags", - storeLogTagsHist, 0, 1); + CacheManager::GetInstance()-> + registerAction("store_log_tags", "Histogram of store.log tags", + storeLogTagsHist, 0, 1); } void