xpcom/reflect/xptcall/src/md/unix/xptcinvoke_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.

     1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     2  *
     3  * This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 /* Platform specific code to invoke XPCOM methods on native objects */
     9 #include "xptcprivate.h"
    11 extern "C" {
    13 // Remember that these 'words' are 32bit DWORDS
    15 uint32_t
    16 invoke_count_words(uint32_t paramCount, nsXPTCVariant* s)
    17 {
    18     uint32_t result = 0;
    19     for(uint32_t i = 0; i < paramCount; i++, s++)
    20     {
    21         if(s->IsPtrData())
    22         {
    23             result++;
    24             continue;
    25         }
    26         result++;
    27         switch(s->type)
    28         {
    29         case nsXPTType::T_I64    :
    30         case nsXPTType::T_U64    :
    31         case nsXPTType::T_DOUBLE :
    32             result++;
    33             break;
    34         }
    35     }
    36     return result;
    37 }
    39 void
    40 invoke_copy_to_stack(uint32_t paramCount, nsXPTCVariant* s, uint32_t* d)
    41 {
    42     for(uint32_t i = 0; i < paramCount; i++, d++, s++)
    43     {
    44         if(s->IsPtrData())
    45         {
    46             *((void**)d) = s->ptr;
    47             continue;
    48         }
    50 /* XXX: the following line is here (rather than as the default clause in
    51  *      the following switch statement) so that the Sun native compiler
    52  *      will generate the correct assembly code on the Solaris Intel
    53  *      platform. See the comments in bug #28817 for more details.
    54  */
    56         *((void**)d) = s->val.p;
    58         switch(s->type)
    59         {
    60         case nsXPTType::T_I64    : *((int64_t*) d) = s->val.i64; d++;    break;
    61         case nsXPTType::T_U64    : *((uint64_t*)d) = s->val.u64; d++;    break;
    62         case nsXPTType::T_DOUBLE : *((double*)  d) = s->val.d;   d++;    break;
    63         }
    64     }
    65 }
    67 }

mercurial