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 | #include "SkXMLAnimatorWriter.h" |
michael@0 | 11 | #include "SkAnimator.h" |
michael@0 | 12 | #include "SkAnimateMaker.h" |
michael@0 | 13 | #include "SkDisplayXMLParser.h" |
michael@0 | 14 | |
michael@0 | 15 | SkXMLAnimatorWriter::SkXMLAnimatorWriter(SkAnimator* animator) : fAnimator(animator) |
michael@0 | 16 | { |
michael@0 | 17 | fParser = new SkDisplayXMLParser(*fAnimator->fMaker); |
michael@0 | 18 | } |
michael@0 | 19 | |
michael@0 | 20 | SkXMLAnimatorWriter::~SkXMLAnimatorWriter() { |
michael@0 | 21 | delete fParser; |
michael@0 | 22 | } |
michael@0 | 23 | |
michael@0 | 24 | void SkXMLAnimatorWriter::onAddAttributeLen(const char name[], const char value[], size_t length) |
michael@0 | 25 | { |
michael@0 | 26 | fParser->onAddAttributeLen(name, value, length); |
michael@0 | 27 | } |
michael@0 | 28 | |
michael@0 | 29 | void SkXMLAnimatorWriter::onEndElement() |
michael@0 | 30 | { |
michael@0 | 31 | Elem* elem = getEnd(); |
michael@0 | 32 | fParser->onEndElement(elem->fName.c_str()); |
michael@0 | 33 | doEnd(elem); |
michael@0 | 34 | } |
michael@0 | 35 | |
michael@0 | 36 | void SkXMLAnimatorWriter::onStartElementLen(const char name[], size_t length) |
michael@0 | 37 | { |
michael@0 | 38 | doStart(name, length); |
michael@0 | 39 | fParser->onStartElementLen(name, length); |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | void SkXMLAnimatorWriter::writeHeader() |
michael@0 | 43 | { |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | #ifdef SK_DEBUG |
michael@0 | 47 | #include "SkCanvas.h" |
michael@0 | 48 | #include "SkPaint.h" |
michael@0 | 49 | |
michael@0 | 50 | void SkXMLAnimatorWriter::UnitTest(SkCanvas* canvas) |
michael@0 | 51 | { |
michael@0 | 52 | SkAnimator s; |
michael@0 | 53 | SkXMLAnimatorWriter w(&s); |
michael@0 | 54 | w.startElement("screenplay"); |
michael@0 | 55 | w.startElement("animateField"); |
michael@0 | 56 | w.addAttribute("field", "x1"); |
michael@0 | 57 | w.addAttribute("id", "to100"); |
michael@0 | 58 | w.addAttribute("from", "0"); |
michael@0 | 59 | w.addAttribute("to", "100"); |
michael@0 | 60 | w.addAttribute("dur", "1"); |
michael@0 | 61 | w.endElement(); |
michael@0 | 62 | w.startElement("event"); |
michael@0 | 63 | w.addAttribute("kind", "onLoad"); |
michael@0 | 64 | w.startElement("line"); |
michael@0 | 65 | w.addAttribute("id", "line"); |
michael@0 | 66 | w.addAttribute("x1", "-1"); |
michael@0 | 67 | w.addAttribute("y1", "20"); |
michael@0 | 68 | w.addAttribute("x2", "150"); |
michael@0 | 69 | w.addAttribute("y2", "40"); |
michael@0 | 70 | w.endElement(); |
michael@0 | 71 | w.startElement("apply"); |
michael@0 | 72 | w.addAttribute("animator", "to100"); |
michael@0 | 73 | w.addAttribute("scope", "line"); |
michael@0 | 74 | w.endElement(); |
michael@0 | 75 | w.endElement(); |
michael@0 | 76 | w.endElement(); |
michael@0 | 77 | SkPaint paint; |
michael@0 | 78 | canvas->drawColor(SK_ColorWHITE); |
michael@0 | 79 | s.draw(canvas, &paint, 0); |
michael@0 | 80 | } |
michael@0 | 81 | |
michael@0 | 82 | #endif |