Files
palemoon27/chrome/nsChromeRegistry.h
roytam1 c0011dadb2 import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1160013 CachePushStreamChild should hold the parent DOM object alive. r=baku (07626c5e44)
- Bug 1179772 Make Cache API honor devtools SW testing flag in SW itself. r=ehsan (4d915be43c)
- Bug 1181577 Delay creation of QuotaInitRunnable until Cache Context actually started. r=ehsan (9991aafa07)
- Bug 1210128 Ensure Cache API context internal state is consistent when shutdown during initialization. r=janv (25fbcf3136)
- Bug 1138916 Fix Cache::MatchAll() assertion in WorkerFeature handling. r=baku (73fe25803b)
- Bug 1186312 - Cache API should not accept system principals for child processes. r=bkelly (c140f627f8)
- align (acb75b3a8d)
- Bug 1215290 Cache API should store unfiltered Response URL. r=ehsan (55238dd04a)
- Bug 1217501 P4 Fill headers before setting guard when reading response from Cache. r=ehsan (787cb31d84)
- bits of  Bug 1202902 (82e2e451cc)
- Bug 1147329 - Handle in-process case for Cut/Copy/Paste feature. r=kanru (66cabbf705)
- Bug 1199161 - Add selectedTextContent to CaretStateChangedEvent. r=kanru, sr=smaug (5eb99e303b)
- Bug 1217515 - Clean up the way touch event support is configured. r=roc (24a7db4a42)
- Bug 1216937 - Assign default URL for mozbrowseropenwindow event. r=smaug (fc7aaa533b)
- Bug 1101115, implement nsChromeRegistryContent::IsLocaleRTL so that file directory view works in e10s rtl mode, r=bsmedberg (c0eb12391f)
- Bug 1186787 (part 1) - Replace nsBaseHashtable::EnumerateRead() calls in chrome/ with iterators. r=froydnj. (2508253415)
- Bug 1186787 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in chrome/ with iterators. r=froydnj. (193c37c478)
- Bug 1170207 - allow overrides of chrome://../skin/ URIs with other chrome://../skin/ URIs within skin manifests, r=bsmedberg (3c24e2006c)
- Bug 1210463 - part 3 - Remove the very obsolete NS_IMPL_MOZILLA192_NSGETMODULE. r=froydnj (c7300c145b)
- Bug 1210463 - part 1 - Remove some unneeded null checks on new in ModuleUtils. r=froydnj (73affb8e34)
- Bug 1210463 - part 2 - Use some smart pointers in ModuleUtils.h. r=froydnj (f5eeb12cb3)
- Bug 1210463 - part 2 - Use some smart pointers in ModuleUtils.h. r=froydnj (788f944a41)
- Bug 1215143 - FF Android VR returns orientation that is 90deg off on x-axis. r=vlad (fc0d86c800)
- Bug 1166667 - Remove LangGroupFromUnicodeRange due to unused. r=jfkthame (e3bb039e41)
- Bug 1119062 - enable unicode-range in release builds. r=dbaron (8d48c7ab14)
- bits of 1117227 in headers (ad920e2094)
- Bug 1220020. Recompute the current animated geometry root when a child scroll frame forces us to be layerized, and therefore turns us into an animated geometry root. r=mstange (4cfb015eb7)
- Bug 1220114. Part 1. Change ScrollFrameHelper::DecideScrollableLayer to recompute the current animated geometry root any time mWillBuildScrollableLayer changes in addition to when usingDisplayPort changes. r=mstange (9e8512babe)
- Bug 1220114. Part 2. If a scroll frame is forced to layerize because of an active descendant scroll frame then set a displayport on the ancestor scroll frame so that next paint we don't have to force layerization after the fact and we can do a fully proper paint. r=mstange (a3d7734f75)
- Bug 1228357 - When saving/restoring a scrollframe's state, only save/restore resolution for the root scrollframe. r=roc (7018d5bcae)
- Bug 1224307 - Fix page scrolling for non-full-width fixed headers/footers [r=tn]  Please enter the commit message for your changes. Lines starting (55eebe3d49)
- Bug 1081272 - Include position and transform when computing header/footer size [r=tn] (c91104a099)
- Bug 1145546: take auto-direction into account in GetScrolledRect, r=jfkthame (a5bf400639)
- spaces (4a2918cb4c)
- Bug 1225376 part 1 - [css-align] Don't compute left/right to start in the style system anymore (due to pending spec change). Map the used value instead (in layout). r=dholbert (677b9eba16)
- Bug 1225376 part 2 - [css-align] Add mochitests for align/justify-items/self/content computed values. (580ef62eb6)
- Bug 1225376 part 3 - [css-grid] Crashtest. (3e5b06dce4)
- Bug 1148515 - Do the scrollbar thumb layer wrapping in nsSliderFrameso that the thumb's event region is wrapped, too. r=tn (0ff596193e)
- Bug 1133732. Header include got missed in rebase. on CLOSED TREE (b870504066)
- Bug 1133732. Make button box frames listen for blurs so they de-activate on blur. r=smaug (5c6274f99d)
- Bug 1170052 part 1: Refactor nsImageBoxFrame::PaintImage() so its final failure case is an early return. r=seth (7308f3f32e)
- Bug 1170052 part 2: Support object-fit & object-position on XUL <image src=""> elements. r=seth (74ab4c8813)
- Bug 1170052 part 3: Add scripts to generate reftests for object-fit/object-position applied to XUL <image>. (NPOTB) (5b1e1b6b90)
- Bug 1170052 part 4: Add reftests for object-fit/object-position on XUL <image> element (as modified copies of existing <img> tests). (test-only) (7f678646e8)
- Bug 1170052 part 5: Mark new reftests as "skip-if(Mulet)" to avoid impacting reftest chunking on that platform in a way that makes SVG reftests fail mysteriously. (d6c7e5ff05)
- Bug 1170052 part 6: Skip new XUL reftests on B2G Emulator as well, since XUL reftests trigger error pages on that platform. (3f4ddeddcd)
- Bug 1194493 - Ensure the 'mVertical' flag is set appropriately on the nsFontMetrics we use to draw text for an nsTextBoxFrame. r=smontagu (a6eed3f9b8)
- Bug 1155359 - Set NS_FRAME_IS_BIDI on nsTextBoxFrame if text direction is set to RTL r=roc (2715d47271)
- crash reporter (015ee49944)
2023-03-20 16:03:44 +08:00

171 lines
5.7 KiB
C++

/* -*- 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
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsChromeRegistry_h
#define nsChromeRegistry_h
#include "nsIToolkitChromeRegistry.h"
#include "nsIObserver.h"
#include "nsWeakReference.h"
#ifdef MOZ_XUL
#include "nsIXULOverlayProvider.h"
#endif
#include "nsString.h"
#include "nsURIHashKey.h"
#include "nsInterfaceHashtable.h"
#include "nsXULAppAPI.h"
#include "nsIXPConnect.h"
#include "mozilla/FileLocation.h"
class nsIDOMWindow;
class nsIPrefBranch;
class nsIURL;
// The chrome registry is actually split between nsChromeRegistryChrome and
// nsChromeRegistryContent. The work/data that is common to both resides in
// the shared nsChromeRegistry implementation, with operations that only make
// sense for one side erroring out in the other.
// for component registration
// {47049e42-1d87-482a-984d-56ae185e367a}
#define NS_CHROMEREGISTRY_CID \
{ 0x47049e42, 0x1d87, 0x482a, { 0x98, 0x4d, 0x56, 0xae, 0x18, 0x5e, 0x36, 0x7a } }
class nsChromeRegistry : public nsIToolkitChromeRegistry,
#ifdef MOZ_XUL
public nsIXULOverlayProvider,
#endif
public nsIObserver,
public nsSupportsWeakReference
{
public:
NS_DECL_ISUPPORTS
// nsIXULChromeRegistry methods:
NS_IMETHOD ReloadChrome() override;
NS_IMETHOD RefreshSkins() override;
NS_IMETHOD AllowScriptsForPackage(nsIURI* url,
bool* _retval) override;
NS_IMETHOD AllowContentToAccess(nsIURI* url,
bool* _retval) override;
NS_IMETHOD CanLoadURLRemotely(nsIURI* url,
bool* _retval) override;
NS_IMETHOD MustLoadURLRemotely(nsIURI* url,
bool* _retval) override;
// nsIChromeRegistry methods:
NS_IMETHOD_(bool) WrappersEnabled(nsIURI *aURI) override;
NS_IMETHOD ConvertChromeURL(nsIURI* aChromeURI, nsIURI* *aResult) override;
// nsChromeRegistry methods:
nsChromeRegistry() : mInitialized(false) { }
virtual nsresult Init();
static already_AddRefed<nsIChromeRegistry> GetService();
static nsChromeRegistry* gChromeRegistry;
static nsresult Canonify(nsIURL* aChromeURL);
protected:
virtual ~nsChromeRegistry();
void FlushSkinCaches();
void FlushAllCaches();
// Update the selected locale used by the chrome registry, and fire a
// notification about this change
virtual nsresult UpdateSelectedLocale() = 0;
static void LogMessage(const char* aMsg, ...);
static void LogMessageWithContext(nsIURI* aURL, uint32_t aLineNumber, uint32_t flags,
const char* aMsg, ...);
virtual nsIURI* GetBaseURIFromPackage(const nsCString& aPackage,
const nsCString& aProvider,
const nsCString& aPath) = 0;
virtual nsresult GetFlagsFromPackage(const nsCString& aPackage,
uint32_t* aFlags) = 0;
nsresult SelectLocaleFromPref(nsIPrefBranch* prefs);
static nsresult RefreshWindow(nsIDOMWindow* aWindow);
static nsresult GetProviderAndPath(nsIURL* aChromeURL,
nsACString& aProvider, nsACString& aPath);
bool GetDirectionForLocale(const nsACString& aLocale);
public:
static already_AddRefed<nsChromeRegistry> GetSingleton();
struct ManifestProcessingContext
{
ManifestProcessingContext(NSLocationType aType, mozilla::FileLocation &aFile)
: mType(aType)
, mFile(aFile)
{ }
~ManifestProcessingContext()
{ }
nsIURI* GetManifestURI();
nsIXPConnect* GetXPConnect();
already_AddRefed<nsIURI> ResolveURI(const char* uri);
NSLocationType mType;
mozilla::FileLocation mFile;
nsCOMPtr<nsIURI> mManifestURI;
nsCOMPtr<nsIXPConnect> mXPConnect;
};
virtual void ManifestContent(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
virtual void ManifestLocale(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
virtual void ManifestSkin(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
virtual void ManifestOverlay(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
virtual void ManifestStyle(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
virtual void ManifestOverride(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
virtual void ManifestResource(ManifestProcessingContext& cx, int lineno,
char *const * argv, int flags) = 0;
// Available flags
enum {
// This is a "platform" package (e.g. chrome://global-platform/).
// Appends one of win/ unix/ mac/ to the base URI.
PLATFORM_PACKAGE = 1 << 0,
// This package should use the new XPCNativeWrappers to separate
// content from chrome. This flag is currently unused (because we call
// into xpconnect at registration time).
XPCNATIVEWRAPPERS = 1 << 1,
// Content script may access files in this package
CONTENT_ACCESSIBLE = 1 << 2,
// Package may be loaded remotely
REMOTE_ALLOWED = 1 << 3,
// Package must be loaded remotely
REMOTE_REQUIRED = 1 << 4,
};
bool mInitialized;
// "Override" table (chrome URI string -> real URI)
nsInterfaceHashtable<nsURIHashKey, nsIURI> mOverrideTable;
};
#endif // nsChromeRegistry_h