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