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 | #include "nsString.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace mozilla { |
michael@0 | 16 | namespace widget { |
michael@0 | 17 | |
michael@0 | 18 | class GfxInfo : public GfxInfoBase |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | |
michael@0 | 22 | GfxInfo(); |
michael@0 | 23 | // We only declare the subset of nsIGfxInfo that we actually implement. The |
michael@0 | 24 | // rest is brought forward from GfxInfoBase. |
michael@0 | 25 | NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled); |
michael@0 | 26 | NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled); |
michael@0 | 27 | NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion); |
michael@0 | 28 | NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams); |
michael@0 | 29 | NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription); |
michael@0 | 30 | NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver); |
michael@0 | 31 | NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID); |
michael@0 | 32 | NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID); |
michael@0 | 33 | NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM); |
michael@0 | 34 | NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion); |
michael@0 | 35 | NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate); |
michael@0 | 36 | NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription); |
michael@0 | 37 | NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver); |
michael@0 | 38 | NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID); |
michael@0 | 39 | NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID); |
michael@0 | 40 | NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM); |
michael@0 | 41 | NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion); |
michael@0 | 42 | NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate); |
michael@0 | 43 | NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active); |
michael@0 | 44 | |
michael@0 | 45 | using GfxInfoBase::GetFeatureStatus; |
michael@0 | 46 | using GfxInfoBase::GetFeatureSuggestedDriverVersion; |
michael@0 | 47 | using GfxInfoBase::GetWebGLParameter; |
michael@0 | 48 | |
michael@0 | 49 | virtual nsresult Init(); |
michael@0 | 50 | |
michael@0 | 51 | #ifdef DEBUG |
michael@0 | 52 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 53 | NS_DECL_NSIGFXINFODEBUG |
michael@0 | 54 | #endif |
michael@0 | 55 | |
michael@0 | 56 | virtual uint32_t OperatingSystemVersion() MOZ_OVERRIDE { return mOSXVersion; } |
michael@0 | 57 | |
michael@0 | 58 | protected: |
michael@0 | 59 | |
michael@0 | 60 | virtual nsresult GetFeatureStatusImpl(int32_t aFeature, |
michael@0 | 61 | int32_t *aStatus, |
michael@0 | 62 | nsAString & aSuggestedDriverVersion, |
michael@0 | 63 | const nsTArray<GfxDriverInfo>& aDriverInfo, |
michael@0 | 64 | OperatingSystem* aOS = nullptr); |
michael@0 | 65 | virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo(); |
michael@0 | 66 | |
michael@0 | 67 | private: |
michael@0 | 68 | |
michael@0 | 69 | void GetDeviceInfo(); |
michael@0 | 70 | void AddCrashReportAnnotations(); |
michael@0 | 71 | |
michael@0 | 72 | nsString mAdapterRAMString; |
michael@0 | 73 | nsString mDeviceID; |
michael@0 | 74 | nsString mDriverVersion; |
michael@0 | 75 | nsString mDriverDate; |
michael@0 | 76 | nsString mDeviceKey; |
michael@0 | 77 | |
michael@0 | 78 | nsString mAdapterVendorID; |
michael@0 | 79 | nsString mAdapterDeviceID; |
michael@0 | 80 | |
michael@0 | 81 | uint32_t mOSXVersion; |
michael@0 | 82 | }; |
michael@0 | 83 | |
michael@0 | 84 | } // namespace widget |
michael@0 | 85 | } // namespace mozilla |
michael@0 | 86 | |
michael@0 | 87 | #endif /* __mozilla_widget_GfxInfo_h__ */ |