modules/libjar/zipwriter/src/ZipWriterModule.cpp

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 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
     4  */
     6 #include "mozilla/ModuleUtils.h"
     7 #include "nsDeflateConverter.h"
     8 #include "nsZipWriter.h"
    10 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeflateConverter)
    11 NS_GENERIC_FACTORY_CONSTRUCTOR(nsZipWriter)
    13 NS_DEFINE_NAMED_CID(DEFLATECONVERTER_CID);
    14 NS_DEFINE_NAMED_CID(ZIPWRITER_CID);
    16 static const mozilla::Module::CIDEntry kZipWriterCIDs[] = {
    17   { &kDEFLATECONVERTER_CID, false, nullptr, nsDeflateConverterConstructor },
    18   { &kZIPWRITER_CID, false, nullptr, nsZipWriterConstructor },
    19   { nullptr }
    20 };
    22 static const mozilla::Module::ContractIDEntry kZipWriterContracts[] = {
    23   { "@mozilla.org/streamconv;1?from=uncompressed&to=deflate", &kDEFLATECONVERTER_CID },
    24   { "@mozilla.org/streamconv;1?from=uncompressed&to=gzip", &kDEFLATECONVERTER_CID },
    25   { "@mozilla.org/streamconv;1?from=uncompressed&to=x-gzip", &kDEFLATECONVERTER_CID },
    26   { "@mozilla.org/streamconv;1?from=uncompressed&to=rawdeflate", &kDEFLATECONVERTER_CID },
    27   { ZIPWRITER_CONTRACTID, &kZIPWRITER_CID },
    28   { nullptr }
    29 };
    31 static const mozilla::Module kZipWriterModule = {
    32   mozilla::Module::kVersion,
    33   kZipWriterCIDs,
    34   kZipWriterContracts
    35 };
    37 NSMODULE_DEFN(ZipWriterModule) = &kZipWriterModule;

mercurial