`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsCacheManager.h
`1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
`2 *
`3 * The contents of this file are subject to the Netscape Public License
`4 * Version 1.0 (the "NPL"); you may not use this file except in
`5 * compliance with the NPL. You may obtain a copy of the NPL at
`6 * http://www.mozilla.org/NPL/
`7 *
`8 * Software distributed under the NPL is distributed on an "AS IS" basis,
`9 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
`10 * for the specific language governing rights and limitations under the
`11 * NPL.
`12 *
`13 * The Initial Developer of this code under the NPL is Netscape
`14 * Communications Corporation. Portions created by Netscape are
`15 * Copyright (C) 1998 Netscape Communications Corporation. All Rights
`16 * Reserved.
`17 */
`18
`19 /*
`20 * nsCacheManager- The boss of cache architecture. Contains all "external"
`21 * functions for use by people who don't care/want to know the internals
`22 * of the cache architecture.
`23 *
`24 * - Gagan Saksena 09/15/98
`25 *
`26 * Design and original implementation by Gagan Saksena 02/02/98
`27 *
`28 */
`29
`30 #ifndef _CacheManager_H_
`31 #define _CacheManager_H_
`32
`33 #if 0
`34 # include "nsISupports.h"
`35 #endif
`36
`37 #include "prlog.h"
`38
`39 #include "nsMonitorable.h"
`40 #include "nsCacheModule.h"
`41 #include "nsCacheObject.h"
`42
`43 class nsMemModule;
`44 class nsDiskModule;
`45 class nsCachePref;
`46 class nsCacheBkgThd;
`47
`48 class nsCacheManager : public nsMonitorable //: public nsISupports
`49 {
`50
`51 public:
`52
`53
`54
`
`//Reserved modules
`enum modules
`
`-1-
`
`Microsoft Corp. Exhibit 1061
`
`
`
`MEM =0,
`DISK=1
`
`};
`nsCacheManager();
`~nsCacheManager();
`
`Sunday, July 16, 2017
`
`PRInt32
`
`PRBool
`
`AddModule(nsCacheModule* i_cacheModule);
`// InsertModule
`Contains(const char* i_url) const;
`
`/* Number of modules in the cache manager */
`Entries() const;
`PRInt16
`
`void
`
`PRBool
`
`void
`
`// Initialize the cache manager. Constructor doesn't call this.
`// So you must specify this separately.
`Init();
`void
`InfoAsHTML(char* o_Buffer) const;
`IsOffline(void) const;
`Offline(PRBool bSet);
`Remove(const char* i_url);
`Trace() const;
`
`/* Singleton */
`static nsCacheManager* GetInstance();
`nsDiskModule*
`GetDiskModule() const;
`nsMemModule*
`GetMemModule() const;
`nsCacheModule*
`GetModule(PRInt16 i_index) const;
`nsCacheObject*
`GetObj(const char* i_url) const;
`nsCachePref*
`GetPrefs(void) const;
`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsCacheManager.h
`{
`55
`56
`57
`58
`59
`60
`61
`62
`63
`64
`65
`66
`67
`68
`69
`70
`71
`72
`73
`74
`75
`76
`77
`78
`79
`80
`81
`82
`83
`84
`85
`86
`87
`88
`89
`90
`91
`92
`93
`94
`95
`96
`/* Performance measure- microseconds */
`97
`WorstCaseTime(void) const;
`PRUint32
`98
`99
`100 protected:
`101
`102
`103
`104
`105
`106
`107
`108 /*
`
`PRBool
`const char*
`
`ContainsExactly(const char* i_url) const;
`PRBool
`LastModule() const;
`nsCacheModule*
`//PRBool Lock(void);
`//void Unlock(void);
`
`-2-
`
`Microsoft Corp. Exhibit 1061
`
`
`
`Sunday, July 16, 2017
`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsCacheManager.h
`109 class MgrMonitor
`110 {
`111 public:
`112 MgrMonitor() { nsCacheManager::GetInstance()->Lock();}
`113 ~MgrMonitor() { nsCacheManager::GetInstance()->Unlock();}
`114 };
`115
`116 friend MgrMonitor;
`117 */
`118
`119 private:
`m_pBkgThd;
`nsCacheBkgThd*
`120
`m_pFirstModule;
`nsCacheModule*
`121
`m_pMonitor;
`PRMonitor*
`122
`m_bOffline;
`123
`PRBool
`m_pPrefs;
`nsCachePref*
`124
`125
`nsCacheManager(const nsCacheManager& cm);
`126
`nsCacheManager& operator=(const nsCacheManager& cm);
`127
`128 };
`129
`130 inline
`131 nsDiskModule* nsCacheManager::GetDiskModule() const
`132 {
`PR_ASSERT(m_pFirstModule && m_pFirstModule->NextModule());
`133
`return (m_pFirstModule) ? (nsDiskModule*) m_pFirstModule->NextModule() : NULL;
`134
`135 }
`136
`137 inline
`138 nsMemModule* nsCacheManager::GetMemModule() const
`139 {
`PR_ASSERT(m_pFirstModule);
`140
`return (nsMemModule*) m_pFirstModule;
`141
`142 }
`143
`144 inline
`145 nsCachePref* nsCacheManager::GetPrefs(void) const
`146 {
`PR_ASSERT(m_pPrefs);
`147
`return m_pPrefs;
`148
`149 }
`150
`151 inline
`152 PRBool nsCacheManager::IsOffline(void) const
`153 {
`return m_bOffline;
`154
`155 }
`156
`157 inline
`158 void nsCacheManager::Offline(PRBool i_bSet)
`159 {
`m_bOffline = i_bSet;
`160
`161 }
`162
`
`-3-
`
`Microsoft Corp. Exhibit 1061
`
`
`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsCacheManager.h
`163 #endif
`164
`
`Sunday, July 16, 2017
`
`-4-
`
`Microsoft Corp. Exhibit 1061
`
`