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 | * Copyright 2012 Google Inc. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license that can be |
michael@0 | 5 | * found in the LICENSE file. |
michael@0 | 6 | */ |
michael@0 | 7 | |
michael@0 | 8 | #ifndef SKOBJECTPARSER_H_ |
michael@0 | 9 | #define SKOBJECTPARSER_H_ |
michael@0 | 10 | |
michael@0 | 11 | #include "SkCanvas.h" |
michael@0 | 12 | #include "SkString.h" |
michael@0 | 13 | |
michael@0 | 14 | /** \class SkObjectParser |
michael@0 | 15 | |
michael@0 | 16 | The ObjectParser is used to return string information about parameters |
michael@0 | 17 | in each draw command. |
michael@0 | 18 | */ |
michael@0 | 19 | class SkObjectParser { |
michael@0 | 20 | public: |
michael@0 | 21 | |
michael@0 | 22 | /** |
michael@0 | 23 | Returns a string about a bitmaps bounds and config. |
michael@0 | 24 | @param bitmap SkBitmap |
michael@0 | 25 | */ |
michael@0 | 26 | static SkString* BitmapToString(const SkBitmap& bitmap); |
michael@0 | 27 | |
michael@0 | 28 | /** |
michael@0 | 29 | Returns a string representation of a boolean. |
michael@0 | 30 | @param doAA boolean |
michael@0 | 31 | */ |
michael@0 | 32 | static SkString* BoolToString(bool doAA); |
michael@0 | 33 | |
michael@0 | 34 | /** |
michael@0 | 35 | Returns a string representation of the text pointer passed in. |
michael@0 | 36 | */ |
michael@0 | 37 | static SkString* CustomTextToString(const char* text); |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | Returns a string representation of an integer with the text parameter |
michael@0 | 41 | at the front of the string. |
michael@0 | 42 | @param x integer |
michael@0 | 43 | @param text |
michael@0 | 44 | */ |
michael@0 | 45 | static SkString* IntToString(int x, const char* text); |
michael@0 | 46 | /** |
michael@0 | 47 | Returns a string representation of the SkIRects coordinates. |
michael@0 | 48 | @param rect SkIRect |
michael@0 | 49 | */ |
michael@0 | 50 | static SkString* IRectToString(const SkIRect& rect); |
michael@0 | 51 | |
michael@0 | 52 | /** |
michael@0 | 53 | Returns a string representation of an SkMatrix's contents |
michael@0 | 54 | @param matrix SkMatrix |
michael@0 | 55 | */ |
michael@0 | 56 | static SkString* MatrixToString(const SkMatrix& matrix); |
michael@0 | 57 | |
michael@0 | 58 | /** |
michael@0 | 59 | Returns a string representation of an SkPaint's color |
michael@0 | 60 | @param paint SkPaint |
michael@0 | 61 | */ |
michael@0 | 62 | static SkString* PaintToString(const SkPaint& paint); |
michael@0 | 63 | |
michael@0 | 64 | /** |
michael@0 | 65 | Returns a string representation of a SkPath's points. |
michael@0 | 66 | @param path SkPath |
michael@0 | 67 | */ |
michael@0 | 68 | static SkString* PathToString(const SkPath& path); |
michael@0 | 69 | |
michael@0 | 70 | /** |
michael@0 | 71 | Returns a string representation of the points in the point array. |
michael@0 | 72 | @param pts[] Array of SkPoints |
michael@0 | 73 | @param count |
michael@0 | 74 | */ |
michael@0 | 75 | static SkString* PointsToString(const SkPoint pts[], size_t count); |
michael@0 | 76 | |
michael@0 | 77 | /** |
michael@0 | 78 | Returns a string representation of the SkCanvas PointMode enum. |
michael@0 | 79 | */ |
michael@0 | 80 | static SkString* PointModeToString(SkCanvas::PointMode mode); |
michael@0 | 81 | |
michael@0 | 82 | /** |
michael@0 | 83 | Returns a string representation of the SkRects coordinates. |
michael@0 | 84 | @param rect SkRect |
michael@0 | 85 | */ |
michael@0 | 86 | static SkString* RectToString(const SkRect& rect, const char* title = NULL); |
michael@0 | 87 | |
michael@0 | 88 | /** |
michael@0 | 89 | Returns a string representation of an SkRRect. |
michael@0 | 90 | @param rrect SkRRect |
michael@0 | 91 | */ |
michael@0 | 92 | static SkString* RRectToString(const SkRRect& rrect, const char* title = NULL); |
michael@0 | 93 | |
michael@0 | 94 | /** |
michael@0 | 95 | Returns a string representation of the SkRegion enum. |
michael@0 | 96 | @param op SkRegion::op enum |
michael@0 | 97 | */ |
michael@0 | 98 | static SkString* RegionOpToString(SkRegion::Op op); |
michael@0 | 99 | |
michael@0 | 100 | /** |
michael@0 | 101 | Returns a string representation of the SkRegion. |
michael@0 | 102 | @param region SkRegion |
michael@0 | 103 | */ |
michael@0 | 104 | static SkString* RegionToString(const SkRegion& region); |
michael@0 | 105 | |
michael@0 | 106 | /** |
michael@0 | 107 | Returns a string representation of the SkCanvas::SaveFlags enum. |
michael@0 | 108 | @param flags SkCanvas::SaveFlags enum |
michael@0 | 109 | */ |
michael@0 | 110 | static SkString* SaveFlagsToString(SkCanvas::SaveFlags flags); |
michael@0 | 111 | |
michael@0 | 112 | /** |
michael@0 | 113 | Returns a string representation of an SkScalar with the text parameter |
michael@0 | 114 | at the front of the string. |
michael@0 | 115 | @param x SkScalar |
michael@0 | 116 | @param text |
michael@0 | 117 | */ |
michael@0 | 118 | static SkString* ScalarToString(SkScalar x, const char* text); |
michael@0 | 119 | |
michael@0 | 120 | /** |
michael@0 | 121 | Returns a string representation of the char pointer passed in. |
michael@0 | 122 | @param text const void* that will be cast to a char* |
michael@0 | 123 | */ |
michael@0 | 124 | static SkString* TextToString(const void* text, size_t byteLength, |
michael@0 | 125 | SkPaint::TextEncoding encoding); |
michael@0 | 126 | }; |
michael@0 | 127 | |
michael@0 | 128 | #endif |