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 2008 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 SkMovie_DEFINED |
michael@0 | 11 | #define SkMovie_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkRefCnt.h" |
michael@0 | 14 | #include "SkCanvas.h" |
michael@0 | 15 | |
michael@0 | 16 | class SkStreamRewindable; |
michael@0 | 17 | |
michael@0 | 18 | class SkMovie : public SkRefCnt { |
michael@0 | 19 | public: |
michael@0 | 20 | SK_DECLARE_INST_COUNT(SkMovie) |
michael@0 | 21 | |
michael@0 | 22 | /** Try to create a movie from the stream. If the stream format is not |
michael@0 | 23 | supported, return NULL. |
michael@0 | 24 | */ |
michael@0 | 25 | static SkMovie* DecodeStream(SkStreamRewindable*); |
michael@0 | 26 | /** Try to create a movie from the specified file path. If the file is not |
michael@0 | 27 | found, or the format is not supported, return NULL. If a movie is |
michael@0 | 28 | returned, the stream may be retained by the movie (via ref()) until |
michael@0 | 29 | the movie is finished with it (by calling unref()). |
michael@0 | 30 | */ |
michael@0 | 31 | static SkMovie* DecodeFile(const char path[]); |
michael@0 | 32 | /** Try to create a movie from the specified memory. |
michael@0 | 33 | If the format is not supported, return NULL. If a movie is returned, |
michael@0 | 34 | the data will have been read or copied, and so the caller may free |
michael@0 | 35 | it. |
michael@0 | 36 | */ |
michael@0 | 37 | static SkMovie* DecodeMemory(const void* data, size_t length); |
michael@0 | 38 | |
michael@0 | 39 | SkMSec duration(); |
michael@0 | 40 | int width(); |
michael@0 | 41 | int height(); |
michael@0 | 42 | int isOpaque(); |
michael@0 | 43 | |
michael@0 | 44 | /** Specify the time code (between 0...duration) to sample a bitmap |
michael@0 | 45 | from the movie. Returns true if this time code generated a different |
michael@0 | 46 | bitmap/frame from the previous state (i.e. true means you need to |
michael@0 | 47 | redraw). |
michael@0 | 48 | */ |
michael@0 | 49 | bool setTime(SkMSec); |
michael@0 | 50 | |
michael@0 | 51 | // return the right bitmap for the current time code |
michael@0 | 52 | const SkBitmap& bitmap(); |
michael@0 | 53 | |
michael@0 | 54 | protected: |
michael@0 | 55 | struct Info { |
michael@0 | 56 | SkMSec fDuration; |
michael@0 | 57 | int fWidth; |
michael@0 | 58 | int fHeight; |
michael@0 | 59 | bool fIsOpaque; |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | virtual bool onGetInfo(Info*) = 0; |
michael@0 | 63 | virtual bool onSetTime(SkMSec) = 0; |
michael@0 | 64 | virtual bool onGetBitmap(SkBitmap*) = 0; |
michael@0 | 65 | |
michael@0 | 66 | // visible for subclasses |
michael@0 | 67 | SkMovie(); |
michael@0 | 68 | |
michael@0 | 69 | private: |
michael@0 | 70 | Info fInfo; |
michael@0 | 71 | SkMSec fCurrTime; |
michael@0 | 72 | SkBitmap fBitmap; |
michael@0 | 73 | bool fNeedBitmap; |
michael@0 | 74 | |
michael@0 | 75 | void ensureInfo(); |
michael@0 | 76 | |
michael@0 | 77 | typedef SkRefCnt INHERITED; |
michael@0 | 78 | }; |
michael@0 | 79 | |
michael@0 | 80 | #endif |