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.
2 /*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8 #ifndef SkTextLayout_DEFINED
9 #define SkTextLayout_DEFINED
11 #include "SkPaint.h"
12 #include "SkRefCnt.h"
14 class SkTextStyle : public SkRefCnt {
15 public:
16 SK_DECLARE_INST_COUNT(SkTextStyle)
18 SkTextStyle();
19 SkTextStyle(const SkTextStyle&);
20 explicit SkTextStyle(const SkPaint&);
21 virtual ~SkTextStyle();
23 const SkPaint& paint() const { return fPaint; }
24 SkPaint& paint() { return fPaint; }
26 // todo: bidi-override, language
28 private:
29 SkPaint fPaint;
31 typedef SkRefCnt INHERITED;
32 };
34 class SkTextLayout {
35 public:
36 SkTextLayout();
37 ~SkTextLayout();
39 void setText(const char text[], size_t length);
40 void setBounds(const SkRect& bounds);
42 SkTextStyle* getDefaultStyle() const { return fDefaultStyle; }
43 SkTextStyle* setDefaultStyle(SkTextStyle*);
45 // SkTextStyle* setStyle(SkTextStyle*, size_t offset, size_t length);
47 void draw(SkCanvas* canvas);
49 private:
50 SkTDArray<char> fText;
51 SkTextStyle* fDefaultStyle;
52 SkRect fBounds;
54 // cache
55 struct Line;
56 struct GlyphRun;
57 SkTDArray<Line*> fLines;
58 };
60 #endif