mozglue/build/WindowsDllBlocklist.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef mozilla_windowsdllblocklist_h
     7 #define mozilla_windowsdllblocklist_h
     9 #if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
    11 #include <windows.h>
    12 #include "mozilla/GuardObjects.h"
    13 #include "nscore.h"
    15 #define HAS_DLL_BLOCKLIST
    17 NS_IMPORT void DllBlocklist_Initialize();
    18 NS_IMPORT void DllBlocklist_SetInXPCOMLoadOnMainThread(bool inXPCOMLoadOnMainThread);
    19 NS_IMPORT void DllBlocklist_WriteNotes(HANDLE file);
    21 class AutoSetXPCOMLoadOnMainThread
    22 {
    23   public:
    24     AutoSetXPCOMLoadOnMainThread(MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM) {
    25       MOZ_GUARD_OBJECT_NOTIFIER_INIT;
    26       DllBlocklist_SetInXPCOMLoadOnMainThread(true);
    27     }
    29     ~AutoSetXPCOMLoadOnMainThread() {
    30       DllBlocklist_SetInXPCOMLoadOnMainThread(false);
    31     }
    33   private:
    34     MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
    35 };
    37 #endif // defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
    38 #endif // mozilla_windowsdllblocklist_h

mercurial