widget/xpwidgets/GfxInfoX11.h

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

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.

     1 /* vim: se cin sw=2 ts=2 et : */
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     3  *
     4  * This Source Code Form is subject to the terms of the Mozilla Public
     5  * License, v. 2.0. If a copy of the MPL was not distributed with this
     6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 #ifndef __GfxInfoX11_h__
     9 #define __GfxInfoX11_h__
    11 #include "GfxInfoBase.h"
    13 namespace mozilla {
    14 namespace widget {
    16 class GfxInfo : public GfxInfoBase
    17 {
    18 public:
    20   // We only declare the subset of nsIGfxInfo that we actually implement. The
    21   // rest is brought forward from GfxInfoBase.
    22   NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled);
    23   NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled);
    24   NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion);
    25   NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams);
    26   NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription);
    27   NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver);
    28   NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID);
    29   NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID);
    30   NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM);
    31   NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion);
    32   NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate);
    33   NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription);
    34   NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver);
    35   NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID);
    36   NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID);
    37   NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM);
    38   NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion);
    39   NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate);
    40   NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active);
    41   using GfxInfoBase::GetFeatureStatus;
    42   using GfxInfoBase::GetFeatureSuggestedDriverVersion;
    43   using GfxInfoBase::GetWebGLParameter;
    45   virtual nsresult Init();
    47   NS_IMETHOD_(void) GetData();
    49 #ifdef DEBUG
    50   NS_DECL_ISUPPORTS_INHERITED
    51   NS_DECL_NSIGFXINFODEBUG
    52 #endif
    54 protected:
    56   virtual nsresult GetFeatureStatusImpl(int32_t aFeature, 
    57                                         int32_t *aStatus, 
    58                                         nsAString & aSuggestedDriverVersion, 
    59                                         const nsTArray<GfxDriverInfo>& aDriverInfo, 
    60                                         OperatingSystem* aOS = nullptr);
    61   virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo();
    63 private:
    64   nsCString mVendor;
    65   nsCString mRenderer;
    66   nsCString mVersion;
    67   nsCString mAdapterDescription;
    68   nsCString mOS;
    69   nsCString mOSRelease;
    70   bool mIsMesa, mIsNVIDIA, mIsFGLRX, mIsNouveau, mIsIntel, mIsOldSwrast, mIsLlvmpipe;
    71   bool mHasTextureFromPixmap;
    72   int mGLMajorVersion, mMajorVersion, mMinorVersion, mRevisionVersion;
    74   void AddCrashReportAnnotations();
    75 };
    77 } // namespace widget
    78 } // namespace mozilla
    80 #endif /* __GfxInfoX11_h__ */

mercurial