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 | /* ***** BEGIN LICENSE BLOCK ***** |
michael@0 | 2 | * |
michael@0 | 3 | * Copyright (c) 2010, Mozilla Corporation |
michael@0 | 4 | * All rights reserved. |
michael@0 | 5 | * |
michael@0 | 6 | * Redistribution and use in source and binary forms, with or without |
michael@0 | 7 | * modification, are permitted provided that the following conditions are met: |
michael@0 | 8 | * |
michael@0 | 9 | * * Redistributions of source code must retain the above copyright notice, this |
michael@0 | 10 | * list of conditions and the following disclaimer. |
michael@0 | 11 | * * Redistributions in binary form must reproduce the above copyright notice, |
michael@0 | 12 | * this list of conditions and the following disclaimer in the documentation |
michael@0 | 13 | * and/or other materials provided with the distribution. |
michael@0 | 14 | * * Neither the name of the Mozilla Corporation nor the names of its |
michael@0 | 15 | * contributors may be used to endorse or promote products derived from this |
michael@0 | 16 | * software without specific prior written permission. |
michael@0 | 17 | * |
michael@0 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
michael@0 | 19 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
michael@0 | 20 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
michael@0 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
michael@0 | 22 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
michael@0 | 23 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
michael@0 | 24 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
michael@0 | 25 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
michael@0 | 26 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
michael@0 | 27 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
michael@0 | 28 | * |
michael@0 | 29 | * Contributor(s): |
michael@0 | 30 | * Brad Lassey <blassey@mozilla.com> |
michael@0 | 31 | * |
michael@0 | 32 | * ***** END LICENSE BLOCK ***** */ |
michael@0 | 33 | #include "nptest_platform.h" |
michael@0 | 34 | #include "npapi.h" |
michael@0 | 35 | |
michael@0 | 36 | struct _PlatformData { |
michael@0 | 37 | }; |
michael@0 | 38 | using namespace std; |
michael@0 | 39 | |
michael@0 | 40 | bool |
michael@0 | 41 | pluginSupportsWindowMode() |
michael@0 | 42 | { |
michael@0 | 43 | return false; |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | bool |
michael@0 | 47 | pluginSupportsWindowlessMode() |
michael@0 | 48 | { |
michael@0 | 49 | return true; |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | bool |
michael@0 | 53 | pluginSupportsAsyncBitmapDrawing() |
michael@0 | 54 | { |
michael@0 | 55 | return false; |
michael@0 | 56 | } |
michael@0 | 57 | |
michael@0 | 58 | NPError |
michael@0 | 59 | pluginInstanceInit(InstanceData* instanceData) |
michael@0 | 60 | { |
michael@0 | 61 | printf("NPERR_INCOMPATIBLE_VERSION_ERROR\n"); |
michael@0 | 62 | return NPERR_INCOMPATIBLE_VERSION_ERROR; |
michael@0 | 63 | } |
michael@0 | 64 | |
michael@0 | 65 | void |
michael@0 | 66 | pluginInstanceShutdown(InstanceData* instanceData) |
michael@0 | 67 | { |
michael@0 | 68 | NPN_MemFree(instanceData->platformData); |
michael@0 | 69 | instanceData->platformData = 0; |
michael@0 | 70 | } |
michael@0 | 71 | |
michael@0 | 72 | void |
michael@0 | 73 | pluginDoSetWindow(InstanceData* instanceData, NPWindow* newWindow) |
michael@0 | 74 | { |
michael@0 | 75 | instanceData->window = *newWindow; |
michael@0 | 76 | } |
michael@0 | 77 | |
michael@0 | 78 | void |
michael@0 | 79 | pluginWidgetInit(InstanceData* instanceData, void* oldWindow) |
michael@0 | 80 | { |
michael@0 | 81 | // XXX nothing here yet since we don't support windowed plugins |
michael@0 | 82 | } |
michael@0 | 83 | |
michael@0 | 84 | int16_t |
michael@0 | 85 | pluginHandleEvent(InstanceData* instanceData, void* event) |
michael@0 | 86 | { |
michael@0 | 87 | return 0; |
michael@0 | 88 | } |
michael@0 | 89 | |
michael@0 | 90 | int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge) |
michael@0 | 91 | { |
michael@0 | 92 | // XXX nothing here yet since we don't support windowed plugins |
michael@0 | 93 | return NPTEST_INT32_ERROR; |
michael@0 | 94 | } |
michael@0 | 95 | |
michael@0 | 96 | int32_t pluginGetClipRegionRectCount(InstanceData* instanceData) |
michael@0 | 97 | { |
michael@0 | 98 | // XXX nothing here yet since we don't support windowed plugins |
michael@0 | 99 | return NPTEST_INT32_ERROR; |
michael@0 | 100 | } |
michael@0 | 101 | |
michael@0 | 102 | int32_t pluginGetClipRegionRectEdge(InstanceData* instanceData, |
michael@0 | 103 | int32_t rectIndex, RectEdge edge) |
michael@0 | 104 | { |
michael@0 | 105 | // XXX nothing here yet since we don't support windowed plugins |
michael@0 | 106 | return NPTEST_INT32_ERROR; |
michael@0 | 107 | } |
michael@0 | 108 | |
michael@0 | 109 | void pluginDoInternalConsistencyCheck(InstanceData* instanceData, string& error) |
michael@0 | 110 | { |
michael@0 | 111 | } |