xpcom/glue/nsClassInfoImpl.cpp

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #include "nsIClassInfoImpl.h"
     6 #include "nsIProgrammingLanguage.h"
     8 NS_IMETHODIMP_(MozExternalRefCountType)
     9 GenericClassInfo::AddRef()
    10 {
    11   return 2;
    12 }
    14 NS_IMETHODIMP_(MozExternalRefCountType)
    15 GenericClassInfo::Release()
    16 {
    17   return 1;
    18 }
    20 NS_IMPL_QUERY_INTERFACE(GenericClassInfo, nsIClassInfo)
    22 NS_IMETHODIMP
    23 GenericClassInfo::GetInterfaces(uint32_t* countp, nsIID*** array)
    24 {
    25   return mData->getinterfaces(countp, array);
    26 }
    28 NS_IMETHODIMP
    29 GenericClassInfo::GetHelperForLanguage(uint32_t language, nsISupports** helper)
    30 {
    31   if (mData->getlanguagehelper)
    32     return mData->getlanguagehelper(language, helper);
    33   return NS_ERROR_NOT_IMPLEMENTED;
    34 }
    36 NS_IMETHODIMP
    37 GenericClassInfo::GetContractID(char** contractid)
    38 {
    39   NS_ERROR("GetContractID not implemented");
    40   *contractid = nullptr;
    41   return NS_ERROR_NOT_IMPLEMENTED;
    42 }
    44 NS_IMETHODIMP
    45 GenericClassInfo::GetClassDescription(char** description)
    46 {
    47   *description = nullptr;
    48   return NS_ERROR_NOT_IMPLEMENTED;
    49 }
    51 NS_IMETHODIMP
    52 GenericClassInfo::GetClassID(nsCID** classid)
    53 {
    54   NS_ERROR("GetClassID not implemented");
    55   *classid = nullptr;
    56   return NS_ERROR_NOT_IMPLEMENTED;
    57 }
    59 NS_IMETHODIMP
    60 GenericClassInfo::GetImplementationLanguage(uint32_t* language)
    61 {
    62   *language = nsIProgrammingLanguage::CPLUSPLUS;
    63   return NS_OK;
    64 }
    66 NS_IMETHODIMP
    67 GenericClassInfo::GetFlags(uint32_t* flags)
    68 {
    69   *flags = mData->flags;
    70   return NS_OK;
    71 }
    73 NS_IMETHODIMP
    74 GenericClassInfo::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc)
    75 {
    76   *aClassIDNoAlloc = mData->cid;
    77   return NS_OK;
    78 }

mercurial