`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsMemModule.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 * nsMemModule. The memory based cache module.
`21 *
`22 * Gagan Saksena
`23 * 02/03/98
`24 *
`25 */
`26
`27 #ifndef _nsMemModule_H_
`28 #define _nsMemModule_H_
`29
`30 #include "nsCacheModule.h"
`31 #include "nsMemCacheObject.h"
`32 #include "nsCachePref.h"
`33
`34 //#include "nsHash.h" // TODO - replace with nsHashtable when the XPCOM_BRANCH merges
`35
`36 //#include "nsHashtable.h"
`37 /*
`38 // {5D51B250-E6C2-11d1-AFE5-006097BFC036}
`39 static const NS_MEMMODULE_IID =
`40 { 0x5d51b250, 0xe6c2, 0x11d1, { 0xaf, 0xe5, 0x0, 0x60, 0x97, 0xbf, 0xc0, 0x36 } };
`41 */
`42
`43 class nsMemModule : public nsCacheModule
`44 {
`45
`46 public:
`nsMemModule(const PRUint32 size=nsCachePref::GetInstance()->MemCacheSize());
`47
`~nsMemModule();
`48
`49
`50 /*
`51 NS_IMETHOD QueryInterface(const nsIID& aIID,
`52 void** aInstancePtr);
`53 NS_IMETHOD_(nsrefcnt) AddRef(void);
`54 NS_IMETHOD_(nsrefcnt) Release(void);
`-1-
`
`Microsoft Corp. Exhibit 1062
`
`
`
`Sunday, July 16, 2017
`
`PRBool
`
`PRBool
`PRBool
`
`PRBool
`
`AddObject(nsCacheObject* io_pObject);
`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);
`ReduceSizeTo(const PRUint32 i_NewSize);
`Remove(const char* i_url);
`Remove(const PRUint32 i_index);
`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsMemModule.h
`55
`56 */
`57
`58
`59
`60
`61
`62
`63
`64
`65
`66
`67
`68
`69
`70
`71
`72
`73
`74 // PRBool RemoveAll(void);
`75
`Revalidate(void);
`76
`77
`78
`// Start of nsMemModule specific stuff...
`79
`// Here is a sample implementation using linked list
`80
`81 protected:
`nsMemCacheObject* LastObject(void) const;
`82
`83
`84 private:
`nsMemCacheObject* m_pFirstObject;
`85
`86
`87
`88
`89
`90
`91
`92
`93
`94 /*
`95 class nsMemKey : public nsHashKey
`96 {
`97 public:
`98 nsMemKey();
`99 ~nsMemKey();
`100 PRUint32 HashValue();
`101 PRBool Equals(nsHashKey *aKey);
`102 nsHashKey* Clone();
`103 };
`104 */
`105 };
`106
`107 inline
`108 PRBool nsMemModule::Revalidate(void)
`
`PRBool
`PRBool
`
`PRBool
`
`//nsHash m_ht; //TODO replace with nsHashtable
`//Optimization
`nsMemCacheObject* m_pLastObject;
`nsMemModule(const nsMemModule& mm);
`nsMemModule& operator=(const nsMemModule& mm);
`
`-2-
`
`Microsoft Corp. Exhibit 1062
`
`
`
`/* Mem module elements are never revalidated */
`return PR_FALSE;
`
`Q:\Mozilla\mozilla-source-M8\mozilla\network\cache\nu\public\nsMemModule.h
`109 {
`110
`111
`112 }
`113
`114 #endif
`115
`
`Sunday, July 16, 2017
`
`-3-
`
`Microsoft Corp. Exhibit 1062
`
`