xpcom/base/nsMemoryInfoDumper.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/base/nsMemoryInfoDumper.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_nsMemoryInfoDumper_h
    1.11 +#define mozilla_nsMemoryInfoDumper_h
    1.12 +
    1.13 +#include "nsIMemoryInfoDumper.h"
    1.14 +
    1.15 +class nsACString;
    1.16 +
    1.17 +/**
    1.18 + * This class facilitates dumping information about our memory usage to disk.
    1.19 + *
    1.20 + * Its cpp file also has Linux-only code which watches various OS signals and
    1.21 + * dumps memory info upon receiving a signal.  You can activate these listeners
    1.22 + * by calling Initialize().
    1.23 + */
    1.24 +class nsMemoryInfoDumper : public nsIMemoryInfoDumper
    1.25 +{
    1.26 +public:
    1.27 +  NS_DECL_ISUPPORTS
    1.28 +  NS_DECL_NSIMEMORYINFODUMPER
    1.29 +
    1.30 +  nsMemoryInfoDumper();
    1.31 +  virtual ~nsMemoryInfoDumper();
    1.32 +
    1.33 +public:
    1.34 +  static void Initialize();
    1.35 +
    1.36 +#ifdef MOZ_DMD
    1.37 +  static nsresult DumpDMD(const nsAString &aIdentifier);
    1.38 +#endif
    1.39 +};
    1.40 +
    1.41 +#define NS_MEMORY_INFO_DUMPER_CID \
    1.42 +{ 0x00bd71fb, 0x7f09, 0x4ec3, \
    1.43 +{ 0x96, 0xaf, 0xa0, 0xb5, 0x22, 0xb7, 0x79, 0x69 } }
    1.44 +
    1.45 +#endif

mercurial