author Jan de Mooij <>
Thu, 29 Nov 2018 19:08:28 +0000
changeset 448835 6453222232be364fb8ce3fd29b6cbcd480e5f2e3
parent 425432 5f50dd0905ec23b0d1fa1747905d5a1ef5f73dc2
child 448947 6f3709b3878117466168c40affa7bca0b60cf75b
permissions -rw-r--r--
Bug 1499644 - Move IC data out of BaselineScript. r=tcampbell ICEntries and the fallback stub space are now stored in ICScript. The ICScript* is stored in TypeScript to not increase sizeof(JSScript). We need this for bug 1499324 but it also lets us greatly simplify the BaselineDebugModeOSR code as this patch shows. Note: some ICScript method definitions are still in BaselineJIT.cpp instead of BaselineIC.cpp to make this patch easier to review. We could move them to BaselineIC.cpp as a follow-up change. Differential Revision:

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at */

#ifndef nsChromeRegistryContent_h
#define nsChromeRegistryContent_h

#include "nsChromeRegistry.h"
#include "nsClassHashtable.h"

struct ChromePackage;
struct SubstitutionMapping;
struct OverrideMapping;

class nsChromeRegistryContent : public nsChromeRegistry

  void RegisterRemoteChrome(const InfallibleTArray<ChromePackage>& aPackages,
                            const InfallibleTArray<SubstitutionMapping>& aResources,
                            const InfallibleTArray<OverrideMapping>& aOverrides,
                            const nsACString& aLocale,
                            bool aReset);

  NS_IMETHOD GetLocalesForPackage(const nsACString& aPackage,
                                  nsIUTF8StringEnumerator* *aResult) override;
  NS_IMETHOD CheckForNewChrome() override;
  NS_IMETHOD CheckForOSAccessibility() override;
  NS_IMETHOD Observe(nsISupports* aSubject, const char* aTopic,
                     const char16_t* aData) override;
  NS_IMETHOD IsLocaleRTL(const nsACString& package,
                         bool *aResult) override;
  NS_IMETHOD GetSelectedLocale(const nsACString& aPackage,
                               bool aAsBCP47,
                               nsACString& aLocale) override;

  void RegisterPackage(const ChromePackage& aPackage);
  void RegisterOverride(const OverrideMapping& aOverride);
  void RegisterSubstitution(const SubstitutionMapping& aResource);

  struct PackageEntry
    PackageEntry() : flags(0) { }
    ~PackageEntry() { }

    nsCOMPtr<nsIURI> contentBaseURI;
    nsCOMPtr<nsIURI> localeBaseURI;
    nsCOMPtr<nsIURI> skinBaseURI;
    uint32_t         flags;

  nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
                     const nsCString& aProvider,
                     const nsCString& aPath) override;
  nsresult GetFlagsFromPackage(const nsCString& aPackage, uint32_t* aFlags) override;

  nsClassHashtable<nsCStringHashKey, PackageEntry> mPackagesHash;
  nsCString mLocale;

  virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
                               char *const * argv, int flags) override;
  virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
                              char *const * argv, int flags) override;
  virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
                            char *const * argv, int flags) override;
  virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
                                char *const * argv, int flags) override;
  virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
                                char *const * argv, int flags) override;

#endif // nsChromeRegistryContent_h