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 | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * vim: set ts=4 sw=4 et tw=80: |
michael@0 | 3 | * |
michael@0 | 4 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | include DOMTypes; |
michael@0 | 9 | |
michael@0 | 10 | using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; |
michael@0 | 11 | |
michael@0 | 12 | namespace mozilla { |
michael@0 | 13 | namespace jsipc { |
michael@0 | 14 | |
michael@0 | 15 | struct JSIID |
michael@0 | 16 | { |
michael@0 | 17 | uint32_t m0; |
michael@0 | 18 | uint16_t m1; |
michael@0 | 19 | uint16_t m2; |
michael@0 | 20 | uint8_t m3_0; |
michael@0 | 21 | uint8_t m3_1; |
michael@0 | 22 | uint8_t m3_2; |
michael@0 | 23 | uint8_t m3_3; |
michael@0 | 24 | uint8_t m3_4; |
michael@0 | 25 | uint8_t m3_5; |
michael@0 | 26 | uint8_t m3_6; |
michael@0 | 27 | uint8_t m3_7; |
michael@0 | 28 | }; |
michael@0 | 29 | |
michael@0 | 30 | union JSVariant |
michael@0 | 31 | { |
michael@0 | 32 | void_t; /* |undefined| */ |
michael@0 | 33 | nsString; /* StringValue(x) */ |
michael@0 | 34 | uint64_t; /* ID that maps to a JSObject (cpow on parent, original on child). */ |
michael@0 | 35 | double; /* NumberValue(x) */ |
michael@0 | 36 | bool; /* BooleanValue(x) */ |
michael@0 | 37 | JSIID; /* XPC nsIID */ |
michael@0 | 38 | }; |
michael@0 | 39 | |
michael@0 | 40 | struct ReturnSuccess |
michael@0 | 41 | { |
michael@0 | 42 | }; |
michael@0 | 43 | |
michael@0 | 44 | struct ReturnStopIteration |
michael@0 | 45 | { |
michael@0 | 46 | }; |
michael@0 | 47 | |
michael@0 | 48 | struct ReturnException |
michael@0 | 49 | { |
michael@0 | 50 | JSVariant exn; |
michael@0 | 51 | }; |
michael@0 | 52 | |
michael@0 | 53 | union ReturnStatus |
michael@0 | 54 | { |
michael@0 | 55 | ReturnSuccess; |
michael@0 | 56 | ReturnStopIteration; |
michael@0 | 57 | ReturnException; |
michael@0 | 58 | }; |
michael@0 | 59 | |
michael@0 | 60 | union JSParam |
michael@0 | 61 | { |
michael@0 | 62 | void_t; /* value is strictly an xpc out param */ |
michael@0 | 63 | JSVariant; /* actual value to pass through */ |
michael@0 | 64 | }; |
michael@0 | 65 | |
michael@0 | 66 | struct PPropertyDescriptor |
michael@0 | 67 | { |
michael@0 | 68 | uint64_t objId; |
michael@0 | 69 | uint32_t attrs; |
michael@0 | 70 | JSVariant value; |
michael@0 | 71 | |
michael@0 | 72 | // How to interpret these values depends on whether JSPROP_GETTER/SETTER |
michael@0 | 73 | // are set. If set, the corresponding value is a CPOW or 0 for NULL. |
michael@0 | 74 | // Otherwise, the following table is used: |
michael@0 | 75 | // |
michael@0 | 76 | // 0 - NULL |
michael@0 | 77 | // 1 - Default getter or setter. |
michael@0 | 78 | // 2 - js_GetterOnlyPropertyStub (setter only) |
michael@0 | 79 | // 3 - Unknown |
michael@0 | 80 | uint64_t getter; |
michael@0 | 81 | uint64_t setter; |
michael@0 | 82 | }; |
michael@0 | 83 | |
michael@0 | 84 | struct CpowEntry |
michael@0 | 85 | { |
michael@0 | 86 | nsString name; |
michael@0 | 87 | JSVariant value; |
michael@0 | 88 | }; |
michael@0 | 89 | |
michael@0 | 90 | } |
michael@0 | 91 | } |