dom/plugins/test/testplugin/nptest_qt.cpp

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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) 2008, 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 * Josh Aas <josh@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 using namespace std;
michael@0 37
michael@0 38 bool
michael@0 39 pluginSupportsWindowMode()
michael@0 40 {
michael@0 41 return false;
michael@0 42 }
michael@0 43
michael@0 44 bool
michael@0 45 pluginSupportsWindowlessMode()
michael@0 46 {
michael@0 47 return true;
michael@0 48 }
michael@0 49
michael@0 50 bool
michael@0 51 pluginSupportsAsyncBitmapDrawing()
michael@0 52 {
michael@0 53 return false;
michael@0 54 }
michael@0 55
michael@0 56 NPError
michael@0 57 pluginInstanceInit(InstanceData* instanceData)
michael@0 58 {
michael@0 59 printf("NPERR_INCOMPATIBLE_VERSION_ERROR\n");
michael@0 60 return NPERR_INCOMPATIBLE_VERSION_ERROR;
michael@0 61 }
michael@0 62
michael@0 63 void
michael@0 64 pluginInstanceShutdown(InstanceData* instanceData)
michael@0 65 {
michael@0 66 NPN_MemFree(instanceData->platformData);
michael@0 67 instanceData->platformData = 0;
michael@0 68 }
michael@0 69
michael@0 70 void
michael@0 71 pluginDoSetWindow(InstanceData* instanceData, NPWindow* newWindow)
michael@0 72 {
michael@0 73 instanceData->window = *newWindow;
michael@0 74 }
michael@0 75
michael@0 76 void
michael@0 77 pluginWidgetInit(InstanceData* instanceData, void* oldWindow)
michael@0 78 {
michael@0 79 // XXX nothing here yet since we don't support windowed plugins
michael@0 80 }
michael@0 81
michael@0 82 int16_t
michael@0 83 pluginHandleEvent(InstanceData* instanceData, void* event)
michael@0 84 {
michael@0 85 return 0;
michael@0 86 }
michael@0 87
michael@0 88 int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge)
michael@0 89 {
michael@0 90 // XXX nothing here yet since we don't support windowed plugins
michael@0 91 return NPTEST_INT32_ERROR;
michael@0 92 }
michael@0 93
michael@0 94 int32_t pluginGetClipRegionRectCount(InstanceData* instanceData)
michael@0 95 {
michael@0 96 // XXX nothing here yet since we don't support windowed plugins
michael@0 97 return NPTEST_INT32_ERROR;
michael@0 98 }
michael@0 99
michael@0 100 int32_t pluginGetClipRegionRectEdge(InstanceData* instanceData,
michael@0 101 int32_t rectIndex, RectEdge edge)
michael@0 102 {
michael@0 103 // XXX nothing here yet since we don't support windowed plugins
michael@0 104 return NPTEST_INT32_ERROR;
michael@0 105 }
michael@0 106
michael@0 107 void pluginDoInternalConsistencyCheck(InstanceData* instanceData, string& error)
michael@0 108 {
michael@0 109 }

mercurial