content/html/document/src/HTMLAllCollection.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: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
     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 #ifndef mozilla_dom_HTMLAllCollection_h
     8 #define mozilla_dom_HTMLAllCollection_h
    10 #include "js/RootingAPI.h"
    11 #include "nsAutoPtr.h"
    12 #include "nsCycleCollectionParticipant.h"
    13 #include "nsISupportsImpl.h"
    14 #include "nsRefPtrHashtable.h"
    16 #include <stdint.h>
    18 class nsContentList;
    19 class nsHTMLDocument;
    20 class nsIContent;
    21 class nsWrapperCache;
    23 namespace mozilla {
    24 class ErrorResult;
    26 namespace dom {
    28 class HTMLAllCollection
    29 {
    30 public:
    31   HTMLAllCollection(nsHTMLDocument* aDocument);
    32   ~HTMLAllCollection();
    34   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(HTMLAllCollection)
    35   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLAllCollection)
    37   uint32_t Length();
    38   nsIContent* Item(uint32_t aIndex);
    40   JSObject* GetObject(JSContext* aCx, ErrorResult& aRv);
    42   nsISupports* GetNamedItem(const nsAString& aID, nsWrapperCache** aCache);
    44 private:
    45   nsContentList* Collection();
    47   /**
    48    * Returns the NodeList for document.all[aID], or null if there isn't one.
    49    */
    50   nsContentList* GetDocumentAllList(const nsAString& aID);
    52   JS::Heap<JSObject*> mObject;
    53   nsRefPtr<nsHTMLDocument> mDocument;
    54   nsRefPtr<nsContentList> mCollection;
    55   nsRefPtrHashtable<nsStringHashKey, nsContentList> mNamedMap;
    56 };
    58 } // namespace dom
    59 } // namespace mozilla
    61 #endif // mozilla_dom_HTMLAllCollection_h

mercurial