Bug 784739 - Switch from NULL to nullptr in startupcache/; r=ehsan

This commit is contained in:
Birunthan Mohanathas 2013-07-31 11:44:43 -04:00
Родитель c742394e75
Коммит d93bd41797
3 изменённых файлов: 22 добавлений и 22 удалений

Просмотреть файл

@ -126,7 +126,7 @@ bool StartupCache::gIgnoreDiskCache;
enum StartupCache::TelemetrifyAge StartupCache::gPostFlushAgeAction = StartupCache::IGNORE_AGE;
StartupCache::StartupCache()
: mArchive(NULL), mStartupWriteInitiated(false), mWriteThread(NULL),
: mArchive(nullptr), mStartupWriteInitiated(false), mWriteThread(nullptr),
mMappingMemoryReporter(nullptr), mDataMemoryReporter(nullptr) { }
StartupCache::~StartupCache()
@ -254,7 +254,7 @@ StartupCache::LoadArchive(enum TelemetrifyAge flag)
return NS_ERROR_FAILURE;
bool exists;
mArchive = NULL;
mArchive = nullptr;
nsresult rv = mFile->Exists(&exists);
if (NS_FAILED(rv) || !exists)
return NS_ERROR_FILE_NOT_FOUND;
@ -481,7 +481,7 @@ StartupCache::WriteToDisk()
mTable.Enumerate(CacheCloseHelper, &holder);
// Close the archive so Windows doesn't choke.
mArchive = NULL;
mArchive = nullptr;
zipW->Close();
// We succesfully wrote the archive to disk; mark the disk file as trusted
@ -498,7 +498,7 @@ StartupCache::InvalidateCache()
{
WaitOnWriteThread();
mTable.Clear();
mArchive = NULL;
mArchive = nullptr;
nsresult rv = mFile->Remove(false);
if (NS_FAILED(rv) && rv != NS_ERROR_FILE_TARGET_DOES_NOT_EXIST &&
rv != NS_ERROR_FILE_NOT_FOUND) {
@ -531,7 +531,7 @@ StartupCache::WaitOnWriteThread()
return;
PR_JoinThread(mWriteThread);
mWriteThread = NULL;
mWriteThread = nullptr;
}
void
@ -551,7 +551,7 @@ StartupCache::WriteTimeout(nsITimer *aTimer, void *aClosure)
{
gStartupCache->mWriteThread = PR_CreateThread(PR_USER_THREAD,
StartupCache::ThreadedWrite,
NULL,
nullptr,
PR_PRIORITY_NORMAL,
PR_LOCAL_THREAD,
PR_JOINABLE_THREAD,

Просмотреть файл

@ -23,23 +23,23 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(StartupCacheWrapper,
NS_DEFINE_NAMED_CID(NS_STARTUPCACHE_CID);
static const mozilla::Module::CIDEntry kStartupCacheCIDs[] = {
{ &kNS_STARTUPCACHE_CID, false, NULL, StartupCacheWrapperConstructor },
{ NULL }
{ &kNS_STARTUPCACHE_CID, false, nullptr, StartupCacheWrapperConstructor },
{ nullptr }
};
static const mozilla::Module::ContractIDEntry kStartupCacheContracts[] = {
{ "@mozilla.org/startupcache/cache;1", &kNS_STARTUPCACHE_CID },
{ NULL }
{ nullptr }
};
static const mozilla::Module kStartupCacheModule = {
mozilla::Module::kVersion,
kStartupCacheCIDs,
kStartupCacheContracts,
NULL,
NULL,
NULL,
NULL
nullptr,
nullptr,
nullptr,
nullptr
};
NSMODULE_DEFN(StartupCacheModule) = &kStartupCacheModule;

Просмотреть файл

@ -91,7 +91,7 @@ TestStartupWriteRead() {
const char* buf = "Market opportunities for BeardBook";
const char* id = "id";
char* outbufPtr = NULL;
char* outbufPtr = nullptr;
nsAutoArrayPtr<char> outbuf;
uint32_t len;
@ -120,7 +120,7 @@ TestWriteInvalidateRead() {
nsresult rv;
const char* buf = "BeardBook competitive analysis";
const char* id = "id";
char* outbuf = NULL;
char* outbuf = nullptr;
uint32_t len;
nsCOMPtr<nsIStartupCache> sc
= do_GetService("@mozilla.org/startupcache/cache;1", &rv);
@ -196,7 +196,7 @@ TestWriteObject() {
return rv;
}
char* bufPtr = NULL;
char* bufPtr = nullptr;
nsAutoArrayPtr<char> buf;
uint32_t len;
NewBufferFromStorageStream(storageStream, &bufPtr, &len);
@ -210,7 +210,7 @@ TestWriteObject() {
return rv;
}
char* buf2Ptr = NULL;
char* buf2Ptr = nullptr;
nsAutoArrayPtr<char> buf2;
uint32_t len2;
nsCOMPtr<nsIObjectInputStream> objectInput;
@ -315,7 +315,7 @@ TestIgnoreDiskCache(nsIFile* profileDir) {
const char* buf = "Get a Beardbook app for your smartphone";
const char* id = "id";
char* outbuf = NULL;
char* outbuf = nullptr;
uint32_t len;
rv = sc->PutBuffer(id, buf, strlen(buf) + 1);
@ -361,7 +361,7 @@ TestEarlyShutdown() {
const char* buf = "Find your soul beardmate on BeardBook";
const char* id = "id";
uint32_t len;
char* outbuf = NULL;
char* outbuf = nullptr;
sc->ResetStartupWriteTimer();
rv = sc->PutBuffer(id, buf, strlen(buf) + 1);
@ -413,13 +413,13 @@ GetHistogramCounts(const char *testmsg, const nsACString &histogram_id,
passed(testmsg);
Rooted<Value> snapshot_val(cx);
JSFunction *snapshot_fn = NULL;
JSFunction *snapshot_fn = nullptr;
Rooted<Value> ss(cx);
return (JS_GetProperty(cx, JSVAL_TO_OBJECT(h), "snapshot",
&snapshot_val)
&& (snapshot_fn = JS_ValueToFunction(cx, snapshot_val))
&& JS::Call(cx, JSVAL_TO_OBJECT(h),
snapshot_fn, 0, NULL, &ss)
snapshot_fn, 0, nullptr, &ss)
&& JS_GetProperty(cx, JSVAL_TO_OBJECT(ss), "counts", counts));
}
@ -522,7 +522,7 @@ int main(int argc, char** argv)
};
JSObject *glob = nullptr;
if (use_js)
glob = JS_NewGlobalObject(cx, &global_class, NULL);
glob = JS_NewGlobalObject(cx, &global_class, nullptr);
if (!glob)
use_js = false;
mozilla::Maybe<JSAutoCompartment> ac;