`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsDiskModule.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 * nsDiskModule. The disk cache module that stores the cache objects
`21 * on the disk.
`22 *
`23 * Gagan Saksena 02/03/98
`24 *
`25 */
`26 #ifndef _nsDiskModule_H_
`27 #define _nsDiskModule_H_
`28
`29 #include "nsCacheModule.h"
`30 #include "nsCachePref.h"
`31 #include "mcom_db.h"
`32
`33 class nsDiskModule : public nsCacheModule
`34 {
`35
`36 public:
`nsDiskModule(const PRUint32 size = nsCachePref::GetInstance()->DiskCacheSize());
`37
`~nsDiskModule();
`38
`39
`40
`41
`42
`43
`44
`45
`46
`47
`48
`49
`50
`51
`52
`53
`54
`
`// Cache module interface
`AddObject(nsCacheObject* io_pObject);
`PRBool
`AverageSize(void) const;
`Contains(nsCacheObject* io_pObject) const;
`Contains(const char* i_url) const;
`GarbageCollect(void);
`void
`nsCacheObject* GetObject(const PRUint32 i_index) const;
`nsCacheObject* GetObject(const char* i_url) const;
`nsStream*
`GetStreamFor(const nsCacheObject* i_pObject);
`
`PRUint32
`
`PRBool
`PRBool
`
`-1-
`
`Microsoft Corp. Exhibit 1063
`
`
`
`Sunday, July 16, 2017
`
`// To do cleanup set size to zero. Else initialize disk cache
`SetSize(const PRUint32 i_size);
`void
`Revalidate(void);
`
`ReduceSizeTo(const PRUint32 i_NewSize);
`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsDiskModule.h
`Remove(const char* i_url);
`55
`PRBool
`Remove(nsCacheObject* pObject);
`56
`PRBool
`Remove(const PRUint32 i_index);
`57
`PRBool
`58
`59
`60
`61
`PRBool
`62
`63
`64 protected:
`65
`PRBool
`66
`67
`68 private:
`69
`enum sync_frequency
`{
`70
`EVERYTIME,
`71
`IDLE,
`72
`73
`NEVER
`} m_Sync;
`74
`75
`76
`77
`78
`79
`80
`81
`82 };
`83
`84 inline
`85 PRUint32 nsDiskModule::AverageSize(void) const
`86 {
`MonitorLocker ml((nsDiskModule*)this);
`87
`if (Entries()>0)
`88
`{
`89
`return (PRUint32)(m_SizeInUse/m_Entries);
`90
`}
`91
`return 0;
`92
`93 }
`94 #endif
`95
`
`InitDB(void);
`PRBool
`nsDiskModule(const nsDiskModule& dm);
`nsDiskModule& operator=(const nsDiskModule& dm);
`DB* m_pDB;
`
`-2-
`
`Microsoft Corp. Exhibit 1063
`
`