netwerk/protocol/wyciwyg/nsWyciwyg.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/protocol/wyciwyg/nsWyciwyg.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,60 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +#ifndef nsWyciwyg_h__
     1.9 +#define nsWyciwyg_h__
    1.10 +
    1.11 +#if defined(MOZ_LOGGING)
    1.12 +#define FORCE_PR_LOG
    1.13 +#endif
    1.14 +
    1.15 +// e10s mess: IPDL-generatd headers include chromium which both #includes
    1.16 +// prlog.h, and #defines LOG in conflict with this file.
    1.17 +// Solution: (as described in bug 545995)
    1.18 +// 1) ensure that this file is #included before any IPDL-generated files and
    1.19 +//    anything else that #includes prlog.h, so that we can make sure prlog.h
    1.20 +//    sees FORCE_PR_LOG if needed.
    1.21 +// 2) #include IPDL boilerplate, and then undef LOG so our LOG wins.
    1.22 +// 3) nsNetModule.cpp does its own crazy stuff with #including prlog.h
    1.23 +//    multiple times; allow it to define ALLOW_LATE_NSHTTP_H_INCLUDE to bypass
    1.24 +//    check. 
    1.25 +#if defined(PR_LOG) && !defined(ALLOW_LATE_NSHTTP_H_INCLUDE)
    1.26 +#error "If nsWyciwyg.h #included it must come before any IPDL-generated files or other files that #include prlog.h"
    1.27 +#endif
    1.28 +#include "mozilla/net/NeckoChild.h"
    1.29 +#undef LOG
    1.30 +
    1.31 +#include "prlog.h"
    1.32 +
    1.33 +#if defined(PR_LOGGING)
    1.34 +//
    1.35 +// Log module for HTTP Protocol logging...
    1.36 +//
    1.37 +// To enable logging (see prlog.h for full details):
    1.38 +//
    1.39 +//    set NSPR_LOG_MODULES=nsWyciwyg:5
    1.40 +//    set NSPR_LOG_FILE=wyciwyg.log
    1.41 +//
    1.42 +// this enables PR_LOG_ALWAYS level information and places all output in
    1.43 +// the file wyciwyg.log
    1.44 +//
    1.45 +extern PRLogModuleInfo *gWyciwygLog;
    1.46 +#endif
    1.47 +
    1.48 +// http logging
    1.49 +#define LOG1(args) PR_LOG(gWyciwygLog, 1, args)
    1.50 +#define LOG2(args) PR_LOG(gWyciwygLog, 2, args)
    1.51 +#define LOG3(args) PR_LOG(gWyciwygLog, 3, args)
    1.52 +#define LOG4(args) PR_LOG(gWyciwygLog, 4, args)
    1.53 +#define LOG(args) LOG4(args)
    1.54 +
    1.55 +#define LOG1_ENABLED() PR_LOG_TEST(gWyciwygLog, 1)
    1.56 +#define LOG2_ENABLED() PR_LOG_TEST(gWyciwygLog, 2)
    1.57 +#define LOG3_ENABLED() PR_LOG_TEST(gWyciwygLog, 3)
    1.58 +#define LOG4_ENABLED() PR_LOG_TEST(gWyciwygLog, 4)
    1.59 +#define LOG_ENABLED() LOG4_ENABLED()
    1.60 +
    1.61 +#define WYCIWYG_TYPE "text/html"
    1.62 +
    1.63 +#endif // nsWyciwyg_h__

mercurial