xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_solaris.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 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 /* Implement shared vtbl methods. */
michael@0 8
michael@0 9 #include "xptcprivate.h"
michael@0 10 #include "xptiprivate.h"
michael@0 11
michael@0 12 nsresult ATTRIBUTE_USED
michael@0 13 PrepareAndDispatch(nsXPTCStubBase* self, uint32_t methodIndex, uint32_t* args)
michael@0 14 {
michael@0 15 #define PARAM_BUFFER_COUNT 16
michael@0 16
michael@0 17 nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
michael@0 18 nsXPTCMiniVariant* dispatchParams = nullptr;
michael@0 19 const nsXPTMethodInfo* info;
michael@0 20 uint8_t paramCount;
michael@0 21 uint8_t i;
michael@0 22 nsresult result = NS_ERROR_FAILURE;
michael@0 23
michael@0 24 NS_ASSERTION(self,"no self");
michael@0 25
michael@0 26 self->mEntry->GetMethodInfo(uint16_t(methodIndex), &info);
michael@0 27 NS_ASSERTION(info,"no interface info");
michael@0 28
michael@0 29 paramCount = info->GetParamCount();
michael@0 30
michael@0 31 // setup variant array pointer
michael@0 32 if(paramCount > PARAM_BUFFER_COUNT)
michael@0 33 dispatchParams = new nsXPTCMiniVariant[paramCount];
michael@0 34 else
michael@0 35 dispatchParams = paramBuffer;
michael@0 36 NS_ASSERTION(dispatchParams,"no place for params");
michael@0 37
michael@0 38 uint32_t* ap = args;
michael@0 39 for(i = 0; i < paramCount; i++, ap++)
michael@0 40 {
michael@0 41 const nsXPTParamInfo& param = info->GetParam(i);
michael@0 42 const nsXPTType& type = param.GetType();
michael@0 43 nsXPTCMiniVariant* dp = &dispatchParams[i];
michael@0 44
michael@0 45 if(param.IsOut() || !type.IsArithmetic())
michael@0 46 {
michael@0 47 dp->val.p = (void*) *ap;
michael@0 48 continue;
michael@0 49 }
michael@0 50 // else
michael@0 51 dp->val.p = (void*) *ap;
michael@0 52 switch(type)
michael@0 53 {
michael@0 54 case nsXPTType::T_I64 : dp->val.i64 = *((int64_t*) ap); ap++; break;
michael@0 55 case nsXPTType::T_U64 : dp->val.u64 = *((uint64_t*)ap); ap++; break;
michael@0 56 case nsXPTType::T_DOUBLE : dp->val.d = *((double*) ap); ap++; break;
michael@0 57 }
michael@0 58 }
michael@0 59
michael@0 60 result = self->mOuter->CallMethod((uint16_t)methodIndex, info, dispatchParams);
michael@0 61
michael@0 62 if(dispatchParams != paramBuffer)
michael@0 63 delete [] dispatchParams;
michael@0 64
michael@0 65 return result;
michael@0 66 }
michael@0 67
michael@0 68 #define STUB_ENTRY(n)
michael@0 69
michael@0 70 #define SENTINEL_ENTRY(n) \
michael@0 71 nsresult nsXPTCStubBase::Sentinel##n() \
michael@0 72 { \
michael@0 73 NS_ERROR("nsXPTCStubBase::Sentinel called"); \
michael@0 74 return NS_ERROR_NOT_IMPLEMENTED; \
michael@0 75 }
michael@0 76
michael@0 77 #include "xptcstubsdef.inc"

mercurial