gecko-dev/ipc/glue/CodeCoverageHandler.h
Marco Castelluccio 42f83ca8dc Bug 1363469 - Define signal handlers to dump and reset coverage counters. r=froydnj,kanru
--HG--
extra : rebase_source : 8fa73f2bfd1eab95caee891d6d68090b58c3ba67
extra : histedit_source : 7b7c633ebecc71508e4c0a4d1161104a511869c5%2C61fefafbedb869fffddb8182d8bfac29108ee1bb
2017-06-14 09:50:44 +01:00

41 lines
1.1 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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 mozilla_codecoveragehandler_h
#define mozilla_codecoveragehandler_h
#include "mozilla/StaticPtr.h"
#include "mozilla/ipc/CrossProcessMutex.h"
using namespace mozilla::ipc;
namespace mozilla {
class CodeCoverageHandler {
public:
static void Init();
static void Init(const CrossProcessMutexHandle& aHandle);
static CodeCoverageHandler* Get();
CrossProcessMutex* GetMutex();
CrossProcessMutexHandle GetMutexHandle(int aProcId);
private:
CodeCoverageHandler();
CodeCoverageHandler(const CrossProcessMutexHandle& aHandle);
static StaticAutoPtr<CodeCoverageHandler> instance;
CrossProcessMutex mGcovLock;
DISALLOW_COPY_AND_ASSIGN(CodeCoverageHandler);
void SetSignalHandlers();
static void DumpCounters(int);
static void ResetCounters(int);
};
}
#endif // mozilla_codecoveragehandler_h