Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2016-09-27 11:27:05 +02:00
Родитель 851cb1d05f 5bdd2876ae
Коммит 954137ed73
381 изменённых файлов: 7281 добавлений и 7745 удалений

Просмотреть файл

@ -265,7 +265,8 @@ mai_util_add_key_event_listener(AtkKeySnoopFunc listener, gpointer data)
}
AtkKeySnoopFuncPointer atkKeySnoop;
atkKeySnoop.func_ptr = listener;
g_hash_table_insert(sKey_listener_list, GUINT_TO_POINTER(key++),
key++;
g_hash_table_insert(sKey_listener_list, GUINT_TO_POINTER(key),
atkKeySnoop.data);
return key;
}

Просмотреть файл

@ -141,7 +141,6 @@ AboutRedirector::NewChannel(nsIURI* aURI,
for (int i = 0; i < kRedirTotal; i++) {
if (!strcmp(path.get(), kRedirMap[i].id)) {
nsAutoCString url;
nsLoadFlags loadFlags = static_cast<nsLoadFlags>(nsIChannel::LOAD_NORMAL);
if (path.EqualsLiteral("newtab")) {
// let the aboutNewTabService decide where to redirect
@ -159,7 +158,6 @@ AboutRedirector::NewChannel(nsIURI* aURI,
if (remoteEnabled) {
NS_ENSURE_ARG_POINTER(aLoadInfo);
aLoadInfo->SetVerifySignedContent(true);
loadFlags = static_cast<nsLoadFlags>(nsIChannel::LOAD_REPLACE);
}
}
// fall back to the specified url in the map
@ -181,7 +179,7 @@ AboutRedirector::NewChannel(nsIURI* aURI,
&isUIResource);
NS_ENSURE_SUCCESS(rv, rv);
loadFlags = isUIResource
nsLoadFlags loadFlags = isUIResource
? static_cast<nsLoadFlags>(nsIChannel::LOAD_NORMAL)
: static_cast<nsLoadFlags>(nsIChannel::LOAD_REPLACE);

Просмотреть файл

@ -29,14 +29,14 @@
#include "nsIScriptError.h"
#include "nsIWindowMediator.h"
#include "nsIPrefService.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
nsChromeRegistry* nsChromeRegistry::gChromeRegistry;
// DO NOT use namespace mozilla; it'll break due to a naming conflict between
// mozilla::TextRange and a TextRange in OSX headers.
using mozilla::StyleSheetHandle;
using mozilla::StyleSheet;
using mozilla::dom::IsChromeURI;
////////////////////////////////////////////////////////////////////////////////
@ -402,17 +402,17 @@ nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindowOuter* aWindow)
nsCOMPtr<nsIPresShell> shell = document->GetShell();
if (shell) {
// Reload only the chrome URL agent style sheets.
nsTArray<StyleSheetHandle::RefPtr> agentSheets;
nsTArray<RefPtr<StyleSheet>> agentSheets;
rv = shell->GetAgentStyleSheets(agentSheets);
NS_ENSURE_SUCCESS(rv, rv);
nsTArray<StyleSheetHandle::RefPtr> newAgentSheets;
for (StyleSheetHandle sheet : agentSheets) {
nsTArray<RefPtr<StyleSheet>> newAgentSheets;
for (StyleSheet* sheet : agentSheets) {
nsIURI* uri = sheet->GetSheetURI();
if (IsChromeURI(uri)) {
// Reload the sheet.
StyleSheetHandle::RefPtr newSheet;
RefPtr<StyleSheet> newSheet;
rv = document->LoadChromeSheetSync(uri, true, &newSheet);
if (NS_FAILED(rv)) return rv;
if (newSheet) {
@ -433,26 +433,26 @@ nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindowOuter* aWindow)
int32_t count = document->GetNumberOfStyleSheets();
// Build an array of style sheets we need to reload.
nsTArray<StyleSheetHandle::RefPtr> oldSheets(count);
nsTArray<StyleSheetHandle::RefPtr> newSheets(count);
nsTArray<RefPtr<StyleSheet>> oldSheets(count);
nsTArray<RefPtr<StyleSheet>> newSheets(count);
// Iterate over the style sheets.
for (int32_t i = 0; i < count; i++) {
// Get the style sheet
StyleSheetHandle styleSheet = document->GetStyleSheetAt(i);
StyleSheet* styleSheet = document->GetStyleSheetAt(i);
oldSheets.AppendElement(styleSheet);
}
// Iterate over our old sheets and kick off a sync load of the new
// sheet if and only if it's a non-inline sheet with a chrome URL.
for (StyleSheetHandle sheet : oldSheets) {
for (StyleSheet* sheet : oldSheets) {
MOZ_ASSERT(sheet, "GetStyleSheetAt shouldn't return nullptr for "
"in-range sheet indexes");
nsIURI* uri = sheet->GetSheetURI();
if (!sheet->IsInline() && IsChromeURI(uri)) {
// Reload the sheet.
StyleSheetHandle::RefPtr newSheet;
RefPtr<StyleSheet> newSheet;
// XXX what about chrome sheets that have a title or are disabled? This
// only works by sheer dumb luck.
document->LoadChromeSheetSync(uri, false, &newSheet);

2
config/external/nss/nss.symbols поставляемый
Просмотреть файл

@ -673,6 +673,7 @@ SSL_HandshakeCallback
SSL_HandshakeNegotiatedExtension
SSL_ImplementedCiphers @DATA@
SSL_ImportFD
SSL_NamedGroupConfig
SSL_NumImplementedCiphers @DATA@
SSL_OptionSet
SSL_OptionSetDefault
@ -680,6 +681,7 @@ SSL_PeerCertificate
SSL_PeerCertificateChain
SSL_PeerStapledOCSPResponses
SSL_ResetHandshake
SSL_SendAdditionalKeyShares
SSL_SetCanFalseStartCallback
SSL_SetDowngradeCheckVersion
SSL_SetNextProtoNego

12
devtools/bootstrap.js поставляемый
Просмотреть файл

@ -124,6 +124,18 @@ function reload(event) {
// Then spawn a brand new Loader.jsm instance and start the main module
Cu.unload("resource://devtools/shared/Loader.jsm");
// Also unload all resources loaded as jsm, hopefully all of them are going
// to be converted into regular modules
Cu.unload("resource://devtools/client/shared/browser-loader.js");
Cu.unload("resource://devtools/client/framework/ToolboxProcess.jsm");
Cu.unload("resource://devtools/shared/apps/Devices.jsm");
Cu.unload("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
Cu.unload("resource://devtools/shared/Parser.jsm");
Cu.unload("resource://devtools/client/shared/DOMHelpers.jsm");
Cu.unload("resource://devtools/client/shared/widgets/VariablesView.jsm");
Cu.unload("resource://devtools/client/responsivedesign/responsivedesign.jsm");
Cu.unload("resource://devtools/client/shared/widgets/AbstractTreeItem.jsm");
Cu.unload("resource://devtools/shared/deprecated-sync-thenables.js");
const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
devtools.require("devtools/client/framework/devtools-browser");

Просмотреть файл

@ -13,7 +13,7 @@ const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-l
// Module Loader
const require = BrowserLoader({
baseURI: "resource://devtools/client/dom/",
window: this
window
}).require;
XPCOMUtils.defineConstant(this, "require", require);

Просмотреть файл

@ -9,7 +9,7 @@ const BrowserLoaderModule = {};
Cu.import("resource://devtools/client/shared/browser-loader.js", BrowserLoaderModule);
const { require } = BrowserLoaderModule.BrowserLoader({
baseURI: "resource://devtools/client/memory/",
window: this
window
});
const { Task } = require("devtools/shared/task");
const { createFactory, createElement } = require("devtools/client/shared/vendor/react");

Просмотреть файл

@ -7,7 +7,7 @@ var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-loader.js", {});
var { require } = BrowserLoader({
baseURI: "resource://devtools/client/memory/",
window: this
window
});
var { Assert } = require("resource://testing-common/Assert.jsm");
var Services = require("Services");

Просмотреть файл

@ -3,7 +3,7 @@
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* global document, SimpleTest, requestAnimationFrame, is, ok */
/* global window, document, SimpleTest, requestAnimationFrame, is, ok */
/* exported Cc, Ci, Cu, Cr, Assert, Task, TargetFactory, Toolbox, browserRequire,
forceRender, setProps, dumpn, checkOptimizationHeader, checkOptimizationTree */
let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
@ -20,7 +20,7 @@ let { Toolbox } = require("devtools/client/framework/toolbox");
flags.testing = true;
let { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/performance/",
window: this
window
});
let $ = (selector, scope = document) => scope.querySelector(selector);

Просмотреть файл

@ -3,7 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/* globals document, PerformanceView, ToolbarView, RecordingsView, DetailsView */
/* globals window, document, PerformanceView, ToolbarView, RecordingsView, DetailsView */
/* exported Cc, Ci, Cu, Cr, loader */
var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
@ -11,7 +11,7 @@ var BrowserLoaderModule = {};
Cu.import("resource://devtools/client/shared/browser-loader.js", BrowserLoaderModule);
var { loader, require } = BrowserLoaderModule.BrowserLoader({
baseURI: "resource://devtools/client/performance/",
window: this
window
});
var { Task } = require("devtools/shared/task");
/* exported Heritage, ViewHelpers, WidgetMethods, setNamedTimeout, clearNamedTimeout */

Просмотреть файл

@ -11,7 +11,7 @@ const { BrowserLoader } =
Cu.import("resource://devtools/client/shared/browser-loader.js", {});
const { require } = BrowserLoader({
baseURI: "resource://devtools/client/responsive.html/",
window: this
window
});
const { Task } = require("devtools/shared/task");
const Telemetry = require("devtools/client/shared/telemetry");

Просмотреть файл

@ -24,7 +24,7 @@ var { Toolbox } = require("devtools/client/framework/toolbox");
flags.testing = true;
var { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/shared/",
window: this
window
});
let ReactDOM = browserRequire("devtools/client/shared/vendor/react-dom");

Просмотреть файл

@ -9,7 +9,7 @@ const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-l
const { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/shared/",
window: this
window
});
const variableFileContents = browserRequire("raw!devtools/client/themes/variables.css");

Просмотреть файл

@ -13,7 +13,7 @@ var { utils: Cu } = Components;
const rootUrl = "resource://devtools/client/webconsole/net/";
const require = BrowserLoader({
baseURI: rootUrl,
window: this}).require;
window}).require;
const NetRequest = require("./net-request");
const { loadSheet } = require("sdk/stylesheet/utils");

Просмотреть файл

@ -16,7 +16,7 @@ const { BrowserLoader } = Cu.import("resource://devtools/client/shared/browser-l
// privileges and runs entirely in content scope.
const NewConsoleOutputWrapper = BrowserLoader({
baseURI: "resource://devtools/client/webconsole/new-console-output/",
window: this}).require("./new-console-output-wrapper");
window}).require("./new-console-output-wrapper");
this.NewConsoleOutput = function (parentNode, jsterm, toolbox, owner) {
console.log("Creating NewConsoleOutput", parentNode, NewConsoleOutputWrapper);

Просмотреть файл

@ -12,5 +12,5 @@ var { Task } = require("devtools/shared/task");
var { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/webconsole/",
window: this
window
});

Просмотреть файл

@ -138,18 +138,20 @@ function onExecuteFoo23InFirstCall() {
onExecuteFooAndFoo3ChangesInFirstCall));
}
function onExecuteFooAndFoo3ChangesInFirstCall() {
var onExecuteFooAndFoo3ChangesInFirstCall = Task.async(function*() {
let expected = "abbabug783499";
isnot(gWebConsole.outputNode.textContent.indexOf(expected), -1,
"|foo + foo3| updated in |firstCall()|");
is(content.wrappedJSObject.foo, "globalFooBug783499",
"|foo| in content window");
is(content.wrappedJSObject.foo2, "newFoo", "|foo2| in content window");
ok(!content.wrappedJSObject.foo3,
"|foo3| was not added to the content window");
yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
is(content.wrappedJSObject.foo, "globalFooBug783499",
"|foo| in content window");
is(content.wrappedJSObject.foo2, "newFoo", "|foo2| in content window");
ok(!content.wrappedJSObject.foo3,
"|foo3| was not added to the content window");
});
gWebConsole = gJSTerm = gDebuggerWin = gThread = gDebuggerController =
gStackframes = null;
executeSoon(finishTest);
}
});

Просмотреть файл

@ -4,8 +4,12 @@
"use strict";
const { installHelperSheet,
addPseudoClassLock, removePseudoClassLock } = require("./utils/markup");
const {
installHelperSheet,
isNodeValid,
addPseudoClassLock,
removePseudoClassLock
} = require("./utils/markup");
// SimpleOutlineHighlighter's stylesheet
const HIGHLIGHTED_PSEUDO_CLASS = ":-moz-devtools-highlighted";
@ -41,7 +45,7 @@ SimpleOutlineHighlighter.prototype = {
* @param {DOMNode} node
*/
show: function (node) {
if (!this.currentNode || node !== this.currentNode) {
if (isNodeValid(node) && (!this.currentNode || node !== this.currentNode)) {
this.hide();
this.currentNode = node;
installHelperSheet(node.ownerDocument.defaultView, SIMPLE_OUTLINE_SHEET);

Просмотреть файл

@ -17,8 +17,8 @@
#include "mozilla/dom/HTMLContentElement.h"
#include "mozilla/dom/HTMLShadowElement.h"
#include "nsXBLPrototypeBinding.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -132,7 +132,7 @@ ShadowRoot::StyleSheetChanged()
}
void
ShadowRoot::InsertSheet(StyleSheetHandle aSheet,
ShadowRoot::InsertSheet(StyleSheet* aSheet,
nsIContent* aLinkingContent)
{
nsCOMPtr<nsIStyleSheetLinkingElement>
@ -163,7 +163,7 @@ ShadowRoot::InsertSheet(StyleSheetHandle aSheet,
}
void
ShadowRoot::RemoveSheet(StyleSheetHandle aSheet)
ShadowRoot::RemoveSheet(StyleSheet* aSheet)
{
mProtoBinding->RemoveStyleSheet(aSheet);
@ -756,7 +756,7 @@ ShadowRootStyleSheetList::IndexedGetter(uint32_t aIndex, bool& aFound)
// XXXheycam Return null until ServoStyleSheet implements the right
// DOM interfaces.
StyleSheetHandle sheet = mShadowRoot->mProtoBinding->StyleSheetAt(aIndex);
StyleSheet* sheet = mShadowRoot->mProtoBinding->StyleSheetAt(aIndex);
if (sheet->IsServo()) {
NS_ERROR("stylo: can't return ServoStyleSheets to script yet");
return nullptr;

Просмотреть файл

@ -9,7 +9,7 @@
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/dom/StyleSheetList.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsIContentInlines.h"
@ -47,8 +47,8 @@ public:
void AddToIdTable(Element* aElement, nsIAtom* aId);
void RemoveFromIdTable(Element* aElement, nsIAtom* aId);
void InsertSheet(StyleSheetHandle aSheet, nsIContent* aLinkingContent);
void RemoveSheet(StyleSheetHandle aSheet);
void InsertSheet(StyleSheet* aSheet, nsIContent* aLinkingContent);
void RemoveSheet(StyleSheet* aSheet);
bool ApplyAuthorStyles();
void SetApplyAuthorStyles(bool aApplyAuthorStyles);
StyleSheetList* StyleSheets();

Просмотреть файл

@ -207,7 +207,7 @@ nsContentSink::Init(nsIDocument* aDoc,
}
NS_IMETHODIMP
nsContentSink::StyleSheetLoaded(StyleSheetHandle aSheet,
nsContentSink::StyleSheetLoaded(StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus)
{

Просмотреть файл

@ -85,7 +85,7 @@ class nsContentSink : public nsICSSLoaderObserver,
NS_DECL_NSITIMERCALLBACK
// nsICSSLoaderObserver
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheetHandle aSheet,
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus) override;

Просмотреть файл

@ -109,7 +109,7 @@
#include "mozilla/css/ImageLoader.h"
#include "mozilla/layers/APZCTreeManager.h" // for layers::ZoomToRectBehavior
#include "mozilla/dom/Promise.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#ifdef XP_WIN
#undef GetClassName

Просмотреть файл

@ -250,8 +250,8 @@
#include "nsISupportsPrimitives.h"
#include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/DocLoadingTimelineMarker.h"
@ -600,7 +600,7 @@ nsDOMStyleSheetList::IndexedGetter(uint32_t aIndex, bool& aFound)
}
aFound = true;
StyleSheetHandle sheet = mDocument->GetStyleSheetAt(aIndex);
StyleSheet* sheet = mDocument->GetStyleSheetAt(aIndex);
NS_ASSERTION(sheet, "Must have a sheet");
// XXXheycam Return null until ServoStyleSheet implements the right DOM
@ -619,7 +619,7 @@ nsDOMStyleSheetList::NodeWillBeDestroyed(const nsINode *aNode)
}
void
nsDOMStyleSheetList::StyleSheetAdded(StyleSheetHandle aStyleSheet,
nsDOMStyleSheetList::StyleSheetAdded(StyleSheet* aStyleSheet,
bool aDocumentSheet)
{
if (aDocumentSheet && -1 != mLength) {
@ -628,7 +628,7 @@ nsDOMStyleSheetList::StyleSheetAdded(StyleSheetHandle aStyleSheet,
}
void
nsDOMStyleSheetList::StyleSheetRemoved(StyleSheetHandle aStyleSheet,
nsDOMStyleSheetList::StyleSheetRemoved(StyleSheet* aStyleSheet,
bool aDocumentSheet)
{
if (aDocumentSheet && -1 != mLength) {
@ -1196,7 +1196,7 @@ nsDOMStyleSheetSetList::EnsureFresh()
int32_t count = mDocument->GetNumberOfStyleSheets();
nsAutoString title;
for (int32_t index = 0; index < count; index++) {
StyleSheetHandle sheet = mDocument->GetStyleSheetAt(index);
StyleSheet* sheet = mDocument->GetStyleSheetAt(index);
NS_ASSERTION(sheet, "Null sheet in sheet list!");
// XXXheycam ServoStyleSheets don't expose their title yet.
if (sheet->IsServo()) {
@ -1497,7 +1497,7 @@ nsDocument::~nsDocument()
mCachedRootElement = nullptr;
// Let the stylesheets know we're going away
for (StyleSheetHandle sheet : mStyleSheets) {
for (StyleSheet* sheet : mStyleSheets) {
sheet->SetOwningDocument(nullptr);
}
if (mAttrStyleSheet) {
@ -2153,7 +2153,7 @@ void
nsDocument::RemoveDocStyleSheetsFromStyleSets()
{
// The stylesheets should forget us
for (StyleSheetHandle sheet : Reversed(mStyleSheets)) {
for (StyleSheet* sheet : Reversed(mStyleSheets)) {
sheet->SetOwningDocument(nullptr);
if (sheet->IsApplicable()) {
@ -2168,11 +2168,11 @@ nsDocument::RemoveDocStyleSheetsFromStyleSets()
void
nsDocument::RemoveStyleSheetsFromStyleSets(
const nsTArray<StyleSheetHandle::RefPtr>& aSheets,
const nsTArray<RefPtr<StyleSheet>>& aSheets,
SheetType aType)
{
// The stylesheets should forget us
for (StyleSheetHandle sheet : Reversed(aSheets)) {
for (StyleSheet* sheet : Reversed(aSheets)) {
sheet->SetOwningDocument(nullptr);
if (sheet->IsApplicable()) {
@ -2250,10 +2250,10 @@ nsDocument::ResetStylesheetsToURI(nsIURI* aURI)
static void
AppendSheetsToStyleSet(StyleSetHandle aStyleSet,
const nsTArray<StyleSheetHandle::RefPtr>& aSheets,
const nsTArray<RefPtr<StyleSheet>>& aSheets,
SheetType aType)
{
for (StyleSheetHandle sheet : Reversed(aSheets)) {
for (StyleSheet* sheet : Reversed(aSheets)) {
aStyleSet->AppendStyleSheet(aType, sheet);
}
}
@ -2268,7 +2268,7 @@ nsDocument::FillStyleSet(StyleSetHandle aStyleSet)
MOZ_ASSERT(!mStyleSetFilled);
for (StyleSheetHandle sheet : Reversed(mStyleSheets)) {
for (StyleSheet* sheet : Reversed(mStyleSheets)) {
if (sheet->IsApplicable()) {
aStyleSet->AddDocStyleSheet(sheet, this);
}
@ -2277,13 +2277,13 @@ nsDocument::FillStyleSet(StyleSetHandle aStyleSet)
if (aStyleSet->IsGecko()) {
nsStyleSheetService *sheetService = nsStyleSheetService::GetInstance();
if (sheetService) {
for (StyleSheetHandle sheet : *sheetService->AuthorStyleSheets()) {
for (StyleSheet* sheet : *sheetService->AuthorStyleSheets()) {
aStyleSet->AppendStyleSheet(SheetType::Doc, sheet);
}
}
// Iterate backwards to maintain order
for (StyleSheetHandle sheet : Reversed(mOnDemandBuiltInUASheets)) {
for (StyleSheet* sheet : Reversed(mOnDemandBuiltInUASheets)) {
if (sheet->IsApplicable()) {
aStyleSet->PrependStyleSheet(SheetType::Agent, sheet);
}
@ -3939,7 +3939,7 @@ nsDocument::RemoveChildAt(uint32_t aIndex, bool aNotify)
}
void
nsDocument::EnsureOnDemandBuiltInUASheet(StyleSheetHandle aSheet)
nsDocument::EnsureOnDemandBuiltInUASheet(StyleSheet* aSheet)
{
if (mOnDemandBuiltInUASheets.Contains(aSheet)) {
return;
@ -3950,7 +3950,7 @@ nsDocument::EnsureOnDemandBuiltInUASheet(StyleSheetHandle aSheet)
}
void
nsDocument::AddOnDemandBuiltInUASheet(StyleSheetHandle aSheet)
nsDocument::AddOnDemandBuiltInUASheet(StyleSheet* aSheet)
{
MOZ_ASSERT(!mOnDemandBuiltInUASheets.Contains(aSheet));
@ -3979,20 +3979,20 @@ nsDocument::GetNumberOfStyleSheets() const
return mStyleSheets.Length();
}
StyleSheetHandle
StyleSheet*
nsDocument::GetStyleSheetAt(int32_t aIndex) const
{
return mStyleSheets.SafeElementAt(aIndex, StyleSheetHandle());
return mStyleSheets.SafeElementAt(aIndex, nullptr);
}
int32_t
nsDocument::GetIndexOfStyleSheet(const StyleSheetHandle aSheet) const
nsDocument::GetIndexOfStyleSheet(const StyleSheet* aSheet) const
{
return mStyleSheets.IndexOf(aSheet);
}
void
nsDocument::AddStyleSheetToStyleSets(StyleSheetHandle aSheet)
nsDocument::AddStyleSheetToStyleSets(StyleSheet* aSheet)
{
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
@ -4023,7 +4023,7 @@ nsDocument::AddStyleSheetToStyleSets(StyleSheetHandle aSheet)
} while (0);
void
nsDocument::NotifyStyleSheetAdded(StyleSheetHandle aSheet, bool aDocumentSheet)
nsDocument::NotifyStyleSheetAdded(StyleSheet* aSheet, bool aDocumentSheet)
{
NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetAdded, (aSheet, aDocumentSheet));
@ -4036,7 +4036,7 @@ nsDocument::NotifyStyleSheetAdded(StyleSheetHandle aSheet, bool aDocumentSheet)
}
void
nsDocument::NotifyStyleSheetRemoved(StyleSheetHandle aSheet, bool aDocumentSheet)
nsDocument::NotifyStyleSheetRemoved(StyleSheet* aSheet, bool aDocumentSheet)
{
NS_DOCUMENT_NOTIFY_OBSERVERS(StyleSheetRemoved, (aSheet, aDocumentSheet));
@ -4049,7 +4049,7 @@ nsDocument::NotifyStyleSheetRemoved(StyleSheetHandle aSheet, bool aDocumentSheet
}
void
nsDocument::AddStyleSheet(StyleSheetHandle aSheet)
nsDocument::AddStyleSheet(StyleSheet* aSheet)
{
NS_PRECONDITION(aSheet, "null arg");
mStyleSheets.AppendElement(aSheet);
@ -4063,7 +4063,7 @@ nsDocument::AddStyleSheet(StyleSheetHandle aSheet)
}
void
nsDocument::RemoveStyleSheetFromStyleSets(StyleSheetHandle aSheet)
nsDocument::RemoveStyleSheetFromStyleSets(StyleSheet* aSheet)
{
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
@ -4072,10 +4072,10 @@ nsDocument::RemoveStyleSheetFromStyleSets(StyleSheetHandle aSheet)
}
void
nsDocument::RemoveStyleSheet(StyleSheetHandle aSheet)
nsDocument::RemoveStyleSheet(StyleSheet* aSheet)
{
NS_PRECONDITION(aSheet, "null arg");
StyleSheetHandle::RefPtr sheet = aSheet; // hold ref so it won't die too soon
RefPtr<StyleSheet> sheet = aSheet; // hold ref so it won't die too soon
if (!mStyleSheets.RemoveElement(aSheet)) {
NS_ASSERTION(mInUnlinkOrDeletion, "stylesheet not found");
@ -4094,8 +4094,8 @@ nsDocument::RemoveStyleSheet(StyleSheetHandle aSheet)
}
void
nsDocument::UpdateStyleSheets(nsTArray<StyleSheetHandle::RefPtr>& aOldSheets,
nsTArray<StyleSheetHandle::RefPtr>& aNewSheets)
nsDocument::UpdateStyleSheets(nsTArray<RefPtr<StyleSheet>>& aOldSheets,
nsTArray<RefPtr<StyleSheet>>& aNewSheets)
{
BeginUpdate(UPDATE_STYLE);
@ -4104,7 +4104,7 @@ nsDocument::UpdateStyleSheets(nsTArray<StyleSheetHandle::RefPtr>& aOldSheets,
"The lists must be the same length!");
int32_t count = aOldSheets.Length();
StyleSheetHandle::RefPtr oldSheet;
RefPtr<StyleSheet> oldSheet;
int32_t i;
for (i = 0; i < count; ++i) {
oldSheet = aOldSheets[i];
@ -4115,7 +4115,7 @@ nsDocument::UpdateStyleSheets(nsTArray<StyleSheetHandle::RefPtr>& aOldSheets,
RemoveStyleSheet(oldSheet); // This does the right notifications
// Now put the new one in its place. If it's null, just ignore it.
StyleSheetHandle newSheet = aNewSheets[i];
StyleSheet* newSheet = aNewSheets[i];
if (newSheet) {
mStyleSheets.InsertElementAt(oldIndex, newSheet);
newSheet->SetOwningDocument(this);
@ -4131,7 +4131,7 @@ nsDocument::UpdateStyleSheets(nsTArray<StyleSheetHandle::RefPtr>& aOldSheets,
}
void
nsDocument::InsertStyleSheetAt(StyleSheetHandle aSheet, int32_t aIndex)
nsDocument::InsertStyleSheetAt(StyleSheet* aSheet, int32_t aIndex)
{
NS_PRECONDITION(aSheet, "null ptr");
@ -4148,7 +4148,7 @@ nsDocument::InsertStyleSheetAt(StyleSheetHandle aSheet, int32_t aIndex)
void
nsDocument::SetStyleSheetApplicableState(StyleSheetHandle aSheet,
nsDocument::SetStyleSheetApplicableState(StyleSheet* aSheet,
bool aApplicable)
{
NS_PRECONDITION(aSheet, "null arg");
@ -4214,7 +4214,7 @@ ConvertAdditionalSheetType(nsIDocument::additionalSheetType aType)
}
static int32_t
FindSheet(const nsTArray<StyleSheetHandle::RefPtr>& aSheets, nsIURI* aSheetURI)
FindSheet(const nsTArray<RefPtr<StyleSheet>>& aSheets, nsIURI* aSheetURI)
{
for (int32_t i = aSheets.Length() - 1; i >= 0; i-- ) {
bool bEqual;
@ -4258,7 +4258,7 @@ nsDocument::LoadAdditionalStyleSheet(additionalSheetType aType,
MOZ_CRASH("impossible value for aType");
}
StyleSheetHandle::RefPtr sheet;
RefPtr<StyleSheet> sheet;
nsresult rv = loader->LoadSheetSync(aSheetURI, parsingMode, true, &sheet);
NS_ENSURE_SUCCESS(rv, rv);
@ -4269,7 +4269,7 @@ nsDocument::LoadAdditionalStyleSheet(additionalSheetType aType,
}
nsresult
nsDocument::AddAdditionalStyleSheet(additionalSheetType aType, StyleSheetHandle aSheet)
nsDocument::AddAdditionalStyleSheet(additionalSheetType aType, StyleSheet* aSheet)
{
if (mAdditionalSheets[aType].Contains(aSheet))
return NS_ERROR_INVALID_ARG;
@ -4298,11 +4298,11 @@ nsDocument::RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheet
{
MOZ_ASSERT(aSheetURI);
nsTArray<StyleSheetHandle::RefPtr>& sheets = mAdditionalSheets[aType];
nsTArray<RefPtr<StyleSheet>>& sheets = mAdditionalSheets[aType];
int32_t i = FindSheet(mAdditionalSheets[aType], aSheetURI);
if (i >= 0) {
StyleSheetHandle::RefPtr sheetRef = sheets[i];
RefPtr<StyleSheet> sheetRef = sheets[i];
sheets.RemoveElementAt(i);
BeginUpdate(UPDATE_STYLE);
@ -4324,10 +4324,10 @@ nsDocument::RemoveAdditionalStyleSheet(additionalSheetType aType, nsIURI* aSheet
}
}
StyleSheetHandle
StyleSheet*
nsDocument::GetFirstAdditionalAuthorSheet()
{
return mAdditionalSheets[eAuthorSheet].SafeElementAt(0, StyleSheetHandle());
return mAdditionalSheets[eAuthorSheet].SafeElementAt(0);
}
nsIGlobalObject*
@ -5132,7 +5132,7 @@ nsDocument::DocumentStatesChanged(EventStates aStateMask)
}
void
nsDocument::StyleRuleChanged(StyleSheetHandle aSheet,
nsDocument::StyleRuleChanged(StyleSheet* aSheet,
css::Rule* aStyleRule)
{
NS_DOCUMENT_NOTIFY_OBSERVERS(StyleRuleChanged, (aSheet));
@ -5146,7 +5146,7 @@ nsDocument::StyleRuleChanged(StyleSheetHandle aSheet,
}
void
nsDocument::StyleRuleAdded(StyleSheetHandle aSheet,
nsDocument::StyleRuleAdded(StyleSheet* aSheet,
css::Rule* aStyleRule)
{
NS_DOCUMENT_NOTIFY_OBSERVERS(StyleRuleAdded, (aSheet));
@ -5161,7 +5161,7 @@ nsDocument::StyleRuleAdded(StyleSheetHandle aSheet,
}
void
nsDocument::StyleRuleRemoved(StyleSheetHandle aSheet,
nsDocument::StyleRuleRemoved(StyleSheet* aSheet,
css::Rule* aStyleRule)
{
NS_DOCUMENT_NOTIFY_OBSERVERS(StyleRuleRemoved, (aSheet));
@ -6029,7 +6029,7 @@ nsIDocument::GetSelectedStyleSheetSet(nsAString& aSheetSet)
int32_t count = GetNumberOfStyleSheets();
nsAutoString title;
for (int32_t index = 0; index < count; index++) {
StyleSheetHandle sheet = GetStyleSheetAt(index);
StyleSheet* sheet = GetStyleSheetAt(index);
NS_ASSERTION(sheet, "Null sheet in sheet list!");
// XXXheycam Make this work with ServoStyleSheets.
@ -6149,7 +6149,7 @@ nsDocument::EnableStyleSheetsForSetInternal(const nsAString& aSheetSet,
int32_t count = GetNumberOfStyleSheets();
nsAutoString title;
for (int32_t index = 0; index < count; index++) {
StyleSheetHandle sheet = GetStyleSheetAt(index);
StyleSheet* sheet = GetStyleSheetAt(index);
NS_ASSERTION(sheet, "Null sheet in sheet list!");
// XXXheycam Make this work with ServoStyleSheets.
@ -9432,7 +9432,7 @@ class StubCSSLoaderObserver final : public nsICSSLoaderObserver {
~StubCSSLoaderObserver() {}
public:
NS_IMETHOD
StyleSheetLoaded(StyleSheetHandle, bool, nsresult) override
StyleSheetLoaded(StyleSheet*, bool, nsresult) override
{
return NS_OK;
}
@ -9461,7 +9461,7 @@ nsDocument::PreloadStyle(nsIURI* uri, const nsAString& charset,
nsresult
nsDocument::LoadChromeSheetSync(nsIURI* uri, bool isAgentSheet,
mozilla::StyleSheetHandle::RefPtr* aSheet)
RefPtr<mozilla::StyleSheet>* aSheet)
{
css::SheetParsingMode mode =
isAgentSheet ? css::eAgentSheetFeatures
@ -9797,7 +9797,7 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer)
int32_t sheetsCount = GetNumberOfStyleSheets();
for (int32_t i = 0; i < sheetsCount; ++i) {
StyleSheetHandle::RefPtr sheet = GetStyleSheetAt(i);
RefPtr<StyleSheet> sheet = GetStyleSheetAt(i);
if (sheet) {
if (sheet->IsApplicable()) {
// XXXheycam Need to make ServoStyleSheet cloning work.
@ -9817,7 +9817,7 @@ nsIDocument::CreateStaticClone(nsIDocShell* aCloneContainer)
}
// Iterate backwards to maintain order
for (StyleSheetHandle sheet : Reversed(thisAsDoc->mOnDemandBuiltInUASheets)) {
for (StyleSheet* sheet : Reversed(thisAsDoc->mOnDemandBuiltInUASheets)) {
if (sheet) {
if (sheet->IsApplicable()) {
// XXXheycam Need to make ServoStyleSheet cloning work.
@ -12009,7 +12009,7 @@ nsDocument::OnAppThemeChanged()
}
for (int32_t i = 0; i < GetNumberOfStyleSheets(); i++) {
StyleSheetHandle::RefPtr sheet = GetStyleSheetAt(i);
RefPtr<StyleSheet> sheet = GetStyleSheetAt(i);
if (!sheet) {
continue;
}
@ -12164,12 +12164,12 @@ nsIDocument::DocAddSizeOfIncludingThis(nsWindowSizes* aWindowSizes) const
}
static size_t
SizeOfOwnedSheetArrayExcludingThis(const nsTArray<StyleSheetHandle::RefPtr>& aSheets,
SizeOfOwnedSheetArrayExcludingThis(const nsTArray<RefPtr<StyleSheet>>& aSheets,
MallocSizeOf aMallocSizeOf)
{
size_t n = 0;
n += aSheets.ShallowSizeOfExcludingThis(aMallocSizeOf);
for (StyleSheetHandle sheet : aSheets) {
for (StyleSheet* sheet : aSheets) {
if (!sheet->GetOwningDocument()) {
// Avoid over-reporting shared sheets.
continue;

Просмотреть файл

@ -621,37 +621,37 @@ public:
virtual Element* FindContentForSubDocument(nsIDocument *aDocument) const override;
virtual Element* GetRootElementInternal() const override;
virtual void EnsureOnDemandBuiltInUASheet(mozilla::StyleSheetHandle aSheet) override;
virtual void EnsureOnDemandBuiltInUASheet(mozilla::StyleSheet* aSheet) override;
/**
* Get the (document) style sheets owned by this document.
* These are ordered, highest priority last
*/
virtual int32_t GetNumberOfStyleSheets() const override;
virtual mozilla::StyleSheetHandle GetStyleSheetAt(int32_t aIndex) const override;
virtual mozilla::StyleSheet* GetStyleSheetAt(int32_t aIndex) const override;
virtual int32_t GetIndexOfStyleSheet(
const mozilla::StyleSheetHandle aSheet) const override;
virtual void AddStyleSheet(mozilla::StyleSheetHandle aSheet) override;
virtual void RemoveStyleSheet(mozilla::StyleSheetHandle aSheet) override;
const mozilla::StyleSheet* aSheet) const override;
virtual void AddStyleSheet(mozilla::StyleSheet* aSheet) override;
virtual void RemoveStyleSheet(mozilla::StyleSheet* aSheet) override;
virtual void UpdateStyleSheets(
nsTArray<mozilla::StyleSheetHandle::RefPtr>& aOldSheets,
nsTArray<mozilla::StyleSheetHandle::RefPtr>& aNewSheets) override;
virtual void AddStyleSheetToStyleSets(mozilla::StyleSheetHandle aSheet);
virtual void RemoveStyleSheetFromStyleSets(mozilla::StyleSheetHandle aSheet);
nsTArray<RefPtr<mozilla::StyleSheet>>& aOldSheets,
nsTArray<RefPtr<mozilla::StyleSheet>>& aNewSheets) override;
virtual void AddStyleSheetToStyleSets(mozilla::StyleSheet* aSheet);
virtual void RemoveStyleSheetFromStyleSets(mozilla::StyleSheet* aSheet);
virtual void InsertStyleSheetAt(mozilla::StyleSheetHandle aSheet,
virtual void InsertStyleSheetAt(mozilla::StyleSheet* aSheet,
int32_t aIndex) override;
virtual void SetStyleSheetApplicableState(mozilla::StyleSheetHandle aSheet,
virtual void SetStyleSheetApplicableState(mozilla::StyleSheet* aSheet,
bool aApplicable) override;
virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType,
nsIURI* aSheetURI) override;
virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType,
mozilla::StyleSheetHandle aSheet) override;
mozilla::StyleSheet* aSheet) override;
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
nsIURI* sheetURI) override;
virtual mozilla::StyleSheetHandle GetFirstAdditionalAuthorSheet() override;
virtual mozilla::StyleSheet* GetFirstAdditionalAuthorSheet() override;
virtual nsIChannel* GetChannel() const override {
return mChannel;
@ -711,11 +711,11 @@ public:
virtual void DocumentStatesChanged(
mozilla::EventStates aStateMask) override;
virtual void StyleRuleChanged(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleRuleChanged(mozilla::StyleSheet* aStyleSheet,
mozilla::css::Rule* aStyleRule) override;
virtual void StyleRuleAdded(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleRuleAdded(mozilla::StyleSheet* aStyleSheet,
mozilla::css::Rule* aStyleRule) override;
virtual void StyleRuleRemoved(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleRuleRemoved(mozilla::StyleSheet* aStyleSheet,
mozilla::css::Rule* aStyleRule) override;
virtual void FlushPendingNotifications(mozFlushType aType) override;
@ -787,7 +787,7 @@ public:
void ReportUseCounters();
private:
void AddOnDemandBuiltInUASheet(mozilla::StyleSheetHandle aSheet);
void AddOnDemandBuiltInUASheet(mozilla::StyleSheet* aSheet);
nsRadioGroupStruct* GetRadioGroupInternal(const nsAString& aName) const;
void SendToConsole(nsCOMArray<nsISecurityConsoleMessage>& aMessages);
@ -970,7 +970,7 @@ public:
const nsAString& aIntegrity) override;
virtual nsresult LoadChromeSheetSync(nsIURI* uri, bool isAgentSheet,
mozilla::StyleSheetHandle::RefPtr* aSheet) override;
RefPtr<mozilla::StyleSheet>* aSheet) override;
virtual nsISupports* GetCurrentContentSink() override;
@ -1288,7 +1288,7 @@ protected:
void RemoveDocStyleSheetsFromStyleSets();
void RemoveStyleSheetsFromStyleSets(
const nsTArray<mozilla::StyleSheetHandle::RefPtr>& aSheets,
const nsTArray<RefPtr<mozilla::StyleSheet>>& aSheets,
mozilla::SheetType aType);
void ResetStylesheetsToURI(nsIURI* aURI);
void FillStyleSet(mozilla::StyleSetHandle aStyleSet);
@ -1342,9 +1342,9 @@ protected:
// EndLoad() has already happened.
nsWeakPtr mWeakSink;
nsTArray<mozilla::StyleSheetHandle::RefPtr> mStyleSheets;
nsTArray<mozilla::StyleSheetHandle::RefPtr> mOnDemandBuiltInUASheets;
nsTArray<mozilla::StyleSheetHandle::RefPtr> mAdditionalSheets[AdditionalSheetTypeCount];
nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheets;
nsTArray<RefPtr<mozilla::StyleSheet>> mOnDemandBuiltInUASheets;
nsTArray<RefPtr<mozilla::StyleSheet>> mAdditionalSheets[AdditionalSheetTypeCount];
// Array of observers
nsTObserverArray<nsIDocumentObserver*> mObservers;
@ -1498,8 +1498,8 @@ private:
friend class nsUnblockOnloadEvent;
// Recomputes the visibility state but doesn't set the new value.
mozilla::dom::VisibilityState GetVisibilityState() const;
void NotifyStyleSheetAdded(mozilla::StyleSheetHandle aSheet, bool aDocumentSheet);
void NotifyStyleSheetRemoved(mozilla::StyleSheetHandle aSheet, bool aDocumentSheet);
void NotifyStyleSheetAdded(mozilla::StyleSheet* aSheet, bool aDocumentSheet);
void NotifyStyleSheetRemoved(mozilla::StyleSheet* aSheet, bool aDocumentSheet);
void PostUnblockOnloadEvent();
void DoUnblockOnload();

Просмотреть файл

@ -34,7 +34,7 @@
#include "mozilla/UniquePtr.h"
#include "mozilla/CORSMode.h"
#include "mozilla/StyleBackendType.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
#include <bitset> // for member
#ifdef MOZILLA_INTERNAL_API
@ -997,7 +997,7 @@ public:
* TODO We can get rid of the whole concept of delayed loading if we fix
* bug 77999.
*/
virtual void EnsureOnDemandBuiltInUASheet(mozilla::StyleSheetHandle aSheet) = 0;
virtual void EnsureOnDemandBuiltInUASheet(mozilla::StyleSheet* aSheet) = 0;
/**
* Get the number of (document) stylesheets
@ -1013,7 +1013,7 @@ public:
* @return the stylesheet at aIndex. Null if aIndex is out of range.
* @throws no exceptions
*/
virtual mozilla::StyleSheetHandle GetStyleSheetAt(int32_t aIndex) const = 0;
virtual mozilla::StyleSheet* GetStyleSheetAt(int32_t aIndex) const = 0;
/**
* Insert a sheet at a particular spot in the stylesheet list (zero-based)
@ -1022,7 +1022,7 @@ public:
* adjusted for the "special" sheets.
* @throws no exceptions
*/
virtual void InsertStyleSheetAt(mozilla::StyleSheetHandle aSheet,
virtual void InsertStyleSheetAt(mozilla::StyleSheet* aSheet,
int32_t aIndex) = 0;
/**
@ -1032,7 +1032,7 @@ public:
* @return aIndex the index of the sheet in the full list
*/
virtual int32_t GetIndexOfStyleSheet(
const mozilla::StyleSheetHandle aSheet) const = 0;
const mozilla::StyleSheet* aSheet) const = 0;
/**
* Replace the stylesheets in aOldSheets with the stylesheets in
@ -1043,24 +1043,24 @@ public:
* will simply be removed.
*/
virtual void UpdateStyleSheets(
nsTArray<mozilla::StyleSheetHandle::RefPtr>& aOldSheets,
nsTArray<mozilla::StyleSheetHandle::RefPtr>& aNewSheets) = 0;
nsTArray<RefPtr<mozilla::StyleSheet>>& aOldSheets,
nsTArray<RefPtr<mozilla::StyleSheet>>& aNewSheets) = 0;
/**
* Add a stylesheet to the document
*/
virtual void AddStyleSheet(mozilla::StyleSheetHandle aSheet) = 0;
virtual void AddStyleSheet(mozilla::StyleSheet* aSheet) = 0;
/**
* Remove a stylesheet from the document
*/
virtual void RemoveStyleSheet(mozilla::StyleSheetHandle aSheet) = 0;
virtual void RemoveStyleSheet(mozilla::StyleSheet* aSheet) = 0;
/**
* Notify the document that the applicable state of the sheet changed
* and that observers should be notified and style sets updated
*/
virtual void SetStyleSheetApplicableState(mozilla::StyleSheetHandle aSheet,
virtual void SetStyleSheetApplicableState(mozilla::StyleSheet* aSheet,
bool aApplicable) = 0;
enum additionalSheetType {
@ -1073,10 +1073,10 @@ public:
virtual nsresult LoadAdditionalStyleSheet(additionalSheetType aType,
nsIURI* aSheetURI) = 0;
virtual nsresult AddAdditionalStyleSheet(additionalSheetType aType,
mozilla::StyleSheetHandle aSheet) = 0;
mozilla::StyleSheet* aSheet) = 0;
virtual void RemoveAdditionalStyleSheet(additionalSheetType aType,
nsIURI* sheetURI) = 0;
virtual mozilla::StyleSheetHandle GetFirstAdditionalAuthorSheet() = 0;
virtual mozilla::StyleSheet* GetFirstAdditionalAuthorSheet() = 0;
/**
* Assuming that aDocSheets is an array of document-level style
@ -1397,11 +1397,11 @@ public:
// Observation hooks for style data to propagate notifications
// to document observers
virtual void StyleRuleChanged(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleRuleChanged(mozilla::StyleSheet* aStyleSheet,
mozilla::css::Rule* aStyleRule) = 0;
virtual void StyleRuleAdded(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleRuleAdded(mozilla::StyleSheet* aStyleSheet,
mozilla::css::Rule* aStyleRule) = 0;
virtual void StyleRuleRemoved(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleRuleRemoved(mozilla::StyleSheet* aStyleSheet,
mozilla::css::Rule* aStyleRule) = 0;
/**
@ -2209,7 +2209,7 @@ public:
* DO NOT USE FOR UNTRUSTED CONTENT.
*/
virtual nsresult LoadChromeSheetSync(nsIURI* aURI, bool aIsAgentSheet,
mozilla::StyleSheetHandle::RefPtr* aSheet) = 0;
RefPtr<mozilla::StyleSheet>* aSheet) = 0;
/**
* Returns true if the locale used for the document specifies a direction of

Просмотреть файл

@ -35,7 +35,7 @@ nsIDocument::FindDocStyleSheetInsertionPoint(
if (sheetDocIndex > newDocIndex)
break;
mozilla::StyleSheetHandle sheetHandle = sheet;
mozilla::StyleSheet* sheetHandle = sheet;
// If the sheet is not owned by the document it can be an author
// sheet registered at nsStyleSheetService or an additional author

Просмотреть файл

@ -7,7 +7,7 @@
#define nsIDocumentObserver_h___
#include "mozilla/EventStates.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
#include "nsISupports.h"
#include "nsIMutationObserver.h"
@ -100,7 +100,7 @@ public:
* @param aDocumentSheet True if sheet is in document's style sheet list,
* false if sheet is not (i.e., UA or user sheet)
*/
virtual void StyleSheetAdded(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleSheetAdded(mozilla::StyleSheet* aStyleSheet,
bool aDocumentSheet) = 0;
/**
@ -113,7 +113,7 @@ public:
* @param aDocumentSheet True if sheet is in document's style sheet list,
* false if sheet is not (i.e., UA or user sheet)
*/
virtual void StyleSheetRemoved(mozilla::StyleSheetHandle aStyleSheet,
virtual void StyleSheetRemoved(mozilla::StyleSheet* aStyleSheet,
bool aDocumentSheet) = 0;
/**
@ -125,7 +125,7 @@ public:
*
* @param aStyleSheet the StyleSheet that has changed state
*/
virtual void StyleSheetApplicableStateChanged(mozilla::StyleSheetHandle aStyleSheet) = 0;
virtual void StyleSheetApplicableStateChanged(mozilla::StyleSheet* aStyleSheet) = 0;
/**
* A StyleRule has just been modified within a style sheet.
@ -136,7 +136,7 @@ public:
*
* @param aStyleSheet the StyleSheet that contians the rule
*/
virtual void StyleRuleChanged(mozilla::StyleSheetHandle aStyleSheet) = 0;
virtual void StyleRuleChanged(mozilla::StyleSheet* aStyleSheet) = 0;
/**
* A StyleRule has just been added to a style sheet.
@ -147,7 +147,7 @@ public:
*
* @param aStyleSheet the StyleSheet that has been modified
*/
virtual void StyleRuleAdded(mozilla::StyleSheetHandle aStyleSheet) = 0;
virtual void StyleRuleAdded(mozilla::StyleSheet* aStyleSheet) = 0;
/**
* A StyleRule has just been removed from a style sheet.
@ -158,7 +158,7 @@ public:
*
* @param aStyleSheet the StyleSheet that has been modified
*/
virtual void StyleRuleRemoved(mozilla::StyleSheetHandle aStyleSheet) = 0;
virtual void StyleRuleRemoved(mozilla::StyleSheet* aStyleSheet) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
@ -186,25 +186,25 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
mozilla::EventStates aStateMask) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETADDED \
virtual void StyleSheetAdded(mozilla::StyleSheetHandle aStyleSheet, \
virtual void StyleSheetAdded(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETREMOVED \
virtual void StyleSheetRemoved(mozilla::StyleSheetHandle aStyleSheet, \
virtual void StyleSheetRemoved(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLESHEETAPPLICABLESTATECHANGED \
virtual void StyleSheetApplicableStateChanged( \
mozilla::StyleSheetHandle aStyleSheet) override;
mozilla::StyleSheet* aStyleSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLERULECHANGED \
virtual void StyleRuleChanged(mozilla::StyleSheetHandle aStyleSheet) override;
virtual void StyleRuleChanged(mozilla::StyleSheet* aStyleSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEADDED \
virtual void StyleRuleAdded(mozilla::StyleSheetHandle aStyleSheet) override;
virtual void StyleRuleAdded(mozilla::StyleSheet* aStyleSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER_STYLERULEREMOVED \
virtual void StyleRuleRemoved(mozilla::StyleSheetHandle aStyleSheet) override;
virtual void StyleRuleRemoved(mozilla::StyleSheet* aStyleSheet) override;
#define NS_DECL_NSIDOCUMENTOBSERVER \
NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE \
@ -262,29 +262,29 @@ NS_IMPL_NSIMUTATIONOBSERVER_CONTENT(_class)
#define NS_IMPL_NSIDOCUMENTOBSERVER_STYLE_STUB(_class) \
void \
_class::StyleSheetAdded(mozilla::StyleSheetHandle aStyleSheet, \
_class::StyleSheetAdded(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) \
{ \
} \
void \
_class::StyleSheetRemoved(mozilla::StyleSheetHandle aStyleSheet, \
_class::StyleSheetRemoved(mozilla::StyleSheet* aStyleSheet, \
bool aDocumentSheet) \
{ \
} \
void \
_class::StyleSheetApplicableStateChanged(mozilla::StyleSheetHandle aStyleSheet) \
_class::StyleSheetApplicableStateChanged(mozilla::StyleSheet* aStyleSheet)\
{ \
} \
void \
_class::StyleRuleChanged(mozilla::StyleSheetHandle aStyleSheet) \
_class::StyleRuleChanged(mozilla::StyleSheet* aStyleSheet) \
{ \
} \
void \
_class::StyleRuleAdded(mozilla::StyleSheetHandle aStyleSheet) \
_class::StyleRuleAdded(mozilla::StyleSheet* aStyleSheet) \
{ \
} \
void \
_class::StyleRuleRemoved(mozilla::StyleSheetHandle aStyleSheet) \
_class::StyleRuleRemoved(mozilla::StyleSheet* aStyleSheet) \
{ \
}

Просмотреть файл

@ -8,7 +8,7 @@
#include "nsISupports.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
class nsICSSLoaderObserver;
class nsIURI;
@ -28,14 +28,14 @@ public:
* @param aStyleSheet the style sheet associated with this
* element.
*/
NS_IMETHOD SetStyleSheet(mozilla::StyleSheetHandle aStyleSheet) = 0;
NS_IMETHOD SetStyleSheet(mozilla::StyleSheet* aStyleSheet) = 0;
/**
* Used to obtain the style sheet linked in by this element.
*
* @return the style sheet associated with this element.
*/
NS_IMETHOD_(mozilla::StyleSheetHandle) GetStyleSheet() = 0;
NS_IMETHOD_(mozilla::StyleSheet*) GetStyleSheet() = 0;
/**
* Initialize the stylesheet linking element. If aDontLoadStyle is

Просмотреть файл

@ -12,8 +12,8 @@
#include "nsStyleLinkElement.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Loader.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/FragmentOrElement.h"
@ -63,7 +63,7 @@ nsStyleLinkElement::Traverse(nsCycleCollectionTraversalCallback &cb)
}
NS_IMETHODIMP
nsStyleLinkElement::SetStyleSheet(StyleSheetHandle aStyleSheet)
nsStyleLinkElement::SetStyleSheet(StyleSheet* aStyleSheet)
{
if (mStyleSheet) {
mStyleSheet->SetOwningNode(nullptr);
@ -80,7 +80,7 @@ nsStyleLinkElement::SetStyleSheet(StyleSheetHandle aStyleSheet)
return NS_OK;
}
NS_IMETHODIMP_(StyleSheetHandle)
NS_IMETHODIMP_(StyleSheet*)
nsStyleLinkElement::GetStyleSheet()
{
return mStyleSheet;

Просмотреть файл

@ -15,7 +15,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/CORSMode.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/net/ReferrerPolicy.h"
#include "nsCOMPtr.h"
#include "nsIStyleSheetLinkingElement.h"
@ -50,8 +50,8 @@ public:
}
// nsIStyleSheetLinkingElement
NS_IMETHOD SetStyleSheet(mozilla::StyleSheetHandle aStyleSheet) override;
NS_IMETHOD_(mozilla::StyleSheetHandle) GetStyleSheet() override;
NS_IMETHOD SetStyleSheet(mozilla::StyleSheet* aStyleSheet) override;
NS_IMETHOD_(mozilla::StyleSheet*) GetStyleSheet() override;
NS_IMETHOD InitStyleLinkElement(bool aDontLoadStyle) override;
NS_IMETHOD UpdateStyleSheet(nsICSSLoaderObserver* aObserver,
bool* aWillNotify,
@ -143,7 +143,7 @@ private:
bool* aIsAlternate,
bool aForceUpdate);
mozilla::StyleSheetHandle::RefPtr mStyleSheet;
RefPtr<mozilla::StyleSheet> mStyleSheet;
protected:
bool mDontLoadStyle;
bool mUpdatesEnabled;

Просмотреть файл

@ -7,7 +7,7 @@
#include "nsTreeSanitizer.h"
#include "mozilla/ArrayUtils.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Declaration.h"
#include "mozilla/css/StyleRule.h"
#include "mozilla/css/Rule.h"

Просмотреть файл

@ -12,7 +12,7 @@
#include "nsIStreamListener.h"
#include "nsIThreadRetargetableStreamListener.h"
#include "mozilla/ConsoleReportCollector.h"
#include "mozilla/dom/SRICheck.h"
#include "mozilla/dom/SRIMetadata.h"
#include "mozilla/RefPtr.h"
#include "mozilla/DebugOnly.h"

Просмотреть файл

@ -114,8 +114,8 @@
#include "nsIFrame.h"
#include "nsIContent.h"
#include "nsLayoutStylesheetCache.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -2550,7 +2550,7 @@ nsHTMLDocument::TearingDownEditor(nsIEditor *aEditor)
if (!presShell)
return;
nsTArray<StyleSheetHandle::RefPtr> agentSheets;
nsTArray<RefPtr<StyleSheet>> agentSheets;
presShell->GetAgentStyleSheets(agentSheets);
auto cache = nsLayoutStylesheetCache::For(GetStyleBackendType());
@ -2693,13 +2693,13 @@ nsHTMLDocument::EditingStateChanged()
// Before making this window editable, we need to modify UA style sheet
// because new style may change whether focused element will be focusable
// or not.
nsTArray<StyleSheetHandle::RefPtr> agentSheets;
nsTArray<RefPtr<StyleSheet>> agentSheets;
rv = presShell->GetAgentStyleSheets(agentSheets);
NS_ENSURE_SUCCESS(rv, rv);
auto cache = nsLayoutStylesheetCache::For(GetStyleBackendType());
StyleSheetHandle contentEditableSheet = cache->ContentEditableSheet();
StyleSheet* contentEditableSheet = cache->ContentEditableSheet();
if (!agentSheets.Contains(contentEditableSheet)) {
agentSheets.AppendElement(contentEditableSheet);
@ -2710,7 +2710,7 @@ nsHTMLDocument::EditingStateChanged()
// specific states on the elements.
if (designMode) {
// designMode is being turned on (overrides contentEditable).
StyleSheetHandle designModeSheet = cache->DesignModeSheet();
StyleSheet* designModeSheet = cache->DesignModeSheet();
if (!agentSheets.Contains(designModeSheet)) {
agentSheets.AppendElement(designModeSheet);
}

Просмотреть файл

@ -35,7 +35,7 @@
#include "imgIContainer.h"
#include "mozIApplication.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/DataStorage.h"
#include "mozilla/devtools/HeapSnapshotTempFileHelperParent.h"
#include "mozilla/docshell/OfflineCacheUpdateParent.h"
@ -187,8 +187,8 @@
#include "nsPluginHost.h"
#include "nsPluginTags.h"
#include "nsIBlocklistService.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "nsHostObjectProtocolHandler.h"
#include "nsIBidiKeyboard.h"
@ -2267,19 +2267,19 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
// This looks like a lot of work, but in a normal browser session we just
// send two loads.
for (StyleSheetHandle sheet : *sheetService->AgentStyleSheets()) {
for (StyleSheet* sheet : *sheetService->AgentStyleSheets()) {
URIParams uri;
SerializeURI(sheet->GetSheetURI(), uri);
Unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AGENT_SHEET);
}
for (StyleSheetHandle sheet : *sheetService->UserStyleSheets()) {
for (StyleSheet* sheet : *sheetService->UserStyleSheets()) {
URIParams uri;
SerializeURI(sheet->GetSheetURI(), uri);
Unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::USER_SHEET);
}
for (StyleSheetHandle sheet : *sheetService->AuthorStyleSheets()) {
for (StyleSheet* sheet : *sheetService->AuthorStyleSheets()) {
URIParams uri;
SerializeURI(sheet->GetSheetURI(), uri);
Unused << SendLoadAndRegisterSheet(uri, nsIStyleSheetService::AUTHOR_SHEET);

Просмотреть файл

@ -32,7 +32,6 @@ public:
void Flush() override;
void Drain() override;
void Shutdown() override;
void ConfigurationChanged(const TrackInfo& aConfig) override { MOZ_ASSERT(false); }
const char* GetDescriptionName() const override { return "RemoteVideoDecoder"; }
@ -62,18 +61,22 @@ public:
: mWrapped(aWrapped)
{}
virtual nsresult Startup() override;
nsresult Startup() override;
virtual bool SupportsMimeType(const nsACString& aMimeType,
DecoderDoctorDiagnostics* aDiagnostics) const override;
bool SupportsMimeType(const nsACString& aMimeType,
DecoderDoctorDiagnostics* aDiagnostics) const override;
virtual ConversionRequired DecoderNeedsConversion(const TrackInfo& aConfig) const override;
ConversionRequired DecoderNeedsConversion(
const TrackInfo& aConfig) const override;
virtual already_AddRefed<MediaDataDecoder>
CreateVideoDecoder(const CreateDecoderParams& aParams) override;
already_AddRefed<MediaDataDecoder> CreateVideoDecoder(
const CreateDecoderParams& aParams) override;
virtual already_AddRefed<MediaDataDecoder>
CreateAudioDecoder(const CreateDecoderParams& aParams) override { return nullptr; }
already_AddRefed<MediaDataDecoder> CreateAudioDecoder(
const CreateDecoderParams& aParams) override
{
return nullptr;
}
private:
RefPtr<PlatformDecoderModule> mWrapped;

Просмотреть файл

@ -52,9 +52,9 @@ VideoDecoderManagerChild::Initialize()
return;
}
// TODO: The above message should return an empty endpoint if there wasn't a GPU
// process. Unfortunately IPDL will assert in this case, so it can't actually
// happen. Bug 1302009 is filed for fixing this.
if (!endpoint.IsValid()) {
return;
}
sDecoderManager = new VideoDecoderManagerChild();

Просмотреть файл

@ -258,11 +258,12 @@ MediaSourceDemuxer::GetMozDebugReaderData(nsAString& aString)
result += nsPrintfCString("Dumping data for demuxer %p:\n", this);
if (mAudioTrack) {
result += nsPrintfCString("\tDumping Audio Track Buffer(%s): - mLastAudioTime: %f\n"
"\t\tNumSamples:%u Size:%u NextGetSampleIndex:%u NextInsertionIndex:%d\n",
"\t\tNumSamples:%u Size:%u Evictable:%u NextGetSampleIndex:%u NextInsertionIndex:%d\n",
mAudioTrack->mAudioTracks.mInfo->mMimeType.get(),
mAudioTrack->mAudioTracks.mNextSampleTime.ToSeconds(),
mAudioTrack->mAudioTracks.mBuffers[0].Length(),
mAudioTrack->mAudioTracks.mSizeBuffer,
mAudioTrack->Evictable(TrackInfo::kAudioTrack),
mAudioTrack->mAudioTracks.mNextGetSampleIndex.valueOr(-1),
mAudioTrack->mAudioTracks.mNextInsertionIndex.valueOr(-1));
@ -271,11 +272,12 @@ MediaSourceDemuxer::GetMozDebugReaderData(nsAString& aString)
}
if (mVideoTrack) {
result += nsPrintfCString("\tDumping Video Track Buffer(%s) - mLastVideoTime: %f\n"
"\t\tNumSamples:%u Size:%u NextGetSampleIndex:%u NextInsertionIndex:%d\n",
"\t\tNumSamples:%u Size:%u Evictable:%u NextGetSampleIndex:%u NextInsertionIndex:%d\n",
mVideoTrack->mVideoTracks.mInfo->mMimeType.get(),
mVideoTrack->mVideoTracks.mNextSampleTime.ToSeconds(),
mVideoTrack->mVideoTracks.mBuffers[0].Length(),
mVideoTrack->mVideoTracks.mSizeBuffer,
mVideoTrack->Evictable(TrackInfo::kVideoTrack),
mVideoTrack->mVideoTracks.mNextGetSampleIndex.valueOr(-1),
mVideoTrack->mVideoTracks.mNextInsertionIndex.valueOr(-1));

Просмотреть файл

@ -274,22 +274,23 @@ TrackBuffersManager::EvictData(const TimeUnit& aPlaybackTime, int64_t aSize)
}
const int64_t toEvict = GetSize() + aSize - EvictionThreshold();
MSE_DEBUG("buffered=%lldkb, eviction threshold=%ukb, evict=%lldkb",
GetSize() / 1024, EvictionThreshold() / 1024, toEvict / 1024);
const uint32_t canEvict =
Evictable(HasVideo() ? TrackInfo::kVideoTrack : TrackInfo::kAudioTrack);
MSE_DEBUG(
"buffered=%lldkB, eviction threshold=%ukB, evict=%lldkB canevict=%ukB",
GetSize() / 1024, EvictionThreshold() / 1024, toEvict / 1024,
canEvict / 1024);
if (toEvict <= 0) {
mEvictionState = EvictionState::NO_EVICTION_NEEDED;
return EvictDataResult::NO_DATA_EVICTED;
}
if (toEvict <= 512*1024) {
// Don't bother evicting less than 512KB.
mEvictionState = EvictionState::NO_EVICTION_NEEDED;
return EvictDataResult::CANT_EVICT;
}
EvictDataResult result;
if (mBufferFull && mEvictionState == EvictionState::EVICTION_COMPLETED) {
if (mBufferFull && mEvictionState == EvictionState::EVICTION_COMPLETED &&
canEvict < uint32_t(toEvict)) {
// Our buffer is currently full. We will make another eviction attempt.
// However, the current appendBuffer will fail as we can't know ahead of
// time if the eviction will later succeed.
@ -422,7 +423,7 @@ TrackBuffersManager::DoEvictData(const TimeUnit& aPlaybackTime,
mEvictionState = EvictionState::EVICTION_COMPLETED;
// Video is what takes the most space, only evict there if we have video.
const auto& track = HasVideo() ? mVideoTracks : mAudioTracks;
auto& track = HasVideo() ? mVideoTracks : mAudioTracks;
const auto& buffer = track.mBuffers.LastElement();
// Remove any data we've already played, or before the next sample to be
// demuxed whichever is lowest.
@ -1603,7 +1604,7 @@ TrackBuffersManager::CheckNextInsertionIndex(TrackData& aTrackData,
TrackBuffer& data = aTrackData.mBuffers.LastElement();
if (data.IsEmpty() || aSampleTime < aTrackData.mBufferedRanges.GetStart()) {
aTrackData.mNextInsertionIndex = Some(size_t(0));
aTrackData.mNextInsertionIndex = Some(0u);
return true;
}
@ -1617,7 +1618,7 @@ TrackBuffersManager::CheckNextInsertionIndex(TrackData& aTrackData,
}
if (target.IsEmpty()) {
// No target found, it will be added at the end of the track buffer.
aTrackData.mNextInsertionIndex = Some(data.Length());
aTrackData.mNextInsertionIndex = Some(uint32_t(data.Length()));
return true;
}
// We now need to find the first frame of the searched interval.
@ -1626,7 +1627,7 @@ TrackBuffersManager::CheckNextInsertionIndex(TrackData& aTrackData,
const RefPtr<MediaRawData>& sample = data[i];
if (sample->mTime >= target.mStart.ToMicroseconds() ||
sample->GetEndTime() > target.mStart.ToMicroseconds()) {
aTrackData.mNextInsertionIndex = Some(size_t(i));
aTrackData.mNextInsertionIndex = Some(i);
return true;
}
}
@ -1686,7 +1687,7 @@ TrackBuffersManager::InsertFrames(TrackBuffer& aSamples,
// to overlap the following frame.
trackBuffer.mNextInsertionIndex.reset();
}
size_t index =
uint32_t index =
RemoveFrames(aIntervals, trackBuffer, trackBuffer.mNextInsertionIndex.refOr(0));
if (index) {
trackBuffer.mNextInsertionIndex = Some(index);
@ -1706,8 +1707,15 @@ TrackBuffersManager::InsertFrames(TrackBuffer& aSamples,
aIntervals.GetEnd() >= trackBuffer.mNextSampleTime) {
MSE_DEBUG("Next sample to be played got overwritten");
trackBuffer.mNextGetSampleIndex.reset();
ResetEvictionIndex(trackBuffer);
} else if (trackBuffer.mNextInsertionIndex.ref() <= trackBuffer.mNextGetSampleIndex.ref()) {
trackBuffer.mNextGetSampleIndex.ref() += aSamples.Length();
// We could adjust the eviction index so that the new data gets added to
// the evictable amount (as it is prior currentTime). However, considering
// new data is being added prior the current playback, it's likely that
// this data will be played next, and as such we probably don't want to
// have it evicted too early. So instead reset the eviction index instead.
ResetEvictionIndex(trackBuffer);
}
}
@ -1737,7 +1745,7 @@ TrackBuffersManager::UpdateHighestTimestamp(TrackData& aTrackData,
}
}
size_t
uint32_t
TrackBuffersManager::RemoveFrames(const TimeIntervals& aIntervals,
TrackData& aTrackData,
uint32_t aStartIndex)
@ -1783,6 +1791,7 @@ TrackBuffersManager::RemoveFrames(const TimeIntervals& aIntervals,
}
int64_t maxSampleDuration = 0;
uint32_t sizeRemoved = 0;
TimeIntervals removedIntervals;
for (uint32_t i = firstRemovedIndex.ref(); i <= lastRemovedIndex; i++) {
const RefPtr<MediaRawData> sample = data[i];
@ -1793,8 +1802,9 @@ TrackBuffersManager::RemoveFrames(const TimeIntervals& aIntervals,
if (sample->mDuration > maxSampleDuration) {
maxSampleDuration = sample->mDuration;
}
aTrackData.mSizeBuffer -= sample->ComputedSizeOfIncludingThis();
sizeRemoved += sample->ComputedSizeOfIncludingThis();
}
aTrackData.mSizeBuffer -= sizeRemoved;
MSE_DEBUG("Removing frames from:%u (frames:%u) ([%f, %f))",
firstRemovedIndex.ref(),
@ -1807,9 +1817,21 @@ TrackBuffersManager::RemoveFrames(const TimeIntervals& aIntervals,
aTrackData.mNextGetSampleIndex.ref() <= lastRemovedIndex) {
MSE_DEBUG("Next sample to be played got evicted");
aTrackData.mNextGetSampleIndex.reset();
ResetEvictionIndex(aTrackData);
} else if (aTrackData.mNextGetSampleIndex.ref() > lastRemovedIndex) {
aTrackData.mNextGetSampleIndex.ref() -=
lastRemovedIndex - firstRemovedIndex.ref() + 1;
uint32_t samplesRemoved = lastRemovedIndex - firstRemovedIndex.ref() + 1;
aTrackData.mNextGetSampleIndex.ref() -= samplesRemoved;
if (aTrackData.mEvictionIndex.mLastIndex > lastRemovedIndex) {
MOZ_DIAGNOSTIC_ASSERT(
aTrackData.mEvictionIndex.mLastIndex >= samplesRemoved &&
aTrackData.mEvictionIndex.mEvictable >= sizeRemoved,
"Invalid eviction index");
MonitorAutoLock mon(mMonitor);
aTrackData.mEvictionIndex.mLastIndex -= samplesRemoved;
aTrackData.mEvictionIndex.mEvictable -= sizeRemoved;
} else {
ResetEvictionIndex(aTrackData);
}
}
}
@ -1951,6 +1973,33 @@ TrackBuffersManager::HighestEndTime()
return highestEndTime;
}
void
TrackBuffersManager::ResetEvictionIndex(TrackData& aTrackData)
{
MonitorAutoLock mon(mMonitor);
aTrackData.mEvictionIndex.Reset();
}
void
TrackBuffersManager::UpdateEvictionIndex(TrackData& aTrackData,
uint32_t currentIndex)
{
uint32_t evictable = 0;
TrackBuffer& data = aTrackData.mBuffers.LastElement();
MOZ_DIAGNOSTIC_ASSERT(currentIndex >= aTrackData.mEvictionIndex.mLastIndex,
"Invalid call");
MOZ_DIAGNOSTIC_ASSERT(currentIndex == data.Length() ||
data[currentIndex]->mKeyframe,"Must stop at keyframe");
for (uint32_t i = aTrackData.mEvictionIndex.mLastIndex; i < currentIndex;
i++) {
evictable += data[i]->ComputedSizeOfIncludingThis();
}
aTrackData.mEvictionIndex.mLastIndex = currentIndex;
MonitorAutoLock mon(mMonitor);
aTrackData.mEvictionIndex.mEvictable += evictable;
}
const TrackBuffersManager::TrackBuffer&
TrackBuffersManager::GetTrackBuffer(TrackInfo::TrackType aTrack)
{
@ -1989,6 +2038,7 @@ TrackBuffersManager::Seek(TrackInfo::TrackType aTrack,
trackBuffer.mNextGetSampleIndex = Some(uint32_t(0));
trackBuffer.mNextSampleTimecode = TimeUnit();
trackBuffer.mNextSampleTime = TimeUnit();
ResetEvictionIndex(trackBuffer);
return TimeUnit();
}
@ -2027,13 +2077,16 @@ TrackBuffersManager::Seek(TrackInfo::TrackType aTrack,
break;
}
}
MSE_DEBUG("Keyframe %s found at %lld",
MSE_DEBUG("Keyframe %s found at %lld @ %u",
lastKeyFrameTime.isSome() ? "" : "not",
lastKeyFrameTime.refOr(TimeUnit()).ToMicroseconds());
lastKeyFrameTime.refOr(TimeUnit()).ToMicroseconds(),
lastKeyFrameIndex);
trackBuffer.mNextGetSampleIndex = Some(lastKeyFrameIndex);
trackBuffer.mNextSampleTimecode = lastKeyFrameTimecode;
trackBuffer.mNextSampleTime = lastKeyFrameTime.refOr(TimeUnit());
ResetEvictionIndex(trackBuffer);
UpdateEvictionIndex(trackBuffer, lastKeyFrameIndex);
return lastKeyFrameTime.refOr(TimeUnit());
}
@ -2121,12 +2174,17 @@ TrackBuffersManager::SkipToNextRandomAccessPoint(TrackInfo::TrackType aTrack,
parsed--;
}
}
if (aFound) {
UpdateEvictionIndex(trackData, trackData.mNextGetSampleIndex.ref());
}
return parsed;
}
const MediaRawData*
TrackBuffersManager::GetSample(TrackInfo::TrackType aTrack,
size_t aIndex,
uint32_t aIndex,
const TimeUnit& aExpectedDts,
const TimeUnit& aExpectedPts,
const TimeUnit& aFuzz)
@ -2193,6 +2251,9 @@ TrackBuffersManager::GetSample(TrackInfo::TrackType aTrack,
aResult = MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__);
return nullptr;
}
if (p->mKeyframe) {
UpdateEvictionIndex(trackData, trackData.mNextGetSampleIndex.ref());
}
trackData.mNextGetSampleIndex.ref()++;
// Estimate decode timestamp and timestamp of the next sample.
TimeUnit nextSampleTimecode =
@ -2244,6 +2305,13 @@ TrackBuffersManager::GetSample(TrackInfo::TrackType aTrack,
aResult = MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__);
return nullptr;
}
// Find the previous keyframe to calculate the evictable amount.
int32_t i = pos;
for (; !track[i]->mKeyframe; i--) {
}
UpdateEvictionIndex(trackData, i);
trackData.mNextGetSampleIndex = Some(uint32_t(pos)+1);
trackData.mNextSampleTimecode =
TimeUnit::FromMicroseconds(sample->mTimecode + sample->mDuration);
@ -2313,6 +2381,13 @@ TrackBuffersManager::FindCurrentPosition(TrackInfo::TrackType aTrack,
return -1;
}
uint32_t
TrackBuffersManager::Evictable(TrackInfo::TrackType aTrack) const
{
MonitorAutoLock mon(mMonitor);
return GetTracksData(aTrack).mEvictionIndex.mEvictable;
}
TimeUnit
TrackBuffersManager::GetNextRandomAccessPoint(TrackInfo::TrackType aTrack,
const TimeUnit& aFuzz)

Просмотреть файл

@ -147,6 +147,7 @@ public:
{
return mEnded;
}
uint32_t Evictable(TrackInfo::TrackType aTrack) const;
media::TimeUnit Seek(TrackInfo::TrackType aTrack,
const media::TimeUnit& aTime,
const media::TimeUnit& aFuzz);
@ -307,7 +308,7 @@ private:
// If set, position where the next contiguous frame will be inserted.
// If a discontinuity is detected, it will be unset and recalculated upon
// the next insertion.
Maybe<size_t> mNextInsertionIndex;
Maybe<uint32_t> mNextInsertionIndex;
// Samples just demuxed, but not yet parsed.
TrackBuffer mQueuedSamples;
// We only manage a single track of each type at this time.
@ -334,6 +335,26 @@ private:
// Approximation of the next sample's presentation timestamp.
media::TimeUnit mNextSampleTime;
struct EvictionIndex
{
EvictionIndex() { Reset(); }
void Reset()
{
mEvictable = 0;
mLastIndex = 0;
}
uint32_t mEvictable;
uint32_t mLastIndex;
};
// Size of data that can be safely evicted during the next eviction
// cycle.
// We consider as evictable all frames up to the last keyframe prior to
// mNextGetSampleIndex. If mNextGetSampleIndex isn't set, then we assume
// that we can't yet evict data.
// Protected by global monitor, except when reading on the task queue as it
// is only written there.
EvictionIndex mEvictionIndex;
void ResetAppendState()
{
mLastDecodeTimestamp.reset();
@ -360,14 +381,17 @@ private:
// Remove all frames and their dependencies contained in aIntervals.
// Return the index at which frames were first removed or 0 if no frames
// removed.
size_t RemoveFrames(const media::TimeIntervals& aIntervals,
TrackData& aTrackData,
uint32_t aStartIndex);
uint32_t RemoveFrames(const media::TimeIntervals& aIntervals,
TrackData& aTrackData,
uint32_t aStartIndex);
// Recalculate track's evictable amount.
void ResetEvictionIndex(TrackData& aTrackData);
void UpdateEvictionIndex(TrackData& aTrackData, uint32_t aCurrentIndex);
// Find index of sample. Return a negative value if not found.
uint32_t FindSampleIndex(const TrackBuffer& aTrackBuffer,
const media::TimeInterval& aInterval);
const MediaRawData* GetSample(TrackInfo::TrackType aTrack,
size_t aIndex,
uint32_t aIndex,
const media::TimeUnit& aExpectedDts,
const media::TimeUnit& aExpectedPts,
const media::TimeUnit& aFuzz);
@ -389,6 +413,16 @@ private:
return mAudioTracks;
}
}
const TrackData& GetTracksData(TrackType aTrack) const
{
switch(aTrack) {
case TrackType::kVideoTrack:
return mVideoTracks;
case TrackType::kAudioTrack:
default:
return mAudioTracks;
}
}
TrackData mVideoTracks;
TrackData mAudioTracks;
@ -436,7 +470,7 @@ private:
};
Atomic<EvictionState> mEvictionState;
// Monitor to protect following objects accessed across multipple threads.
// Monitor to protect following objects accessed across multiple threads.
mutable Monitor mMonitor;
// Stable audio and video track time ranges.
media::TimeIntervals mVideoBufferedRanges;

Просмотреть файл

@ -55,14 +55,16 @@ skip-if = toolkit == 'android' #timeout android bug 1199531
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
[test_DrainOnMissingData_mp4.html]
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
[test_EndOfStream.html]
skip-if = (true || toolkit == 'android' || buildapp == 'mulet') #timeout android/mulet only bug 1101187 and bug 1182946
[test_EndOfStream_mp4.html]
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android' || buildapp == 'mulet')) # Not supported on xp and android 2.3
[test_DurationChange.html]
[test_DurationUpdated.html]
[test_DurationUpdated_mp4.html]
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3
[test_EndOfStream.html]
skip-if = (true || toolkit == 'android' || buildapp == 'mulet') #timeout android/mulet only bug 1101187 and bug 1182946
[test_EndOfStream_mp4.html]
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android' || buildapp == 'mulet')) # Not supported on xp and android 2.3
[test_Eviction_mp4.html]
skip-if = (os == "win" && os_version == "5.1") # Not supported on xp.
[test_FrameSelection.html]
[test_FrameSelection_mp4.html]
skip-if = ((os == "win" && os_version == "5.1") || (toolkit == 'android')) # Not supported on xp and android 2.3

Просмотреть файл

@ -0,0 +1,82 @@
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
<title>MSE: QuotaExceededError when source buffer is full</title>
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="mediasource.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test"><script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
// We fill up the source buffer with audio data until the buffer is full.
// We ensure that QuotaExceededError is thrown once the buffer is full.
// We then seek to half the content. By that time, another appendBuffer must succeed
// as the auto-eviction would succeed (removing all data prior currentTime)
// Fill up the SourceBuffer by appending data repeatedly via doAppendDataFunc until
// an exception is thrown.
function fillUpSourceBuffer(sourceBuffer, doAppendDataFunc, onCaughtExceptionCallback) {
// We are appending data repeatedly in sequence mode, there should be no gaps.
ok(sourceBuffer.buffered.length <= 1, "there should be no gap in buffered ranges.");
try {
doAppendDataFunc();
} catch(ex) {
onCaughtExceptionCallback(ex);
return;
}
once(sourceBuffer, 'updateend', () => {
fillUpSourceBuffer(sourceBuffer, doAppendDataFunc, onCaughtExceptionCallback);
});
}
runWithMSE(function(ms, el) {
el.controls = true;
once(ms, 'sourceopen').then(function() {
ok(true, "Receive a sourceopen event");
SpecialPowers.pushPrefEnv({
"set": [
["media.mediasource.eviction_threshold.audio", 524288],
]
}, function() {
let audiosb = ms.addSourceBuffer("audio/mp4");
audiosb.mode = "sequence";
fetchAndLoad(audiosb, 'bipbop/bipbop_audio', ['init'], '.mp4')
.then(function() {
fetchWithXHR('bipbop/bipbop_audio1.m4s', function(audioBuffer) {
fillUpSourceBuffer(audiosb,
function() { // doAppendDataFunc
audiosb.appendBuffer(audioBuffer);
},
function(ex) { // onCaughtExceptionCallback
is(ex.name, 'QuotaExceededError', "QuotaExceededError thrown");
is(audiosb.buffered.end(0), el.duration, "Duration is end of buffered range");
let seekTime = audiosb.buffered.end(0) / 2;
el.currentTime = seekTime;
once(el, 'seeked', () => {
is(el.currentTime, seekTime, "correctly seeked to " + seekTime);
try {
audiosb.appendBuffer(audioBuffer);
} catch(ex) {
ok(false, "Shouldn't throw another time when data can be evicted");
el.mozDumpDebugInfo();
SimpleTest.finish();
return;
}
once(audiosb, 'update', () => {
ok(true, "appendBuffer succeeded");
SimpleTest.finish();
});
});
});
});
});
});
});
});
</script>
</pre>
</body>
</html>

Просмотреть файл

@ -266,14 +266,6 @@ public:
// after creating. It doesn't need to call Init() before calling this function.
virtual bool IsHardwareAccelerated(nsACString& aFailureReason) const { return false; }
// ConfigurationChanged will be called to inform the video or audio decoder
// that the format of the next input sample is about to change.
// If video decoder, aConfig will be a VideoInfo object.
// If audio decoder, aConfig will be a AudioInfo object.
// It is not safe to store a reference to this object and the decoder must
// make a copy.
virtual void ConfigurationChanged(const TrackInfo& aConfig) {}
// Return the name of the MediaDataDecoder, only used for decoding.
// Only return a static const string, as the information may be accessed
// in a non thread-safe fashion.

Просмотреть файл

@ -209,27 +209,6 @@ WMFMediaDataDecoder::IsHardwareAccelerated(nsACString& aFailureReason) const {
return mMFTManager && mMFTManager->IsHardwareAccelerated(aFailureReason);
}
void
WMFMediaDataDecoder::ConfigurationChanged(const TrackInfo& aConfig)
{
MOZ_ASSERT(mCallback->OnReaderTaskQueue());
nsCOMPtr<nsIRunnable> runnable =
NewRunnableMethod<UniquePtr<TrackInfo>&&>(
this,
&WMFMediaDataDecoder::ProcessConfigurationChanged,
aConfig.Clone());
mTaskQueue->Dispatch(runnable.forget());
}
void
WMFMediaDataDecoder::ProcessConfigurationChanged(UniquePtr<TrackInfo>&& aConfig)
{
if (mMFTManager) {
mMFTManager->ConfigurationChanged(*aConfig);
}
}
void
WMFMediaDataDecoder::SetSeekThreshold(const media::TimeUnit& aTime)
{

Просмотреть файл

@ -57,8 +57,6 @@ public:
virtual TrackInfo::TrackType GetType() = 0;
virtual void ConfigurationChanged(const TrackInfo& aConfig) {}
virtual const char* GetDescriptionName() const = 0;
virtual void SetSeekThreshold(const media::TimeUnit& aTime) {
@ -96,8 +94,6 @@ public:
bool IsHardwareAccelerated(nsACString& aFailureReason) const override;
void ConfigurationChanged(const TrackInfo& aConfig) override;
const char* GetDescriptionName() const override
{
return mMFTManager ? mMFTManager->GetDescriptionName() : "";
@ -125,10 +121,6 @@ private:
void ProcessShutdown();
// Called on the task queue. Tell the MFT that the next Input will have a
// different configuration (typically resolution change).
void ProcessConfigurationChanged(UniquePtr<TrackInfo>&& aConfig);
const RefPtr<TaskQueue> mTaskQueue;
MediaDataDecoderCallback* mCallback;

Просмотреть файл

@ -963,13 +963,4 @@ WMFVideoMFTManager::IsHardwareAccelerated(nsACString& aFailureReason) const
return mDecoder && mUseHwAccel;
}
void
WMFVideoMFTManager::ConfigurationChanged(const TrackInfo& aConfig)
{
MOZ_ASSERT(aConfig.GetAsVideoInfo());
mVideoInfo = *aConfig.GetAsVideoInfo();
mImageSize = mVideoInfo.mImage;
ValidateVideoInfo();
}
} // namespace mozilla

Просмотреть файл

@ -40,8 +40,6 @@ public:
return TrackInfo::kVideoTrack;
}
void ConfigurationChanged(const TrackInfo& aConfig) override;
const char* GetDescriptionName() const override
{
nsCString failureReason;

Просмотреть файл

@ -88,15 +88,6 @@ DecoderFuzzingWrapper::IsHardwareAccelerated(nsACString& aFailureReason) const
return mDecoder->IsHardwareAccelerated(aFailureReason);
}
void
DecoderFuzzingWrapper::ConfigurationChanged(const TrackInfo& aConfig)
{
DFW_LOGV("");
MOZ_ASSERT(mDecoder);
mDecoder->ConfigurationChanged(aConfig);
}
DecoderCallbackFuzzingWrapper::DecoderCallbackFuzzingWrapper(MediaDataDecoderCallback* aCallback)
: mCallback(aCallback)
, mDontDelayInputExhausted(false)

Просмотреть файл

@ -108,7 +108,6 @@ public:
void Drain() override;
void Shutdown() override;
bool IsHardwareAccelerated(nsACString& aFailureReason) const override;
void ConfigurationChanged(const TrackInfo& aConfig) override;
const char* GetDescriptionName() const override
{
return mDecoder->GetDescriptionName();

Просмотреть файл

@ -18,7 +18,6 @@ namespace mozilla
H264Converter::H264Converter(PlatformDecoderModule* aPDM,
const CreateDecoderParams& aParams)
: mPDM(aPDM)
, mOriginalConfig(aParams.VideoConfig())
, mCurrentConfig(aParams.VideoConfig())
, mLayersBackend(aParams.mLayersBackend)
, mImageContainer(aParams.mImageContainer)
@ -166,7 +165,7 @@ H264Converter::SetSeekThreshold(const media::TimeUnit& aTime)
nsresult
H264Converter::CreateDecoder(DecoderDoctorDiagnostics* aDiagnostics)
{
if (mNeedAVCC && !mp4_demuxer::AnnexB::HasSPS(mCurrentConfig.mExtraData)) {
if (!mp4_demuxer::AnnexB::HasSPS(mCurrentConfig.mExtraData)) {
// nothing found yet, will try again later
return NS_ERROR_NOT_INITIALIZED;
}
@ -183,20 +182,14 @@ H264Converter::CreateDecoder(DecoderDoctorDiagnostics* aDiagnostics)
}
return NS_ERROR_FAILURE;
}
} else if (mNeedAVCC) {
} else {
// SPS was invalid.
mLastError = NS_ERROR_FAILURE;
return NS_ERROR_FAILURE;
}
if (!mNeedAVCC) {
// When using a decoder handling AnnexB, we get here only once from the
// constructor. We do want to get the dimensions extracted from the SPS.
mOriginalConfig = mCurrentConfig;
}
mDecoder = mPDM->CreateVideoDecoder({
mNeedAVCC ? mCurrentConfig : mOriginalConfig,
mCurrentConfig,
mTaskQueue,
mCallback,
aDiagnostics,
@ -281,11 +274,6 @@ H264Converter::CheckForSPSChange(MediaRawData* aSample)
mCurrentConfig.mExtraData)) {
return NS_OK;
}
if (!mNeedAVCC) {
UpdateConfigFromExtraData(extra_data);
mDecoder->ConfigurationChanged(mCurrentConfig);
return NS_OK;
}
// The SPS has changed, signal to flush the current decoder and create a
// new one.
mDecoder->Flush();

Просмотреть файл

@ -55,7 +55,6 @@ private:
void OnDecoderInitFailed(MediaResult aError);
RefPtr<PlatformDecoderModule> mPDM;
VideoInfo mOriginalConfig;
VideoInfo mCurrentConfig;
layers::LayersBackend mLayersBackend;
RefPtr<layers::ImageContainer> mImageContainer;

2
dom/media/test/external/requirements.txt поставляемый
Просмотреть файл

@ -17,4 +17,4 @@ mozversion==1.4
wptserve==1.3.0
marionette-client==3.1.0
marionette-driver==2.0.0
firefox-puppeteer >= 51.0.0, <52.0.0
firefox-puppeteer >= 52.0.0, <53.0.0

Просмотреть файл

@ -1469,12 +1469,12 @@ function getPlayableVideo(candidates) {
}
function getPlayableVideos(candidates) {
var v = document.createElement("video");
var v = manifestVideo();
return candidates.filter(function(x){return /^video/.test(x.type) && v.canPlayType(x.type);});
}
function getPlayableAudio(candidates) {
var v = document.createElement("audio");
var v = manifestVideo();
var resources = candidates.filter(function(x){return /^audio/.test(x.type) && v.canPlayType(x.type);});
if (resources.length > 0)
return resources[0];

Просмотреть файл

@ -7,8 +7,6 @@
<script type="text/javascript" src="manifest.js"></script>
</head>
<body>
<video id="v1"></video>
<video id="v2" autoplay></video>
<pre id="test">
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
@ -19,22 +17,29 @@ if (media == null) {
todo(false, "No media supported.");
SimpleTest.finish();
} else {
v1.src = media.name;
v1.preload = 'metadata';
v1.onloadedmetadata = function() {
v2.srcObject = v1.mozCaptureStream();
v1.play();
};
var onPlayingEventFired = false;
function startTest() {
var v1 = document.createElement('video');
var v2 = document.createElement('video');
v1.preload = 'metadata';
v2.autoplay = true;
document.body.appendChild(v1);
document.body.appendChild(v2);
v2.onplaying = function() {
if(!onPlayingEventFired) {
onPlayingEventFired = true;
v1.src = media.name;
v1.onloadedmetadata = function() {
v2.srcObject = v1.mozCaptureStream();
v1.play();
};
v2.addEventListener('playing', function() {
ok(true, "playback started");
SimpleTest.finish();
}
}, {once: true});
}
setMediaTestsPrefs(startTest);
}
</script>
</pre>
</body>

Просмотреть файл

@ -105,7 +105,7 @@ skip-if = toolkit == 'gonk' || toolkit == 'android' # B2G emulator is too slow t
[test_peerConnection_basicAudioRequireEOC.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_peerConnection_basicAudioPcmaPcmuOnly.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g (Bug 1059867)
[test_peerConnection_basicAudioDynamicPtMissingRtpmap.html]
skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g (Bug 1059867)
[test_peerConnection_basicAudioVideo.html]

Просмотреть файл

@ -11,6 +11,7 @@
#include "mozilla/Logging.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/SRILogHelper.h"
#include "mozilla/dom/SRIMetadata.h"
#include "nsContentUtils.h"
#include "nsIChannel.h"
#include "nsIConsoleReportCollector.h"

Просмотреть файл

@ -9,7 +9,6 @@
#include "nsCOMPtr.h"
#include "nsICryptoHash.h"
#include "SRIMetadata.h"
class nsIChannel;
class nsIUnicharStreamLoader;
@ -18,6 +17,8 @@ class nsIConsoleReportCollector;
namespace mozilla {
namespace dom {
class SRIMetadata;
class SRICheck final
{
public:

Просмотреть файл

@ -20,8 +20,8 @@
#include "mozilla/dom/Element.h"
#include "nsSVGElement.h"
#include "mozilla/dom/SVGDocumentBinding.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
using namespace mozilla::css;
using namespace mozilla::dom;
@ -157,7 +157,7 @@ SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded()
nsCOMPtr<nsIURI> uri;
NS_NewURI(getter_AddRefs(uri), spec);
if (uri) {
StyleSheetHandle::RefPtr sheet;
RefPtr<StyleSheet> sheet;
cssLoader->LoadSheetSync(uri,
mozilla::css::eAgentSheetFeatures,
true, &sheet);
@ -173,7 +173,7 @@ SVGDocument::EnsureNonSVGUserAgentStyleSheetsLoaded()
auto cache = nsLayoutStylesheetCache::For(GetStyleBackendType());
StyleSheetHandle sheet = cache->NumberControlSheet();
StyleSheet* sheet = cache->NumberControlSheet();
if (sheet) {
// number-control.css can be behind a pref
EnsureOnDemandBuiltInUASheet(sheet);

Просмотреть файл

@ -770,7 +770,7 @@ nsBindingManager::MediumFeaturesChanged(nsPresContext* aPresContext,
}
void
nsBindingManager::AppendAllSheets(nsTArray<StyleSheetHandle>& aArray)
nsBindingManager::AppendAllSheets(nsTArray<StyleSheet*>& aArray)
{
if (!mBoundContentSet) {
return;

Просмотреть файл

@ -18,7 +18,7 @@
#include "nsXBLBinding.h"
#include "nsTArray.h"
#include "nsThreadUtils.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
struct ElementDependentRuleProcessorData;
class nsIXPConnectWrappedJS;
@ -138,7 +138,7 @@ public:
nsresult MediumFeaturesChanged(nsPresContext* aPresContext,
bool* aRulesChanged);
void AppendAllSheets(nsTArray<mozilla::StyleSheetHandle>& aArray);
void AppendAllSheets(nsTArray<mozilla::StyleSheet*>& aArray);
void Traverse(nsIContent *aContent,
nsCycleCollectionTraversalCallback &cb);

Просмотреть файл

@ -44,8 +44,8 @@
#include "mozilla/dom/CDATASection.h"
#include "mozilla/dom/Comment.h"
#include "mozilla/dom/Element.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#ifdef MOZ_XUL
#include "nsXULElement.h"
@ -1644,14 +1644,14 @@ nsXBLPrototypeBinding::EnsureResources()
}
void
nsXBLPrototypeBinding::AppendStyleSheet(StyleSheetHandle aSheet)
nsXBLPrototypeBinding::AppendStyleSheet(StyleSheet* aSheet)
{
EnsureResources();
mResources->AppendStyleSheet(aSheet);
}
void
nsXBLPrototypeBinding::RemoveStyleSheet(StyleSheetHandle aSheet)
nsXBLPrototypeBinding::RemoveStyleSheet(StyleSheet* aSheet)
{
if (!mResources) {
MOZ_ASSERT(false, "Trying to remove a sheet that does not exist.");
@ -1661,13 +1661,13 @@ nsXBLPrototypeBinding::RemoveStyleSheet(StyleSheetHandle aSheet)
mResources->RemoveStyleSheet(aSheet);
}
void
nsXBLPrototypeBinding::InsertStyleSheetAt(size_t aIndex, StyleSheetHandle aSheet)
nsXBLPrototypeBinding::InsertStyleSheetAt(size_t aIndex, StyleSheet* aSheet)
{
EnsureResources();
mResources->InsertStyleSheetAt(aIndex, aSheet);
}
StyleSheetHandle
StyleSheet*
nsXBLPrototypeBinding::StyleSheetAt(size_t aIndex) const
{
MOZ_ASSERT(mResources);
@ -1688,7 +1688,7 @@ nsXBLPrototypeBinding::HasStyleSheets() const
void
nsXBLPrototypeBinding::AppendStyleSheetsTo(
nsTArray<StyleSheetHandle>& aResult) const
nsTArray<StyleSheet*>& aResult) const
{
if (mResources) {
mResources->AppendStyleSheetsTo(aResult);

Просмотреть файл

@ -20,7 +20,7 @@
#include "nsXBLPrototypeHandler.h"
#include "nsXBLPrototypeResources.h"
#include "mozilla/WeakPtr.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
class nsIAtom;
class nsIContent;
@ -120,13 +120,13 @@ public:
void SetInitialAttributes(nsIContent* aBoundElement, nsIContent* aAnonymousContent);
void AppendStyleSheet(mozilla::StyleSheetHandle aSheet);
void RemoveStyleSheet(mozilla::StyleSheetHandle aSheet);
void InsertStyleSheetAt(size_t aIndex, mozilla::StyleSheetHandle aSheet);
mozilla::StyleSheetHandle StyleSheetAt(size_t aIndex) const;
void AppendStyleSheet(mozilla::StyleSheet* aSheet);
void RemoveStyleSheet(mozilla::StyleSheet* aSheet);
void InsertStyleSheetAt(size_t aIndex, mozilla::StyleSheet* aSheet);
mozilla::StyleSheet* StyleSheetAt(size_t aIndex) const;
size_t SheetCount() const;
bool HasStyleSheets() const;
void AppendStyleSheetsTo(nsTArray<mozilla::StyleSheetHandle>& aResult) const;
void AppendStyleSheetsTo(nsTArray<mozilla::StyleSheet*>& aResult) const;
nsIStyleRuleProcessor* GetRuleProcessor();

Просмотреть файл

@ -19,8 +19,8 @@
#include "nsStyleSet.h"
#include "mozilla/dom/URL.h"
#include "mozilla/DebugOnly.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
using namespace mozilla;
using mozilla::dom::IsChromeURI;
@ -84,18 +84,18 @@ nsXBLPrototypeResources::FlushSkinSheets()
// skin sheets can't be, and which in any case don't have a usable
// URL to reload.)
nsTArray<StyleSheetHandle::RefPtr> oldSheets;
nsTArray<RefPtr<StyleSheet>> oldSheets;
oldSheets.SwapElements(mStyleSheetList);
mozilla::css::Loader* cssLoader = doc->CSSLoader();
for (size_t i = 0, count = oldSheets.Length(); i < count; ++i) {
StyleSheetHandle oldSheet = oldSheets[i];
StyleSheet* oldSheet = oldSheets[i];
nsIURI* uri = oldSheet->GetSheetURI();
StyleSheetHandle::RefPtr newSheet;
RefPtr<StyleSheet> newSheet;
if (!oldSheet->IsInline() && IsChromeURI(uri)) {
if (NS_FAILED(cssLoader->LoadSheetSync(uri, &newSheet)))
continue;
@ -147,7 +147,7 @@ void
nsXBLPrototypeResources::GatherRuleProcessor()
{
nsTArray<RefPtr<CSSStyleSheet>> sheets(mStyleSheetList.Length());
for (StyleSheetHandle sheet : mStyleSheetList) {
for (StyleSheet* sheet : mStyleSheetList) {
MOZ_ASSERT(sheet->IsGecko(),
"GatherRuleProcessor must only be called for "
"nsXBLPrototypeResources objects with Gecko-flavored style "
@ -161,24 +161,24 @@ nsXBLPrototypeResources::GatherRuleProcessor()
}
void
nsXBLPrototypeResources::AppendStyleSheet(StyleSheetHandle aSheet)
nsXBLPrototypeResources::AppendStyleSheet(StyleSheet* aSheet)
{
mStyleSheetList.AppendElement(aSheet);
}
void
nsXBLPrototypeResources::RemoveStyleSheet(StyleSheetHandle aSheet)
nsXBLPrototypeResources::RemoveStyleSheet(StyleSheet* aSheet)
{
mStyleSheetList.RemoveElement(aSheet);
}
void
nsXBLPrototypeResources::InsertStyleSheetAt(size_t aIndex, StyleSheetHandle aSheet)
nsXBLPrototypeResources::InsertStyleSheetAt(size_t aIndex, StyleSheet* aSheet)
{
mStyleSheetList.InsertElementAt(aIndex, aSheet);
}
StyleSheetHandle
StyleSheet*
nsXBLPrototypeResources::StyleSheetAt(size_t aIndex) const
{
return mStyleSheetList[aIndex];
@ -198,7 +198,7 @@ nsXBLPrototypeResources::HasStyleSheets() const
void
nsXBLPrototypeResources::AppendStyleSheetsTo(
nsTArray<StyleSheetHandle>& aResult) const
nsTArray<StyleSheet*>& aResult) const
{
aResult.AppendElements(mStyleSheetList);
}

Просмотреть файл

@ -7,7 +7,7 @@
#ifndef nsXBLPrototypeResources_h__
#define nsXBLPrototypeResources_h__
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
#include "nsICSSLoaderObserver.h"
class nsCSSRuleProcessor;
@ -41,13 +41,13 @@ public:
void ClearLoader();
void AppendStyleSheet(mozilla::StyleSheetHandle aSheet);
void RemoveStyleSheet(mozilla::StyleSheetHandle aSheet);
void InsertStyleSheetAt(size_t aIndex, mozilla::StyleSheetHandle aSheet);
mozilla::StyleSheetHandle StyleSheetAt(size_t aIndex) const;
void AppendStyleSheet(mozilla::StyleSheet* aSheet);
void RemoveStyleSheet(mozilla::StyleSheet* aSheet);
void InsertStyleSheetAt(size_t aIndex, mozilla::StyleSheet* aSheet);
mozilla::StyleSheet* StyleSheetAt(size_t aIndex) const;
size_t SheetCount() const;
bool HasStyleSheets() const;
void AppendStyleSheetsTo(nsTArray<mozilla::StyleSheetHandle>& aResult) const;
void AppendStyleSheetsTo(nsTArray<mozilla::StyleSheet*>& aResult) const;
/**
* Recreates mRuleProcessor to represent the current list of style sheets
@ -63,7 +63,7 @@ private:
RefPtr<nsXBLResourceLoader> mLoader;
// A list of loaded stylesheets for this binding.
nsTArray<mozilla::StyleSheetHandle::RefPtr> mStyleSheetList;
nsTArray<RefPtr<mozilla::StyleSheet>> mStyleSheetList;
// The list of stylesheets converted to a rule processor.
RefPtr<nsCSSRuleProcessor> mRuleProcessor;

Просмотреть файл

@ -17,8 +17,8 @@
#include "nsIDocumentObserver.h"
#include "imgILoader.h"
#include "imgRequestProxy.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Loader.h"
#include "nsIURI.h"
#include "nsNetUtil.h"
@ -135,7 +135,7 @@ nsXBLResourceLoader::LoadResources(bool* aResult)
CheckLoadURIWithPrincipal(docPrincipal, url,
nsIScriptSecurityManager::ALLOW_CHROME);
if (NS_SUCCEEDED(rv)) {
StyleSheetHandle::RefPtr sheet;
RefPtr<StyleSheet> sheet;
rv = cssLoader->LoadSheetSync(url, &sheet);
NS_ASSERTION(NS_SUCCEEDED(rv), "Load failed!!!");
if (NS_SUCCEEDED(rv))
@ -164,7 +164,7 @@ nsXBLResourceLoader::LoadResources(bool* aResult)
// nsICSSLoaderObserver
NS_IMETHODIMP
nsXBLResourceLoader::StyleSheetLoaded(StyleSheetHandle aSheet,
nsXBLResourceLoader::StyleSheetLoaded(StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus)
{

Просмотреть файл

@ -30,7 +30,7 @@ public:
NS_DECL_CYCLE_COLLECTION_CLASS(nsXBLResourceLoader)
// nsICSSLoaderObserver
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheetHandle aSheet,
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus) override;

Просмотреть файл

@ -20,7 +20,7 @@
#include "DocumentType.h"
#include "nsHTMLParts.h"
#include "nsCRT.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Loader.h"
#include "nsGkAtoms.h"
#include "nsContentUtils.h"
@ -411,7 +411,7 @@ nsXMLContentSink::OnTransformDone(nsresult aResult,
}
NS_IMETHODIMP
nsXMLContentSink::StyleSheetLoaded(StyleSheetHandle aSheet,
nsXMLContentSink::StyleSheetLoaded(StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus)
{

Просмотреть файл

@ -82,7 +82,7 @@ public:
NS_IMETHOD OnTransformDone(nsresult aResult, nsIDocument *aResultDocument) override;
// nsICSSLoaderObserver
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheetHandle aSheet,
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus) override;
static bool ParsePIData(const nsString &aData, nsString &aHref,

Просмотреть файл

@ -27,7 +27,7 @@
#include "nsIHTMLDocument.h"
#include "nsIStyleSheetLinkingElement.h"
#include "nsIDocumentTransformer.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Loader.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/EncodingUtils.h"
@ -976,7 +976,7 @@ txTransformNotifier::ScriptEvaluated(nsresult aResult,
}
NS_IMETHODIMP
txTransformNotifier::StyleSheetLoaded(StyleSheetHandle aSheet,
txTransformNotifier::StyleSheetLoaded(StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus)
{

Просмотреть файл

@ -35,7 +35,7 @@ public:
NS_DECL_NSISCRIPTLOADEROBSERVER
// nsICSSLoaderObserver
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheetHandle aSheet,
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus) override;

Просмотреть файл

@ -67,7 +67,7 @@
#include "nsIParser.h"
#include "nsCharsetSource.h"
#include "nsIParserService.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/css/Loader.h"
#include "nsIScriptError.h"
#include "nsIStyleSheetLinkingElement.h"
@ -94,8 +94,8 @@
#include "nsIContentPolicy.h"
#include "mozAutoDocUpdate.h"
#include "xpcpublic.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
using namespace mozilla;
using namespace mozilla::dom;
@ -3106,7 +3106,7 @@ XULDocument::DoneWalking()
}
NS_IMETHODIMP
XULDocument::StyleSheetLoaded(StyleSheetHandle aSheet,
XULDocument::StyleSheetLoaded(StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus)
{
@ -3730,7 +3730,7 @@ XULDocument::AddPrototypeSheets()
for (int32_t i = 0; i < sheets.Count(); i++) {
nsCOMPtr<nsIURI> uri = sheets[i];
StyleSheetHandle::RefPtr incompleteSheet;
RefPtr<StyleSheet> incompleteSheet;
rv = CSSLoader()->LoadSheet(uri,
mCurrentPrototype->DocumentPrincipal(),
EmptyCString(), this,

Просмотреть файл

@ -13,7 +13,7 @@
#include "nsTArray.h"
#include "mozilla/dom/XMLDocument.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
#include "nsForwardReference.h"
#include "nsIContent.h"
#include "nsIDOMXULCommandDispatcher.h"
@ -163,7 +163,7 @@ public:
NS_DECL_NSIDOMXULDOCUMENT
// nsICSSLoaderObserver
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheetHandle aSheet,
NS_IMETHOD StyleSheetLoaded(mozilla::StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus) override;
@ -344,7 +344,7 @@ protected:
* An array of style sheets, that will be added (preserving order) to the
* document after all of them are loaded (in DoneWalking).
*/
nsTArray<StyleSheetHandle::RefPtr> mOverlaySheets;
nsTArray<RefPtr<StyleSheet>> mOverlaySheets;
nsCOMPtr<nsIDOMXULCommandDispatcher> mCommandDispatcher; // [OWNER] of the focus tracker

Просмотреть файл

@ -23,7 +23,7 @@
#include "js/TracingAPI.h"
#include "mozilla/CSSStyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
#include "mozilla/Preferences.h"
#include "mozilla/scache/StartupCache.h"
#include "mozilla/scache/StartupCacheUtils.h"

Просмотреть файл

@ -4237,7 +4237,7 @@ EditorBase::CreateTxnForComposition(const nsAString& aStringToInsert)
}
NS_IMETHODIMP
EditorBase::CreateTxnForAddStyleSheet(StyleSheetHandle aSheet,
EditorBase::CreateTxnForAddStyleSheet(StyleSheet* aSheet,
AddStyleSheetTransaction** aTransaction)
{
RefPtr<AddStyleSheetTransaction> transaction = new AddStyleSheetTransaction();
@ -4252,7 +4252,7 @@ EditorBase::CreateTxnForAddStyleSheet(StyleSheetHandle aSheet,
NS_IMETHODIMP
EditorBase::CreateTxnForRemoveStyleSheet(
StyleSheetHandle aSheet,
StyleSheet* aSheet,
RemoveStyleSheetTransaction** aTransaction)
{
RefPtr<RemoveStyleSheetTransaction> transaction =

Просмотреть файл

@ -9,7 +9,7 @@
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc.
#include "mozilla/OwningNonNull.h" // for OwningNonNull
#include "mozilla/SelectionState.h" // for RangeUpdater, etc.
#include "mozilla/StyleSheetHandle.h" // for StyleSheetHandle
#include "mozilla/StyleSheet.h" // for StyleSheet
#include "mozilla/dom/Text.h"
#include "nsCOMPtr.h" // for already_AddRefed, nsCOMPtr
#include "nsCycleCollectionParticipant.h"
@ -328,14 +328,14 @@ protected:
* Create a transaction for adding a style sheet.
*/
NS_IMETHOD CreateTxnForAddStyleSheet(
StyleSheetHandle aSheet,
StyleSheet* aSheet,
AddStyleSheetTransaction** aTransaction);
/**
* Create a transaction for removing a style sheet.
*/
NS_IMETHOD CreateTxnForRemoveStyleSheet(
StyleSheetHandle aSheet,
StyleSheet* aSheet,
RemoveStyleSheetTransaction** aTransaction);
nsresult DeleteText(nsGenericDOMDataNode& aElement,

Просмотреть файл

@ -72,8 +72,8 @@
#include "mozilla/dom/HTMLBodyElement.h"
#include "nsTextFragment.h"
#include "nsContentList.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
namespace mozilla {
@ -2854,7 +2854,7 @@ HTMLEditor::ReplaceStyleSheet(const nsAString& aURL)
NS_IMETHODIMP
HTMLEditor::RemoveStyleSheet(const nsAString& aURL)
{
StyleSheetHandle::RefPtr sheet = GetStyleSheetForURL(aURL);
RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
NS_ENSURE_TRUE(sheet, NS_ERROR_UNEXPECTED);
RefPtr<RemoveStyleSheetTransaction> transaction;
@ -2894,7 +2894,7 @@ HTMLEditor::AddOverrideStyleSheet(const nsAString& aURL)
// We MUST ONLY load synchronous local files (no @import)
// XXXbz Except this will actually try to load remote files
// synchronously, of course..
StyleSheetHandle::RefPtr sheet;
RefPtr<StyleSheet> sheet;
// Editor override style sheets may want to style Gecko anonymous boxes
rv = ps->GetDocument()->CSSLoader()->
LoadSheetSync(uaURI, mozilla::css::eAgentSheetFeatures, true,
@ -2939,7 +2939,7 @@ HTMLEditor::ReplaceOverrideStyleSheet(const nsAString& aURL)
NS_IMETHODIMP
HTMLEditor::RemoveOverrideStyleSheet(const nsAString& aURL)
{
StyleSheetHandle::RefPtr sheet = GetStyleSheetForURL(aURL);
RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
// Make sure we remove the stylesheet from our internal list in all
// cases.
@ -2962,7 +2962,7 @@ NS_IMETHODIMP
HTMLEditor::EnableStyleSheet(const nsAString& aURL,
bool aEnable)
{
StyleSheetHandle::RefPtr sheet = GetStyleSheetForURL(aURL);
RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
NS_ENSURE_TRUE(sheet, NS_OK); // Don't fail if sheet not found
// Ensure the style sheet is owned by our document.
@ -2980,7 +2980,7 @@ HTMLEditor::EnableStyleSheet(const nsAString& aURL,
bool
HTMLEditor::EnableExistingStyleSheet(const nsAString& aURL)
{
StyleSheetHandle::RefPtr sheet = GetStyleSheetForURL(aURL);
RefPtr<StyleSheet> sheet = GetStyleSheetForURL(aURL);
// Enable sheet if already loaded.
if (sheet)
@ -3002,7 +3002,7 @@ HTMLEditor::EnableExistingStyleSheet(const nsAString& aURL)
nsresult
HTMLEditor::AddNewStyleSheetToList(const nsAString& aURL,
StyleSheetHandle aStyleSheet)
StyleSheet* aStyleSheet)
{
uint32_t countSS = mStyleSheets.Length();
uint32_t countU = mStyleSheetURLs.Length();
@ -3032,7 +3032,7 @@ HTMLEditor::RemoveStyleSheetFromList(const nsAString& aURL)
return NS_OK;
}
StyleSheetHandle
StyleSheet*
HTMLEditor::GetStyleSheetForURL(const nsAString& aURL)
{
// is it already in the list?
@ -3047,7 +3047,7 @@ HTMLEditor::GetStyleSheetForURL(const nsAString& aURL)
}
void
HTMLEditor::GetURLForStyleSheet(StyleSheetHandle aStyleSheet,
HTMLEditor::GetURLForStyleSheet(StyleSheet* aStyleSheet,
nsAString& aURL)
{
// is it already in the list?
@ -3426,7 +3426,7 @@ HTMLEditor::DebugUnitTests(int32_t* outNumTests,
}
NS_IMETHODIMP
HTMLEditor::StyleSheetLoaded(StyleSheetHandle aSheet,
HTMLEditor::StyleSheetLoaded(StyleSheet* aSheet,
bool aWasAlternate,
nsresult aStatus)
{

Просмотреть файл

@ -8,7 +8,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/CSSEditUtils.h"
#include "mozilla/StyleSheetHandle.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/TextEditor.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/File.h"
@ -365,7 +365,7 @@ public:
NS_IMETHOD GetRootElement(nsIDOMElement** aRootElement) override;
// nsICSSLoaderObserver
NS_IMETHOD StyleSheetLoaded(StyleSheetHandle aSheet,
NS_IMETHOD StyleSheetLoaded(StyleSheet* aSheet,
bool aWasAlternate, nsresult aStatus) override;
// Utility Routines, not part of public API
@ -417,15 +417,15 @@ public:
/**
* Dealing with the internal style sheet lists.
*/
StyleSheetHandle GetStyleSheetForURL(const nsAString& aURL);
void GetURLForStyleSheet(StyleSheetHandle aStyleSheet,
StyleSheet* GetStyleSheetForURL(const nsAString& aURL);
void GetURLForStyleSheet(StyleSheet* aStyleSheet,
nsAString& aURL);
/**
* Add a url + known style sheet to the internal lists.
*/
nsresult AddNewStyleSheetToList(const nsAString &aURL,
StyleSheetHandle aStyleSheet);
StyleSheet* aStyleSheet);
nsresult RemoveStyleSheetFromList(const nsAString &aURL);
bool IsCSSEnabled()
@ -907,7 +907,7 @@ protected:
// Maintain a list of associated style sheets and their urls.
nsTArray<nsString> mStyleSheetURLs;
nsTArray<StyleSheetHandle::RefPtr> mStyleSheets;
nsTArray<RefPtr<StyleSheet>> mStyleSheets;
// an array for holding default style settings
nsTArray<PropItem*> mDefaultStyles;

Просмотреть файл

@ -9,8 +9,8 @@
#include "nsAString.h"
#include "nsCOMPtr.h" // for nsCOMPtr, do_QueryInterface, etc.
#include "mozilla/StyleSheetHandle.h" // for mozilla::StyleSheetHandle
#include "mozilla/StyleSheetHandleInlines.h"
#include "mozilla/StyleSheet.h" // for mozilla::StyleSheet
#include "mozilla/StyleSheetInlines.h"
#include "nsDebug.h" // for NS_ENSURE_TRUE
#include "nsError.h" // for NS_OK, etc.
#include "nsIDOMDocument.h" // for nsIDOMDocument
@ -21,7 +21,7 @@
namespace mozilla {
static void
AddStyleSheet(nsIEditor* aEditor, StyleSheetHandle aSheet)
AddStyleSheet(nsIEditor* aEditor, StyleSheet* aSheet)
{
nsCOMPtr<nsIDOMDocument> domDoc;
aEditor->GetDocument(getter_AddRefs(domDoc));
@ -34,7 +34,7 @@ AddStyleSheet(nsIEditor* aEditor, StyleSheetHandle aSheet)
}
static void
RemoveStyleSheet(nsIEditor* aEditor, StyleSheetHandle aSheet)
RemoveStyleSheet(nsIEditor* aEditor, StyleSheet* aSheet)
{
nsCOMPtr<nsIDOMDocument> domDoc;
aEditor->GetDocument(getter_AddRefs(domDoc));
@ -64,7 +64,7 @@ NS_INTERFACE_MAP_END_INHERITING(EditTransactionBase)
NS_IMETHODIMP
AddStyleSheetTransaction::Init(nsIEditor* aEditor,
StyleSheetHandle aSheet)
StyleSheet* aSheet)
{
NS_ENSURE_TRUE(aEditor && aSheet, NS_ERROR_INVALID_ARG);
@ -118,7 +118,7 @@ NS_INTERFACE_MAP_END_INHERITING(EditTransactionBase)
NS_IMETHODIMP
RemoveStyleSheetTransaction::Init(nsIEditor* aEditor,
StyleSheetHandle aSheet)
StyleSheet* aSheet)
{
NS_ENSURE_TRUE(aEditor && aSheet, NS_ERROR_INVALID_ARG);

Просмотреть файл

@ -7,7 +7,7 @@
#define StylesheetTransactions_h
#include "mozilla/EditTransactionBase.h" // for EditTransactionBase, etc.
#include "mozilla/StyleSheetHandle.h" // for mozilla::StyleSheetHandle
#include "mozilla/StyleSheet.h" // for mozilla::StyleSheet
#include "nsCycleCollectionParticipant.h"
#include "nsID.h" // for REFNSIID
#include "nscore.h" // for NS_IMETHOD
@ -24,7 +24,7 @@ public:
* @param aEditor The object providing core editing operations
* @param aSheet The stylesheet to add
*/
NS_IMETHOD Init(nsIEditor* aEditor, StyleSheetHandle aSheet);
NS_IMETHOD Init(nsIEditor* aEditor, StyleSheet* aSheet);
AddStyleSheetTransaction();
@ -38,7 +38,7 @@ protected:
// The editor that created this transaction.
nsIEditor* mEditor;
// The style sheet to add.
mozilla::StyleSheetHandle::RefPtr mSheet;
RefPtr<mozilla::StyleSheet> mSheet;
};
@ -50,7 +50,7 @@ public:
* @param aEditor The object providing core editing operations.
* @param aSheet The stylesheet to remove.
*/
NS_IMETHOD Init(nsIEditor* aEditor, StyleSheetHandle aSheet);
NS_IMETHOD Init(nsIEditor* aEditor, StyleSheet* aSheet);
RemoveStyleSheetTransaction();
@ -64,7 +64,7 @@ protected:
// The editor that created this transaction.
nsIEditor* mEditor;
// The style sheet to remove.
StyleSheetHandle::RefPtr mSheet;
RefPtr<StyleSheet> mSheet;
};

Просмотреть файл

@ -78,7 +78,7 @@ struct BasePoint {
return x * aPoint.x + y * aPoint.y;
}
T Length() const {
Coord Length() const {
return hypot(x, y);
}

Просмотреть файл

@ -15,7 +15,7 @@
#include "ScopedGLHelpers.h"
#include "gfx2DGlue.h"
#include "../layers/ipc/ShadowLayers.h"
#include "mozilla/layers/CompositableForwarder.h"
#include "mozilla/layers/TextureForwarder.h"
#include "mozilla/layers/TextureClientSharedSurface.h"
#ifdef XP_WIN
@ -69,16 +69,17 @@ GLScreenBuffer::Create(GLContext* gl,
/* static */ UniquePtr<SurfaceFactory>
GLScreenBuffer::CreateFactory(GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::CompositableForwarder>& forwarder,
KnowsCompositor* compositorConnection,
const layers::TextureFlags& flags)
{
return CreateFactory(gl, caps, forwarder, forwarder->GetCompositorBackendType(), flags);
return CreateFactory(gl, caps, compositorConnection->GetTextureForwarder(),
compositorConnection->GetCompositorBackendType(), flags);
}
/* static */ UniquePtr<SurfaceFactory>
GLScreenBuffer::CreateFactory(GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
LayersIPCChannel* ipcChannel,
const mozilla::layers::LayersBackend backend,
const layers::TextureFlags& flags)
{
@ -87,18 +88,18 @@ GLScreenBuffer::CreateFactory(GLContext* gl,
switch (backend) {
case mozilla::layers::LayersBackend::LAYERS_OPENGL: {
#if defined(XP_MACOSX)
factory = SurfaceFactory_IOSurface::Create(gl, caps, allocator, flags);
factory = SurfaceFactory_IOSurface::Create(gl, caps, ipcChannel, flags);
#elif defined(MOZ_WIDGET_GONK)
factory = MakeUnique<SurfaceFactory_Gralloc>(gl, caps, allocator, flags);
factory = MakeUnique<SurfaceFactory_Gralloc>(gl, caps, ipcChannel, flags);
#elif defined(GL_PROVIDER_GLX)
if (sGLXLibrary.UseTextureFromPixmap())
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, allocator, flags);
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, ipcChannel, flags);
#elif defined(MOZ_WIDGET_UIKIT)
factory = MakeUnique<SurfaceFactory_GLTexture>(mGLContext, caps, allocator, mFlags);
factory = MakeUnique<SurfaceFactory_GLTexture>(mGLContext, caps, ipcChannel, mFlags);
#else
if (gl->GetContextType() == GLContextType::EGL) {
if (XRE_IsParentProcess()) {
factory = SurfaceFactory_EGLImage::Create(gl, caps, allocator, flags);
factory = SurfaceFactory_EGLImage::Create(gl, caps, ipcChannel, flags);
}
}
#endif
@ -113,11 +114,11 @@ GLScreenBuffer::CreateFactory(GLContext* gl,
(gl->IsWARP() == dm->IsWARP()) &&
dm->TextureSharingWorks())
{
factory = SurfaceFactory_ANGLEShareHandle::Create(gl, caps, allocator, flags);
factory = SurfaceFactory_ANGLEShareHandle::Create(gl, caps, ipcChannel, flags);
}
if (!factory && gfxPrefs::WebGLDXGLEnabled()) {
factory = SurfaceFactory_D3D11Interop::Create(gl, caps, allocator, flags);
factory = SurfaceFactory_D3D11Interop::Create(gl, caps, ipcChannel, flags);
}
#endif
break;
@ -128,7 +129,7 @@ GLScreenBuffer::CreateFactory(GLContext* gl,
#ifdef GL_PROVIDER_GLX
if (!factory && sGLXLibrary.UseTextureFromPixmap()) {
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, allocator, flags);
factory = SurfaceFactory_GLXDrawable::Create(gl, caps, ipcChannel, flags);
}
#endif
}

Просмотреть файл

@ -25,7 +25,8 @@
namespace mozilla {
namespace layers {
class CompositableForwarder;
class KnowsCompositor;
class LayersIPCChannel;
class SharedSurfaceTextureClient;
} // namespace layers
@ -137,12 +138,12 @@ public:
static UniquePtr<SurfaceFactory>
CreateFactory(GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::CompositableForwarder>& forwarder,
layers::KnowsCompositor* compositorConnection,
const layers::TextureFlags& flags);
static UniquePtr<SurfaceFactory>
CreateFactory(GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
layers::LayersIPCChannel* ipcChannel,
const mozilla::layers::LayersBackend backend,
const layers::TextureFlags& flags);

Просмотреть файл

@ -15,6 +15,7 @@
#include "SharedSurfaceGL.h"
#include "mozilla/layers/CompositorTypes.h"
#include "mozilla/layers/TextureClientSharedSurface.h"
#include "mozilla/layers/TextureForwarder.h"
#include "mozilla/Unused.h"
namespace mozilla {
@ -287,7 +288,7 @@ ChooseBufferBits(const SurfaceCaps& caps,
SurfaceFactory::SurfaceFactory(SharedSurfaceType type, GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
: mType(type)
, mGL(gl)

Просмотреть файл

@ -39,7 +39,7 @@ class DrawTarget;
} // namespace gfx
namespace layers {
class ClientIPCAllocator;
class LayersIPCChannel;
class SharedSurfaceTextureClient;
enum class TextureFlags : uint32_t;
class SurfaceDescriptor;
@ -267,7 +267,7 @@ public:
const SharedSurfaceType mType;
GLContext* const mGL;
const SurfaceCaps mCaps;
const RefPtr<layers::ClientIPCAllocator> mAllocator;
const RefPtr<layers::LayersIPCChannel> mAllocator;
const layers::TextureFlags mFlags;
const GLFormats mFormats;
Mutex mMutex;
@ -278,7 +278,7 @@ protected:
RefSet<layers::SharedSurfaceTextureClient> mRecycleTotalPool;
SurfaceFactory(SharedSurfaceType type, GLContext* gl, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags);
public:

Просмотреть файл

@ -320,7 +320,7 @@ SharedSurface_ANGLEShareHandle::ReadbackBySharedHandle(gfx::DataSourceSurface* o
/*static*/ UniquePtr<SurfaceFactory_ANGLEShareHandle>
SurfaceFactory_ANGLEShareHandle::Create(GLContext* gl, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
{
GLLibraryEGL* egl = &sEGLLibrary;
@ -340,7 +340,7 @@ SurfaceFactory_ANGLEShareHandle::Create(GLContext* gl, const SurfaceCaps& caps,
SurfaceFactory_ANGLEShareHandle::SurfaceFactory_ANGLEShareHandle(GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags,
GLLibraryEGL* egl,
EGLConfig config)

Просмотреть файл

@ -80,12 +80,12 @@ protected:
public:
static UniquePtr<SurfaceFactory_ANGLEShareHandle> Create(GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags);
protected:
SurfaceFactory_ANGLEShareHandle(GLContext* gl, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags, GLLibraryEGL* egl,
EGLConfig config);

Просмотреть файл

@ -391,7 +391,7 @@ SharedSurface_D3D11Interop::ToSurfaceDescriptor(layers::SurfaceDescriptor* const
/*static*/ UniquePtr<SurfaceFactory_D3D11Interop>
SurfaceFactory_D3D11Interop::Create(GLContext* gl, const SurfaceCaps& caps,
layers::ClientIPCAllocator* allocator,
layers::LayersIPCChannel* allocator,
const layers::TextureFlags& flags)
{
WGLLibrary* wgl = &sWGLLib;
@ -411,7 +411,7 @@ SurfaceFactory_D3D11Interop::Create(GLContext* gl, const SurfaceCaps& caps,
SurfaceFactory_D3D11Interop::SurfaceFactory_D3D11Interop(GLContext* gl,
const SurfaceCaps& caps,
layers::ClientIPCAllocator* allocator,
layers::LayersIPCChannel* allocator,
const layers::TextureFlags& flags,
DXInterop2Device* interop)
: SurfaceFactory(SharedSurfaceType::DXGLInterop2, gl, caps, allocator, flags)

Просмотреть файл

@ -75,12 +75,12 @@ public:
static UniquePtr<SurfaceFactory_D3D11Interop> Create(GLContext* gl,
const SurfaceCaps& caps,
layers::ClientIPCAllocator* allocator,
layers::LayersIPCChannel* allocator,
const layers::TextureFlags& flags);
protected:
SurfaceFactory_D3D11Interop(GLContext* gl, const SurfaceCaps& caps,
layers::ClientIPCAllocator* allocator,
layers::LayersIPCChannel* allocator,
const layers::TextureFlags& flags,
DXInterop2Device* interop);

Просмотреть файл

@ -170,7 +170,7 @@ SharedSurface_EGLImage::ReadbackBySharedHandle(gfx::DataSourceSurface* out_surfa
/*static*/ UniquePtr<SurfaceFactory_EGLImage>
SurfaceFactory_EGLImage::Create(GLContext* prodGL, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
{
EGLContext context = GLContextEGL::Cast(prodGL)->mContext;

Просмотреть файл

@ -90,14 +90,14 @@ public:
// Fallible:
static UniquePtr<SurfaceFactory_EGLImage> Create(GLContext* prodGL,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags);
protected:
const EGLContext mContext;
SurfaceFactory_EGLImage(GLContext* prodGL, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags,
EGLContext context)
: SurfaceFactory(SharedSurfaceType::EGLImageShare, prodGL, caps, allocator, flags)

Просмотреть файл

@ -148,7 +148,7 @@ class SurfaceFactory_GLTexture
public:
SurfaceFactory_GLTexture(GLContext* prodGL,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
: SurfaceFactory(SharedSurfaceType::SharedGLTexture, prodGL, caps, allocator, flags)
{

Просмотреть файл

@ -13,6 +13,7 @@
#include "mozilla/layers/LayersSurfaces.h"
#include "mozilla/layers/ShadowLayerUtilsX11.h"
#include "mozilla/layers/ISurfaceAllocator.h"
#include "mozilla/layers/TextureForwarder.h"
#include "mozilla/X11Util.h"
namespace mozilla {
@ -120,7 +121,7 @@ SharedSurface_GLXDrawable::ReadbackBySharedHandle(gfx::DataSourceSurface* out_su
UniquePtr<SurfaceFactory_GLXDrawable>
SurfaceFactory_GLXDrawable::Create(GLContext* prodGL,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
{
MOZ_ASSERT(caps.alpha, "GLX surfaces require an alpha channel!");

Просмотреть файл

@ -49,14 +49,14 @@ class SurfaceFactory_GLXDrawable
public:
static UniquePtr<SurfaceFactory_GLXDrawable> Create(GLContext* prodGL,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags);
virtual UniquePtr<SharedSurface> CreateShared(const gfx::IntSize& size) override;
private:
SurfaceFactory_GLXDrawable(GLContext* prodGL, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
: SurfaceFactory(SharedSurfaceType::GLXDrawable, prodGL, caps, allocator, flags)
{ }

Просмотреть файл

@ -35,7 +35,7 @@ using namespace mozilla::layers;
using namespace android;
SurfaceFactory_Gralloc::SurfaceFactory_Gralloc(GLContext* prodGL, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
: SurfaceFactory(SharedSurfaceType::Gralloc, prodGL, caps, allocator, flags)
{
@ -48,7 +48,7 @@ SharedSurface_Gralloc::Create(GLContext* prodGL,
const gfx::IntSize& size,
bool hasAlpha,
layers::TextureFlags flags,
ClientIPCAllocator* allocator)
LayersIPCChannel* allocator)
{
GLLibraryEGL* egl = &sEGLLibrary;
MOZ_ASSERT(egl);
@ -118,7 +118,7 @@ SharedSurface_Gralloc::SharedSurface_Gralloc(GLContext* prodGL,
const gfx::IntSize& size,
bool hasAlpha,
GLLibraryEGL* egl,
layers::ClientIPCAllocator* allocator,
layers::LayersIPCChannel* allocator,
layers::TextureClient* textureClient,
GLuint prodTex)
: SharedSurface(SharedSurfaceType::Gralloc,

Просмотреть файл

@ -12,7 +12,7 @@
namespace mozilla {
namespace layers {
class ClientIPCAllocator;
class LayersIPCChannel;
class TextureClient;
}
@ -29,7 +29,7 @@ public:
const gfx::IntSize& size,
bool hasAlpha,
layers::TextureFlags flags,
layers::ClientIPCAllocator* allocator);
layers::LayersIPCChannel* allocator);
static SharedSurface_Gralloc* Cast(SharedSurface* surf) {
MOZ_ASSERT(surf->mType == SharedSurfaceType::Gralloc);
@ -40,7 +40,7 @@ public:
protected:
GLLibraryEGL* const mEGL;
EGLSync mSync;
RefPtr<layers::ClientIPCAllocator> mAllocator;
RefPtr<layers::LayersIPCChannel> mAllocator;
RefPtr<layers::TextureClient> mTextureClient;
const GLuint mProdTex;
@ -48,7 +48,7 @@ protected:
const gfx::IntSize& size,
bool hasAlpha,
GLLibraryEGL* egl,
layers::ClientIPCAllocator* allocator,
layers::LayersIPCChannel* allocator,
layers::TextureClient* textureClient,
GLuint prodTex);
@ -83,7 +83,7 @@ class SurfaceFactory_Gralloc
{
public:
SurfaceFactory_Gralloc(GLContext* prodGL, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags);
virtual UniquePtr<SharedSurface> CreateShared(const gfx::IntSize& size) override {

Просмотреть файл

@ -211,7 +211,7 @@ SharedSurface_IOSurface::ReadbackBySharedHandle(gfx::DataSourceSurface* out_surf
/*static*/ UniquePtr<SurfaceFactory_IOSurface>
SurfaceFactory_IOSurface::Create(GLContext* gl, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
{
auto maxDims = gfx::IntSize::Truncate(MacIOSurface::GetMaxWidth(),

Просмотреть файл

@ -77,13 +77,13 @@ public:
// Infallible.
static UniquePtr<SurfaceFactory_IOSurface> Create(GLContext* gl,
const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags);
protected:
const gfx::IntSize mMaxDims;
SurfaceFactory_IOSurface(GLContext* gl, const SurfaceCaps& caps,
const RefPtr<layers::ClientIPCAllocator>& allocator,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags,
const gfx::IntSize& maxDims)
: SurfaceFactory(SharedSurfaceType::IOSurface, gl, caps, allocator, flags)

Просмотреть файл

@ -27,16 +27,17 @@ public:
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator);
LayersIPCChannel* aAllocator);
virtual TextureData*
CreateSimilar(ClientIPCAllocator* aAllocator,
CreateSimilar(LayersIPCChannel* aAllocator,
LayersBackend aLayersBackend,
TextureFlags aFlags = TextureFlags::DEFAULT,
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
virtual void Deallocate(ClientIPCAllocator*) override;
virtual void Deallocate(LayersIPCChannel*) override;
MemoryTextureData(const BufferDescriptor& aDesc,
gfx::BackendType aMoz2DBackend,
@ -66,16 +67,17 @@ public:
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator);
LayersIPCChannel* aAllocator);
virtual TextureData*
CreateSimilar(ClientIPCAllocator* aAllocator,
CreateSimilar(LayersIPCChannel* aAllocator,
LayersBackend aLayersBackend,
TextureFlags aFlags = TextureFlags::DEFAULT,
TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override;
virtual bool Serialize(SurfaceDescriptor& aOutDescriptor) override;
virtual void Deallocate(ClientIPCAllocator* aAllocator) override;
virtual void Deallocate(LayersIPCChannel* aAllocator) override;
ShmemTextureData(const BufferDescriptor& aDesc,
gfx::BackendType aMoz2DBackend, mozilla::ipc::Shmem aShmem)
@ -114,22 +116,21 @@ BufferTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend, TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator)
LayersIPCChannel* aAllocator)
{
if (!aAllocator || aAllocator->IsSameProcess()) {
return MemoryTextureData::Create(aSize, aFormat, aMoz2DBackend,
aLayersBackend, aFlags,
aAllocFlags, aAllocator);
} else if (aAllocator->AsShmemAllocator()) {
} else {
return ShmemTextureData::Create(aSize, aFormat, aMoz2DBackend,
aLayersBackend, aFlags,
aAllocFlags, aAllocator);
}
return nullptr;
}
BufferTextureData*
BufferTextureData::CreateInternal(ClientIPCAllocator* aAllocator,
BufferTextureData::CreateInternal(LayersIPCChannel* aAllocator,
const BufferDescriptor& aDesc,
gfx::BackendType aMoz2DBackend,
int32_t aBufferSize,
@ -144,19 +145,18 @@ BufferTextureData::CreateInternal(ClientIPCAllocator* aAllocator,
GfxMemoryImageReporter::DidAlloc(buffer);
return new MemoryTextureData(aDesc, aMoz2DBackend, buffer, aBufferSize);
} else if (aAllocator->AsShmemAllocator()) {
} else {
ipc::Shmem shm;
if (!aAllocator->AsShmemAllocator()->AllocUnsafeShmem(aBufferSize, OptimalShmemType(), &shm)) {
if (!aAllocator->AllocUnsafeShmem(aBufferSize, OptimalShmemType(), &shm)) {
return nullptr;
}
return new ShmemTextureData(aDesc, aMoz2DBackend, shm);
}
return nullptr;
}
BufferTextureData*
BufferTextureData::CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
BufferTextureData::CreateForYCbCrWithBufferSize(KnowsCompositor* aAllocator,
int32_t aBufferSize,
TextureFlags aTextureFlags)
{
@ -164,10 +164,8 @@ BufferTextureData::CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
return nullptr;
}
auto fwd = aAllocator->AsCompositableForwarder();
bool hasIntermediateBuffer = fwd ? ComputeHasIntermediateBuffer(gfx::SurfaceFormat::YUV,
fwd->GetCompositorBackendType())
: true;
bool hasIntermediateBuffer = ComputeHasIntermediateBuffer(gfx::SurfaceFormat::YUV,
aAllocator->GetCompositorBackendType());
// Initialize the metadata with something, even if it will have to be rewritten
// afterwards since we don't know the dimensions of the texture at this point.
@ -175,12 +173,12 @@ BufferTextureData::CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
0, 0, 0, StereoMode::MONO,
hasIntermediateBuffer);
return CreateInternal(aAllocator, desc, gfx::BackendType::NONE, aBufferSize,
return CreateInternal(aAllocator->GetTextureForwarder(), desc, gfx::BackendType::NONE, aBufferSize,
aTextureFlags);
}
BufferTextureData*
BufferTextureData::CreateForYCbCr(ClientIPCAllocator* aAllocator,
BufferTextureData::CreateForYCbCr(KnowsCompositor* aAllocator,
gfx::IntSize aYSize,
gfx::IntSize aCbCrSize,
StereoMode aStereoMode,
@ -198,17 +196,16 @@ BufferTextureData::CreateForYCbCr(ClientIPCAllocator* aAllocator,
aCbCrSize.width, aCbCrSize.height,
yOffset, cbOffset, crOffset);
auto fwd = aAllocator ? aAllocator->AsCompositableForwarder() : nullptr;
bool hasIntermediateBuffer = fwd ? ComputeHasIntermediateBuffer(gfx::SurfaceFormat::YUV,
fwd->GetCompositorBackendType())
: true;
bool hasIntermediateBuffer = aAllocator ? ComputeHasIntermediateBuffer(gfx::SurfaceFormat::YUV,
aAllocator->GetCompositorBackendType())
: true;
YCbCrDescriptor descriptor = YCbCrDescriptor(aYSize, aCbCrSize, yOffset, cbOffset,
crOffset, aStereoMode,
hasIntermediateBuffer);
return CreateInternal(aAllocator, descriptor, gfx::BackendType::NONE, bufSize,
aTextureFlags);
return CreateInternal(aAllocator ? aAllocator->GetTextureForwarder() : nullptr, descriptor,
gfx::BackendType::NONE, bufSize, aTextureFlags);
}
void
@ -462,7 +459,7 @@ MemoryTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend, TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator)
LayersIPCChannel* aAllocator)
{
// Should have used CreateForYCbCr.
MOZ_ASSERT(aFormat != gfx::SurfaceFormat::YUV);
@ -482,10 +479,6 @@ MemoryTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
return nullptr;
}
// LAYERS_NONE must imply that we have no compositable forwarder
MOZ_ASSERT_IF(aLayersBackend == LayersBackend::LAYERS_NONE,
!aAllocator || !aAllocator->AsCompositableForwarder());
bool hasIntermediateBuffer = ComputeHasIntermediateBuffer(aFormat, aLayersBackend);
GfxMemoryImageReporter::DidAlloc(buf);
@ -496,7 +489,7 @@ MemoryTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
}
void
MemoryTextureData::Deallocate(ClientIPCAllocator*)
MemoryTextureData::Deallocate(LayersIPCChannel*)
{
MOZ_ASSERT(mBuffer);
GfxMemoryImageReporter::WillFree(mBuffer);
@ -505,15 +498,13 @@ MemoryTextureData::Deallocate(ClientIPCAllocator*)
}
TextureData*
MemoryTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
MemoryTextureData::CreateSimilar(LayersIPCChannel* aAllocator,
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags) const
{
auto fwd = aAllocator ? aAllocator->AsCompositableForwarder() : nullptr;
auto backend = fwd ? fwd->GetCompositorBackendType() : LayersBackend::LAYERS_NONE;
return MemoryTextureData::Create(GetSize(), GetFormat(), mMoz2DBackend,
backend, aFlags, aAllocFlags, aAllocator);
aLayersBackend, aFlags, aAllocFlags, aAllocator);
}
bool
@ -534,13 +525,13 @@ ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
gfx::BackendType aMoz2DBackend,
LayersBackend aLayersBackend, TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator)
LayersIPCChannel* aAllocator)
{
MOZ_ASSERT(aAllocator);
// Should have used CreateForYCbCr.
MOZ_ASSERT(aFormat != gfx::SurfaceFormat::YUV);
if (!aAllocator || !aAllocator->AsShmemAllocator()) {
if (!aAllocator) {
return nullptr;
}
@ -555,7 +546,7 @@ ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
}
mozilla::ipc::Shmem shm;
if (!aAllocator->AsShmemAllocator()->AllocUnsafeShmem(bufSize, OptimalShmemType(), &shm)) {
if (!aAllocator->AllocUnsafeShmem(bufSize, OptimalShmemType(), &shm)) {
return nullptr;
}
@ -564,10 +555,6 @@ ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
return nullptr;
}
// LAYERS_NONE must imply that we have no compositable forwarder
MOZ_ASSERT_IF(aLayersBackend == LayersBackend::LAYERS_NONE,
!aAllocator || !aAllocator->AsCompositableForwarder());
bool hasIntermediateBuffer = ComputeHasIntermediateBuffer(aFormat, aLayersBackend);
BufferDescriptor descriptor = RGBDescriptor(aSize, aFormat, hasIntermediateBuffer);
@ -578,21 +565,19 @@ ShmemTextureData::Create(gfx::IntSize aSize, gfx::SurfaceFormat aFormat,
}
TextureData*
ShmemTextureData::CreateSimilar(ClientIPCAllocator* aAllocator,
ShmemTextureData::CreateSimilar(LayersIPCChannel* aAllocator,
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags) const
{
auto fwd = aAllocator ? aAllocator->AsCompositableForwarder() : nullptr;
auto backend = fwd ? fwd->GetCompositorBackendType() : LayersBackend::LAYERS_NONE;
return ShmemTextureData::Create(GetSize(), GetFormat(), mMoz2DBackend,
backend, aFlags, aAllocFlags, aAllocator);
aLayersBackend, aFlags, aAllocFlags, aAllocator);
}
void
ShmemTextureData::Deallocate(ClientIPCAllocator* aAllocator)
ShmemTextureData::Deallocate(LayersIPCChannel* aAllocator)
{
aAllocator->AsShmemAllocator()->DeallocShmem(mShmem);
aAllocator->DeallocShmem(mShmem);
}
} // namespace

Просмотреть файл

@ -26,9 +26,9 @@ public:
LayersBackend aLayersBackend,
TextureFlags aFlags,
TextureAllocationFlags aAllocFlags,
ClientIPCAllocator* aAllocator);
LayersIPCChannel* aAllocator);
static BufferTextureData* CreateForYCbCr(ClientIPCAllocator* aAllocator,
static BufferTextureData* CreateForYCbCr(KnowsCompositor* aAllocator,
gfx::IntSize aYSize,
gfx::IntSize aCbCrSize,
StereoMode aStereoMode,
@ -37,7 +37,7 @@ public:
// It is generally better to use CreateForYCbCr instead.
// This creates a half-initialized texture since we don't know the sizes and
// offsets in the buffer.
static BufferTextureData* CreateForYCbCrWithBufferSize(ClientIPCAllocator* aAllocator,
static BufferTextureData* CreateForYCbCrWithBufferSize(KnowsCompositor* aAllocator,
int32_t aSize,
TextureFlags aTextureFlags);
@ -70,7 +70,7 @@ protected:
gfx::SurfaceFormat GetFormat() const;
static BufferTextureData* CreateInternal(ClientIPCAllocator* aAllocator,
static BufferTextureData* CreateInternal(LayersIPCChannel* aAllocator,
const BufferDescriptor& aDesc,
gfx::BackendType aMoz2DBackend,
int32_t aBufferSize,

Просмотреть файл

@ -53,7 +53,7 @@ D3D11ShareHandleImage::GetSize()
}
TextureClient*
D3D11ShareHandleImage::GetTextureClient(TextureForwarder* aForwarder)
D3D11ShareHandleImage::GetTextureClient(KnowsCompositor* aForwarder)
{
return mTextureClient;
}
@ -142,7 +142,7 @@ D3D11RecycleAllocator::Allocate(gfx::SurfaceFormat aFormat,
{
return CreateD3D11TextureClientWithDevice(aSize, aFormat,
aTextureFlags, aAllocFlags,
mDevice, mSurfaceAllocator);
mDevice, mSurfaceAllocator->GetTextureForwarder());
}
already_AddRefed<TextureClient>

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше