xpcom/components/nsNativeComponentLoader.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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 nsNativeModuleLoader_h__
     7 #define nsNativeModuleLoader_h__
     9 #include "nsISupports.h"
    10 #include "mozilla/ModuleLoader.h"
    11 #include "nsDataHashtable.h"
    12 #include "nsHashKeys.h"
    13 #include "mozilla/Module.h"
    14 #include "prlink.h"
    16 class nsNativeModuleLoader : public mozilla::ModuleLoader
    17 {
    18  public:
    19     NS_DECL_ISUPPORTS_INHERITED
    21     nsNativeModuleLoader() {}
    22     ~nsNativeModuleLoader() {}
    24     virtual const mozilla::Module* LoadModule(mozilla::FileLocation &aFile) MOZ_OVERRIDE;
    26     nsresult Init();
    28     void UnloadLibraries();
    30  private:
    31     struct NativeLoadData
    32     {
    33         NativeLoadData()
    34             : module(nullptr)
    35             , library(nullptr)
    36         { }
    38         const mozilla::Module* module;
    39         PRLibrary* library;
    40     };
    42     static PLDHashOperator
    43     ReleaserFunc(nsIHashable* aHashedFile, NativeLoadData &aLoadData, void*);
    45     static PLDHashOperator
    46     UnloaderFunc(nsIHashable* aHashedFile, NativeLoadData &aLoadData, void*);
    48     nsDataHashtable<nsHashableHashKey, NativeLoadData> mLibraries;
    49 };
    51 #endif /* nsNativeModuleLoader_h__ */

mercurial