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 (c) 2013 The ANGLE Project Authors. All rights reserved. |
michael@0 | 3 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 4 | // found in the LICENSE file. |
michael@0 | 5 | // |
michael@0 | 6 | |
michael@0 | 7 | // IndexRangeCache.h: Defines the rx::IndexRangeCache class which stores information about |
michael@0 | 8 | // ranges of indices. |
michael@0 | 9 | |
michael@0 | 10 | #ifndef LIBGLESV2_RENDERER_INDEXRANGECACHE_H_ |
michael@0 | 11 | #define LIBGLESV2_RENDERER_INDEXRANGECACHE_H_ |
michael@0 | 12 | |
michael@0 | 13 | #include "common/angleutils.h" |
michael@0 | 14 | |
michael@0 | 15 | namespace rx |
michael@0 | 16 | { |
michael@0 | 17 | |
michael@0 | 18 | class IndexRangeCache |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | void addRange(GLenum type, intptr_t offset, GLsizei count, unsigned int minIdx, unsigned int maxIdx, |
michael@0 | 22 | unsigned int streamOffset); |
michael@0 | 23 | bool findRange(GLenum type, intptr_t offset, GLsizei count, unsigned int *outMinIndex, |
michael@0 | 24 | unsigned int *outMaxIndex, unsigned int *outStreamOffset) const; |
michael@0 | 25 | |
michael@0 | 26 | void invalidateRange(unsigned int offset, unsigned int size); |
michael@0 | 27 | void clear(); |
michael@0 | 28 | |
michael@0 | 29 | private: |
michael@0 | 30 | struct IndexRange |
michael@0 | 31 | { |
michael@0 | 32 | GLenum type; |
michael@0 | 33 | intptr_t offset; |
michael@0 | 34 | GLsizei count; |
michael@0 | 35 | |
michael@0 | 36 | IndexRange(); |
michael@0 | 37 | IndexRange(GLenum type, intptr_t offset, GLsizei count); |
michael@0 | 38 | |
michael@0 | 39 | bool operator<(const IndexRange& rhs) const; |
michael@0 | 40 | }; |
michael@0 | 41 | |
michael@0 | 42 | struct IndexBounds |
michael@0 | 43 | { |
michael@0 | 44 | unsigned int minIndex; |
michael@0 | 45 | unsigned int maxIndex; |
michael@0 | 46 | unsigned int streamOffset; |
michael@0 | 47 | |
michael@0 | 48 | IndexBounds(); |
michael@0 | 49 | IndexBounds(unsigned int minIdx, unsigned int maxIdx, unsigned int offset); |
michael@0 | 50 | }; |
michael@0 | 51 | |
michael@0 | 52 | typedef std::map<IndexRange, IndexBounds> IndexRangeMap; |
michael@0 | 53 | IndexRangeMap mIndexRangeCache; |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | } |
michael@0 | 57 | |
michael@0 | 58 | #endif LIBGLESV2_RENDERER_INDEXRANGECACHE_H |