toolkit/mozapps/update/updater/archivereader.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: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 #ifndef ArchiveReader_h__
     8 #define ArchiveReader_h__
    10 #include "mozilla/NullPtr.h"
    11 #include <stdio.h>
    12 #include "mar.h"
    14 #ifdef XP_WIN
    15   typedef WCHAR NS_tchar;
    16 #else
    17   typedef char NS_tchar;
    18 #endif
    20 // This class provides an API to extract files from an update archive.
    21 class ArchiveReader
    22 {
    23 public:
    24   ArchiveReader() : mArchive(nullptr) {}
    25   ~ArchiveReader() { Close(); }
    27   int Open(const NS_tchar *path);
    28   int VerifySignature();
    29   int VerifyProductInformation(const char *MARChannelID, 
    30                                const char *appVersion);
    31   void Close();
    33   int ExtractFile(const char *item, const NS_tchar *destination);
    34   int ExtractFileToStream(const char *item, FILE *fp);
    36 private:
    37   int ExtractItemToStream(const MarItem *item, FILE *fp);
    39   MarFile *mArchive;
    40 };
    42 #endif  // ArchiveReader_h__

mercurial