layout/style/nsDOMCSSRGBColor.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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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 /* DOM object representing color values in DOM computed style */
     7 #include "nsDOMCSSRGBColor.h"
     9 #include "mozilla/dom/RGBColorBinding.h"
    10 #include "nsROCSSPrimitiveValue.h"
    12 using namespace mozilla;
    14 nsDOMCSSRGBColor::nsDOMCSSRGBColor(nsROCSSPrimitiveValue* aRed,
    15                                    nsROCSSPrimitiveValue* aGreen,
    16                                    nsROCSSPrimitiveValue* aBlue,
    17                                    nsROCSSPrimitiveValue* aAlpha,
    18                                    bool aHasAlpha)
    19   : mRed(aRed), mGreen(aGreen), mBlue(aBlue), mAlpha(aAlpha)
    20   , mHasAlpha(aHasAlpha)
    21 {
    22   SetIsDOMBinding();
    23 }
    25 nsDOMCSSRGBColor::~nsDOMCSSRGBColor(void)
    26 {
    27 }
    29 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_4(nsDOMCSSRGBColor, mAlpha,  mBlue, mGreen, mRed)
    31 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsDOMCSSRGBColor, AddRef)
    32 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsDOMCSSRGBColor, Release)
    34 JSObject*
    35 nsDOMCSSRGBColor::WrapObject(JSContext *aCx)
    36 {
    37   return dom::RGBColorBinding::Wrap(aCx, this);
    38 }

mercurial