Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef nsWyciwyg_h__ |
michael@0 | 6 | #define nsWyciwyg_h__ |
michael@0 | 7 | |
michael@0 | 8 | #if defined(MOZ_LOGGING) |
michael@0 | 9 | #define FORCE_PR_LOG |
michael@0 | 10 | #endif |
michael@0 | 11 | |
michael@0 | 12 | // e10s mess: IPDL-generatd headers include chromium which both #includes |
michael@0 | 13 | // prlog.h, and #defines LOG in conflict with this file. |
michael@0 | 14 | // Solution: (as described in bug 545995) |
michael@0 | 15 | // 1) ensure that this file is #included before any IPDL-generated files and |
michael@0 | 16 | // anything else that #includes prlog.h, so that we can make sure prlog.h |
michael@0 | 17 | // sees FORCE_PR_LOG if needed. |
michael@0 | 18 | // 2) #include IPDL boilerplate, and then undef LOG so our LOG wins. |
michael@0 | 19 | // 3) nsNetModule.cpp does its own crazy stuff with #including prlog.h |
michael@0 | 20 | // multiple times; allow it to define ALLOW_LATE_NSHTTP_H_INCLUDE to bypass |
michael@0 | 21 | // check. |
michael@0 | 22 | #if defined(PR_LOG) && !defined(ALLOW_LATE_NSHTTP_H_INCLUDE) |
michael@0 | 23 | #error "If nsWyciwyg.h #included it must come before any IPDL-generated files or other files that #include prlog.h" |
michael@0 | 24 | #endif |
michael@0 | 25 | #include "mozilla/net/NeckoChild.h" |
michael@0 | 26 | #undef LOG |
michael@0 | 27 | |
michael@0 | 28 | #include "prlog.h" |
michael@0 | 29 | |
michael@0 | 30 | #if defined(PR_LOGGING) |
michael@0 | 31 | // |
michael@0 | 32 | // Log module for HTTP Protocol logging... |
michael@0 | 33 | // |
michael@0 | 34 | // To enable logging (see prlog.h for full details): |
michael@0 | 35 | // |
michael@0 | 36 | // set NSPR_LOG_MODULES=nsWyciwyg:5 |
michael@0 | 37 | // set NSPR_LOG_FILE=wyciwyg.log |
michael@0 | 38 | // |
michael@0 | 39 | // this enables PR_LOG_ALWAYS level information and places all output in |
michael@0 | 40 | // the file wyciwyg.log |
michael@0 | 41 | // |
michael@0 | 42 | extern PRLogModuleInfo *gWyciwygLog; |
michael@0 | 43 | #endif |
michael@0 | 44 | |
michael@0 | 45 | // http logging |
michael@0 | 46 | #define LOG1(args) PR_LOG(gWyciwygLog, 1, args) |
michael@0 | 47 | #define LOG2(args) PR_LOG(gWyciwygLog, 2, args) |
michael@0 | 48 | #define LOG3(args) PR_LOG(gWyciwygLog, 3, args) |
michael@0 | 49 | #define LOG4(args) PR_LOG(gWyciwygLog, 4, args) |
michael@0 | 50 | #define LOG(args) LOG4(args) |
michael@0 | 51 | |
michael@0 | 52 | #define LOG1_ENABLED() PR_LOG_TEST(gWyciwygLog, 1) |
michael@0 | 53 | #define LOG2_ENABLED() PR_LOG_TEST(gWyciwygLog, 2) |
michael@0 | 54 | #define LOG3_ENABLED() PR_LOG_TEST(gWyciwygLog, 3) |
michael@0 | 55 | #define LOG4_ENABLED() PR_LOG_TEST(gWyciwygLog, 4) |
michael@0 | 56 | #define LOG_ENABLED() LOG4_ENABLED() |
michael@0 | 57 | |
michael@0 | 58 | #define WYCIWYG_TYPE "text/html" |
michael@0 | 59 | |
michael@0 | 60 | #endif // nsWyciwyg_h__ |