gfx/2d/ScaledFontMac.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: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     2  * This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef MOZILLA_GFX_SCALEDFONTMAC_H_
     7 #define MOZILLA_GFX_SCALEDFONTMAC_H_
     9 #import <ApplicationServices/ApplicationServices.h>
    10 #include "2D.h"
    12 #include "ScaledFontBase.h"
    14 namespace mozilla {
    15 namespace gfx {
    17 class ScaledFontMac : public ScaledFontBase
    18 {
    19 public:
    20   MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(ScaledFontMac)
    21   ScaledFontMac(CGFontRef aFont, Float aSize);
    22   virtual ~ScaledFontMac();
    24   virtual FontType GetType() const { return FontType::MAC; }
    25 #ifdef USE_SKIA
    26   virtual SkTypeface* GetSkTypeface();
    27 #endif
    28   virtual TemporaryRef<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget);
    29   virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, BackendType aBackendType, const Matrix *aTransformHint);
    30   virtual bool GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton);
    32 private:
    33   friend class DrawTargetCG;
    34   CGFontRef mFont;
    35   CTFontRef mCTFont; // only created if CTFontDrawGlyphs is available, otherwise null
    37   typedef void (CTFontDrawGlyphsFuncT)(CTFontRef,
    38                                        const CGGlyph[], const CGPoint[],
    39                                        size_t, CGContextRef);
    41   static bool sSymbolLookupDone;
    43 public:
    44   // function pointer for CTFontDrawGlyphs, if available;
    45   // initialized the first time a ScaledFontMac is created,
    46   // so it will be valid by the time DrawTargetCG wants to use it
    47   static CTFontDrawGlyphsFuncT* CTFontDrawGlyphsPtr;
    48 };
    50 }
    51 }
    53 #endif /* MOZILLA_GFX_SCALEDFONTMAC_H_ */

mercurial