Sat, 03 Jan 2015 20:18:00 +0100
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.
michael@0 | 1 | |
michael@0 | 2 | /* |
michael@0 | 3 | * Copyright 2006 The Android Open Source Project |
michael@0 | 4 | * |
michael@0 | 5 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 6 | * found in the LICENSE file. |
michael@0 | 7 | */ |
michael@0 | 8 | |
michael@0 | 9 | |
michael@0 | 10 | #ifndef SkBounder_DEFINED |
michael@0 | 11 | #define SkBounder_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkTypes.h" |
michael@0 | 14 | #include "SkRefCnt.h" |
michael@0 | 15 | #include "SkPoint.h" |
michael@0 | 16 | |
michael@0 | 17 | struct SkGlyph; |
michael@0 | 18 | struct SkIRect; |
michael@0 | 19 | struct SkPoint; |
michael@0 | 20 | struct SkRect; |
michael@0 | 21 | class SkPaint; |
michael@0 | 22 | class SkPath; |
michael@0 | 23 | class SkRegion; |
michael@0 | 24 | |
michael@0 | 25 | /** \class SkBounder |
michael@0 | 26 | |
michael@0 | 27 | Base class for intercepting the device bounds of shapes before they are drawn. |
michael@0 | 28 | Install a subclass of this in your canvas. |
michael@0 | 29 | */ |
michael@0 | 30 | class SkBounder : public SkRefCnt { |
michael@0 | 31 | public: |
michael@0 | 32 | SK_DECLARE_INST_COUNT(SkBounder) |
michael@0 | 33 | |
michael@0 | 34 | SkBounder(); |
michael@0 | 35 | |
michael@0 | 36 | /* Call to perform a clip test before calling onIRect. |
michael@0 | 37 | Returns the result from onIRect. |
michael@0 | 38 | */ |
michael@0 | 39 | bool doIRect(const SkIRect&); |
michael@0 | 40 | bool doIRectGlyph(const SkIRect& , int x, int y, const SkGlyph&); |
michael@0 | 41 | |
michael@0 | 42 | protected: |
michael@0 | 43 | /** Override in your subclass. This is called with the device bounds of an |
michael@0 | 44 | object (text, geometry, image) just before it is drawn. If your method |
michael@0 | 45 | returns false, the drawing for that shape is aborted. If your method |
michael@0 | 46 | returns true, drawing continues. The bounds your method receives have already |
michael@0 | 47 | been transformed in to device coordinates, and clipped to the current clip. |
michael@0 | 48 | */ |
michael@0 | 49 | virtual bool onIRect(const SkIRect&) { |
michael@0 | 50 | return false; |
michael@0 | 51 | } |
michael@0 | 52 | |
michael@0 | 53 | /** Passed to onIRectGlyph with the information about the current glyph. |
michael@0 | 54 | LSB and RSB are fixed-point (16.16) coordinates of the start and end |
michael@0 | 55 | of the glyph's advance |
michael@0 | 56 | */ |
michael@0 | 57 | struct GlyphRec { |
michael@0 | 58 | SkIPoint fLSB; //!< fixed-point left-side-bearing of the glyph |
michael@0 | 59 | SkIPoint fRSB; //!< fixed-point right-side-bearing of the glyph |
michael@0 | 60 | uint16_t fGlyphID; |
michael@0 | 61 | uint16_t fFlags; //!< currently set to 0 |
michael@0 | 62 | }; |
michael@0 | 63 | |
michael@0 | 64 | /** Optionally, override in your subclass to receive the glyph ID when |
michael@0 | 65 | text drawing supplies the device bounds of the object. |
michael@0 | 66 | */ |
michael@0 | 67 | virtual bool onIRectGlyph(const SkIRect& r, const GlyphRec&) { |
michael@0 | 68 | return onIRect(r); |
michael@0 | 69 | } |
michael@0 | 70 | |
michael@0 | 71 | /** Called after each shape has been drawn. The default implementation does |
michael@0 | 72 | nothing, but your override could use this notification to signal itself |
michael@0 | 73 | that the offscreen being rendered into needs to be updated to the screen. |
michael@0 | 74 | */ |
michael@0 | 75 | virtual void commit(); |
michael@0 | 76 | |
michael@0 | 77 | private: |
michael@0 | 78 | bool doHairline(const SkPoint&, const SkPoint&, const SkPaint&); |
michael@0 | 79 | bool doRect(const SkRect&, const SkPaint&); |
michael@0 | 80 | bool doPath(const SkPath&, const SkPaint&, bool doFill); |
michael@0 | 81 | void setClip(const SkRegion* clip) { fClip = clip; } |
michael@0 | 82 | |
michael@0 | 83 | const SkRegion* fClip; |
michael@0 | 84 | friend class SkAutoBounderCommit; |
michael@0 | 85 | friend class SkDraw; |
michael@0 | 86 | friend class SkDrawIter; |
michael@0 | 87 | friend struct Draw1Glyph; |
michael@0 | 88 | friend class SkMaskFilter; |
michael@0 | 89 | |
michael@0 | 90 | typedef SkRefCnt INHERITED; |
michael@0 | 91 | }; |
michael@0 | 92 | |
michael@0 | 93 | #endif |