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 2011 Google Inc. |
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 SkRefDict_DEFINED |
michael@0 | 11 | #define SkRefDict_DEFINED |
michael@0 | 12 | |
michael@0 | 13 | #include "SkRefCnt.h" |
michael@0 | 14 | |
michael@0 | 15 | /** |
michael@0 | 16 | * A dictionary of string,refcnt pairs. The dictionary is also an owner of the |
michael@0 | 17 | * refcnt objects while they are contained. |
michael@0 | 18 | */ |
michael@0 | 19 | class SK_API SkRefDict : SkNoncopyable { |
michael@0 | 20 | public: |
michael@0 | 21 | SkRefDict(); |
michael@0 | 22 | ~SkRefDict(); |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * Return the data associated with name[], or NULL if no matching entry |
michael@0 | 26 | * is found. The reference-count of the entry is not affected. |
michael@0 | 27 | */ |
michael@0 | 28 | SkRefCnt* find(const char name[]) const; |
michael@0 | 29 | |
michael@0 | 30 | /** |
michael@0 | 31 | * If data is NULL, remove (if present) the entry matching name and call |
michael@0 | 32 | * prev_data->unref() on the data for the matching entry. |
michael@0 | 33 | * If data is not-NULL, replace the existing entry matching name and |
michael@0 | 34 | * call (prev_data->unref()), or add a new one. In either case, |
michael@0 | 35 | * data->ref() is called. |
michael@0 | 36 | */ |
michael@0 | 37 | void set(const char name[], SkRefCnt* data); |
michael@0 | 38 | |
michael@0 | 39 | /** |
michael@0 | 40 | * Remove the matching entry (if found) and unref its data. |
michael@0 | 41 | */ |
michael@0 | 42 | void remove(const char name[]) { this->set(name, NULL); } |
michael@0 | 43 | |
michael@0 | 44 | /** |
michael@0 | 45 | * Remove all entries, and unref() their associated data. |
michael@0 | 46 | */ |
michael@0 | 47 | void removeAll(); |
michael@0 | 48 | |
michael@0 | 49 | private: |
michael@0 | 50 | struct Impl; |
michael@0 | 51 | Impl* fImpl; |
michael@0 | 52 | }; |
michael@0 | 53 | |
michael@0 | 54 | #endif |