gecko-dev/netwerk/cache2/CacheStorage.h
Ehsan Akhgari 4354953b4f Bug 1118486 - Part 1: Use = delete instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00

76 lines
1.8 KiB
C++

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef CacheStorage__h__
#define CacheStorage__h__
#include "nsICacheStorage.h"
#include "CacheEntry.h"
#include "LoadContextInfo.h"
#include "nsRefPtrHashtable.h"
#include "nsThreadUtils.h"
#include "nsCOMPtr.h"
#include "nsILoadContextInfo.h"
#include "nsIApplicationCache.h"
#include "nsICacheEntryDoomCallback.h"
class nsIURI;
class nsIApplicationCache;
namespace mozilla {
namespace net {
// This dance is needed to make CacheEntryTable declarable-only in headers
// w/o exporting CacheEntry.h file to make nsNetModule.cpp compilable.
typedef nsRefPtrHashtable<nsCStringHashKey, CacheEntry> TCacheEntryTable;
class CacheEntryTable : public TCacheEntryTable
{
public:
enum EType
{
MEMORY_ONLY,
ALL_ENTRIES
};
explicit CacheEntryTable(EType aType) : mType(aType) { }
EType Type() const
{
return mType;
}
private:
EType const mType;
CacheEntryTable() = delete;
};
class CacheStorage : public nsICacheStorage
{
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSICACHESTORAGE
public:
CacheStorage(nsILoadContextInfo* aInfo,
bool aAllowDisk,
bool aLookupAppCache);
protected:
virtual ~CacheStorage();
nsresult ChooseApplicationCache(nsIURI* aURI, nsIApplicationCache** aCache);
nsRefPtr<LoadContextInfo> mLoadContextInfo;
bool mWriteToDisk : 1;
bool mLookupAppCache : 1;
public:
nsILoadContextInfo* LoadInfo() const { return mLoadContextInfo; }
bool WriteToDisk() const { return mWriteToDisk && !mLoadContextInfo->IsPrivate(); }
bool LookupAppCache() const { return mLookupAppCache; }
};
} // net
} // mozilla
#endif