Thu, 15 Jan 2015 15:59:08 +0100
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.
michael@0 | 1 | /* vim: se cin sw=2 ts=2 et : */ |
michael@0 | 2 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 3 | * |
michael@0 | 4 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef __mozilla_widget_GfxInfo_h__ |
michael@0 | 9 | #define __mozilla_widget_GfxInfo_h__ |
michael@0 | 10 | |
michael@0 | 11 | #include "GfxInfoBase.h" |
michael@0 | 12 | |
michael@0 | 13 | namespace mozilla { |
michael@0 | 14 | namespace widget { |
michael@0 | 15 | |
michael@0 | 16 | class GfxInfo : public GfxInfoBase |
michael@0 | 17 | { |
michael@0 | 18 | public: |
michael@0 | 19 | GfxInfo(); |
michael@0 | 20 | |
michael@0 | 21 | // We only declare the subset of nsIGfxInfo that we actually implement. The |
michael@0 | 22 | // rest is brought forward from GfxInfoBase. |
michael@0 | 23 | NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled); |
michael@0 | 24 | NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled); |
michael@0 | 25 | NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion); |
michael@0 | 26 | NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams); |
michael@0 | 27 | NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription); |
michael@0 | 28 | NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver); |
michael@0 | 29 | NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID); |
michael@0 | 30 | NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID); |
michael@0 | 31 | NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM); |
michael@0 | 32 | NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion); |
michael@0 | 33 | NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate); |
michael@0 | 34 | NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription); |
michael@0 | 35 | NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver); |
michael@0 | 36 | NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID); |
michael@0 | 37 | NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID); |
michael@0 | 38 | NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM); |
michael@0 | 39 | NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion); |
michael@0 | 40 | NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate); |
michael@0 | 41 | NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active); |
michael@0 | 42 | using GfxInfoBase::GetFeatureStatus; |
michael@0 | 43 | using GfxInfoBase::GetFeatureSuggestedDriverVersion; |
michael@0 | 44 | using GfxInfoBase::GetWebGLParameter; |
michael@0 | 45 | |
michael@0 | 46 | virtual nsresult Init(); |
michael@0 | 47 | |
michael@0 | 48 | virtual uint32_t OperatingSystemVersion() MOZ_OVERRIDE { return mWindowsVersion; } |
michael@0 | 49 | |
michael@0 | 50 | #ifdef DEBUG |
michael@0 | 51 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 52 | NS_DECL_NSIGFXINFODEBUG |
michael@0 | 53 | #endif |
michael@0 | 54 | |
michael@0 | 55 | protected: |
michael@0 | 56 | |
michael@0 | 57 | virtual nsresult GetFeatureStatusImpl(int32_t aFeature, |
michael@0 | 58 | int32_t *aStatus, |
michael@0 | 59 | nsAString & aSuggestedDriverVersion, |
michael@0 | 60 | const nsTArray<GfxDriverInfo>& aDriverInfo, |
michael@0 | 61 | OperatingSystem* aOS = nullptr); |
michael@0 | 62 | virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo(); |
michael@0 | 63 | |
michael@0 | 64 | private: |
michael@0 | 65 | |
michael@0 | 66 | void AddCrashReportAnnotations(); |
michael@0 | 67 | nsString mDeviceString; |
michael@0 | 68 | nsString mDeviceID; |
michael@0 | 69 | nsString mDriverVersion; |
michael@0 | 70 | nsString mDriverDate; |
michael@0 | 71 | nsString mDeviceKey; |
michael@0 | 72 | nsString mDeviceKeyDebug; |
michael@0 | 73 | nsString mAdapterVendorID; |
michael@0 | 74 | nsString mAdapterDeviceID; |
michael@0 | 75 | uint32_t mAdapterSubsysID; |
michael@0 | 76 | nsString mDeviceString2; |
michael@0 | 77 | nsString mDriverVersion2; |
michael@0 | 78 | nsString mDeviceID2; |
michael@0 | 79 | nsString mDriverDate2; |
michael@0 | 80 | nsString mDeviceKey2; |
michael@0 | 81 | nsString mAdapterVendorID2; |
michael@0 | 82 | nsString mAdapterDeviceID2; |
michael@0 | 83 | uint32_t mAdapterSubsysID2; |
michael@0 | 84 | uint32_t mWindowsVersion; |
michael@0 | 85 | bool mHasDualGPU; |
michael@0 | 86 | bool mIsGPU2Active; |
michael@0 | 87 | bool mHasDriverVersionMismatch; |
michael@0 | 88 | }; |
michael@0 | 89 | |
michael@0 | 90 | } // namespace widget |
michael@0 | 91 | } // namespace mozilla |
michael@0 | 92 | |
michael@0 | 93 | #endif /* __mozilla_widget_GfxInfo_h__ */ |