modules/libpref/src/prefapi_private_data.h

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: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 /* Data shared between prefapi.c and nsPref.cpp */
     8 #ifndef prefapi_private_data_h
     9 #define prefapi_private_data_h
    11 #include "mozilla/MemoryReporting.h"
    13 extern PLDHashTable			gHashTable;
    14 extern bool                 gDirty;
    16 namespace mozilla {
    17 namespace dom {
    18 class PrefSetting;
    19 }
    20 }
    22 enum pref_SaveTypes { SAVE_NONSHARED, SAVE_SHARED, SAVE_ALL, SAVE_ALL_AND_DEFAULTS };
    24 // Passed as the arg to pref_savePref
    25 struct pref_saveArgs {
    26   char **prefArray;
    27   pref_SaveTypes saveTypes;
    28 };
    30 PLDHashOperator
    31 pref_savePref(PLDHashTable *table, PLDHashEntryHdr *heh, uint32_t i, void *arg);
    33 PLDHashOperator
    34 pref_GetPrefs(PLDHashTable *table,
    35               PLDHashEntryHdr *heh, uint32_t i, void *arg);
    37 nsresult
    38 pref_SetPref(const mozilla::dom::PrefSetting& aPref);
    40 int pref_CompareStrings(const void *v1, const void *v2, void* unused);
    41 PrefHashEntry* pref_HashTableLookup(const void *key);
    43 void pref_GetPrefFromEntry(PrefHashEntry *aHashEntry,
    44                            mozilla::dom::PrefSetting* aPref);
    46 size_t
    47 pref_SizeOfPrivateData(mozilla::MallocSizeOf aMallocSizeOf);
    49 #endif

mercurial