Skip to content

Commit

Permalink
[not part of build] changes to build correctly on Mac, and link corre…
Browse files Browse the repository at this point in the history
…ctly on all platforms.
  • Loading branch information
beard%netscape.com committed Feb 24, 2001
1 parent e16678d commit c637de1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
9 changes: 8 additions & 1 deletion netwerk/cache/src/nsCacheEntry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ nsCacheEntry::nsCacheEntry(nsCString * key)
PR_INIT_CLIST(&mDescriptorQ);

mLastFetched = mLastValidated = PR_Now();
mExpirationTime = 0;
mExpirationTime = LL_ZERO;
}


Expand Down Expand Up @@ -290,6 +290,13 @@ nsCacheEntryHashTable::GetKey( PLDHashTable * /*table*/, PLDHashEntryHdr *hashEn
return cacheEntry->mKey;
}

PLDHashNumber
nsCacheEntryHashTable::HashKey( PLDHashTable *table, const void *key)
{
// XXX write a good hash function!
return PLDHashNumber(key);
}

PRBool
nsCacheEntryHashTable::MatchEntry(PLDHashTable * /* table */,
const PLDHashEntryHdr * hashEntry,
Expand Down
6 changes: 3 additions & 3 deletions netwerk/cache/src/nsCacheEntry.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ class nsCacheEntry

void GetLastFetched( PRTime * result) { if (result) *result = mLastFetched; }
void SetLastFetched( PRTime lastFetched)
{ if (lastFetched) mLastFetched = lastFetched; }
{ if (!LL_IS_ZERO(lastFetched)) mLastFetched = lastFetched; }

void GetLastValidated( PRTime * result) { if (result) *result = mLastValidated; }
void SetLastValidated( PRTime lastValidated)
{ if (lastValidated) mLastValidated = lastValidated; }
{ if (!LL_IS_ZERO(lastValidated)) mLastValidated = lastValidated; }

void GetExpirationTime( PRTime * result) { if (result) *result = mExpirationTime; }
void SetExpirationTime( PRTime expires) { if (expires) mExpirationTime = expires; }
void SetExpirationTime( PRTime expires) { if (!LL_IS_ZERO(expires)) mExpirationTime = expires; }

void GetDataSize( PRUint32 * result) { if (result) *result = mDataSize; }
void SetDataSize( PRUint32 size) { mDataSize = size; }
Expand Down
9 changes: 8 additions & 1 deletion netwerk/cache/src/nsCacheService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ nsCacheService::ActivateEntry(nsCacheRequest * request,
}


nsresult
static nsresult
SearchCacheDevices(nsCacheEntry * entry, nsCacheDevice ** result)
{
nsresult rv = NS_OK;
Expand Down Expand Up @@ -384,6 +384,13 @@ nsCacheClientHashTable::GetKey( PLDHashTable * /*table*/, PLDHashEntryHdr *hashE
return ((nsCacheClientHashTableEntry *)hashEntry)->clientID;
}

PLDHashNumber
nsCacheClientHashTable::HashKey( PLDHashTable *table, const void *key)
{
// XXX write a good hash function!
return PLDHashNumber(key);
}

PRBool
nsCacheClientHashTable::MatchEntry(PLDHashTable * /* table */,
const PLDHashEntryHdr * hashEntry,
Expand Down
5 changes: 5 additions & 0 deletions netwerk/cache/src/nsMemoryCacheDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ class nsMemoryCacheDevice : public nsCacheDevice

static nsresult Create(nsCacheDevice **result);

virtual const char * GetDeviceID(void);

virtual nsresult ActivateEntryIfFound( nsCacheEntry * entry );
virtual nsresult DeactivateEntry( nsCacheEntry * entry );
virtual nsresult BindEntry( nsCacheEntry * entry );
virtual nsresult GetTransportForEntry( nsCacheEntry * entry,
nsITransport **transport );

virtual nsresult OnDataSizeChanged( nsCacheEntry * entry );

private:
nsCacheEntryHashTable mInactiveEntries;
Expand Down

0 comments on commit c637de1

Please sign in to comment.