Merge m-c to autoland. a=merge

This commit is contained in:
Ryan VanderMeulen 2017-07-18 12:52:05 -04:00
Родитель 92464465b6 a83a4b6897
Коммит 84f63b9d2f
122 изменённых файлов: 22274 добавлений и 22654 удалений

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

@ -623,26 +623,31 @@ DocAccessibleParent::MaybeInitWindowEmulation()
tab->GetDocShellIsActive(&isActive);
}
IAccessibleHolder hWndAccHolder;
HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow());
HWND hWnd = nsWinUtils::CreateNativeWindow(kClassNameTabContent,
parentWnd, rect.x, rect.y,
rect.width, rect.height,
isActive);
if (hWnd) {
// Attach accessible document to the emulated native window
::SetPropW(hWnd, kPropNameDocAccParent, (HANDLE)this);
SetEmulatedWindowHandle(hWnd);
nsWinUtils::NativeWindowCreateProc onCreate([this](HWND aHwnd) -> void {
IAccessibleHolder hWndAccHolder;
::SetPropW(aHwnd, kPropNameDocAccParent, reinterpret_cast<HANDLE>(this));
SetEmulatedWindowHandle(aHwnd);
IAccessible* rawHWNDAcc = nullptr;
if (SUCCEEDED(::AccessibleObjectFromWindow(hWnd, OBJID_WINDOW,
if (SUCCEEDED(::AccessibleObjectFromWindow(aHwnd, OBJID_WINDOW,
IID_IAccessible,
(void**)&rawHWNDAcc))) {
hWndAccHolder.Set(IAccessibleHolder::COMPtrType(rawHWNDAcc));
}
}
Unused << SendEmulatedWindow(reinterpret_cast<uintptr_t>(mEmulatedWindowHandle),
hWndAccHolder);
Unused << SendEmulatedWindow(reinterpret_cast<uintptr_t>(mEmulatedWindowHandle),
hWndAccHolder);
});
HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow());
DebugOnly<HWND> hWnd = nsWinUtils::CreateNativeWindow(kClassNameTabContent,
parentWnd,
rect.x, rect.y,
rect.width, rect.height,
isActive, &onCreate);
MOZ_ASSERT(hWnd);
}
/**

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

@ -163,13 +163,16 @@ DocAccessibleWrap::DoInitialUpdate()
docShell->GetIsActive(&isActive);
}
RefPtr<DocAccessibleWrap> self(this);
nsWinUtils::NativeWindowCreateProc onCreate([self](HWND aHwnd) -> void {
::SetPropW(aHwnd, kPropNameDocAcc, reinterpret_cast<HANDLE>(self.get()));
});
HWND parentWnd = reinterpret_cast<HWND>(rootDocument->GetNativeWindow());
mHWND = nsWinUtils::CreateNativeWindow(kClassNameTabContent, parentWnd,
rect.x, rect.y,
rect.width, rect.height, isActive);
::SetPropW(static_cast<HWND>(mHWND), kPropNameDocAcc, (HANDLE)this);
rect.width, rect.height, isActive,
&onCreate);
} else {
DocAccessible* parentDocument = ParentDocument();
if (parentDocument)

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

@ -110,21 +110,17 @@ nsWinUtils::RegisterNativeWindow(LPCWSTR aWindowClass)
HWND
nsWinUtils::CreateNativeWindow(LPCWSTR aWindowClass, HWND aParentWnd,
int aX, int aY, int aWidth, int aHeight,
bool aIsActive)
bool aIsActive,
NativeWindowCreateProc* aOnCreateProc)
{
HWND hwnd = ::CreateWindowExW(WS_EX_TRANSPARENT, aWindowClass,
L"NetscapeDispatchWnd",
WS_CHILD | (aIsActive ? WS_VISIBLE : 0),
aX, aY, aWidth, aHeight,
aParentWnd,
nullptr,
GetModuleHandle(nullptr),
nullptr);
if (hwnd) {
// Mark this window so that ipc related code can identify it.
::SetPropW(hwnd, kPropNameTabContent, (HANDLE)1);
}
return hwnd;
return ::CreateWindowExW(WS_EX_TRANSPARENT, aWindowClass,
L"NetscapeDispatchWnd",
WS_CHILD | (aIsActive ? WS_VISIBLE : 0),
aX, aY, aWidth, aHeight,
aParentWnd,
nullptr,
GetModuleHandle(nullptr),
aOnCreateProc);
}
void
@ -149,6 +145,21 @@ WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
// message semantics.
switch (msg) {
case WM_CREATE:
{
// Mark this window so that ipc related code can identify it.
::SetPropW(hWnd, kPropNameTabContent, reinterpret_cast<HANDLE>(1));
auto createStruct = reinterpret_cast<CREATESTRUCT*>(lParam);
auto createProc = reinterpret_cast<nsWinUtils::NativeWindowCreateProc*>(
createStruct->lpCreateParams);
if (createProc && *createProc) {
(*createProc)(hWnd);
}
return 0;
}
case WM_GETOBJECT:
{
// Do explicit casting to make it working on 64bit systems (see bug 649236

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

@ -8,6 +8,7 @@
#ifndef nsWinUtils_h_
#define nsWinUtils_h_
#include <functional>
#include <windows.h>
#include "nsIDOMCSSStyleDeclaration.h"
@ -57,12 +58,30 @@ public:
*/
static void RegisterNativeWindow(LPCWSTR aWindowClass);
typedef std::function<void(HWND)> NativeWindowCreateProc;
/**
* Helper to create a window.
*
* NB: If additional setup needs to be done once the window has been created,
* you should do so via aOnCreateProc. Hooks will fire during the
* CreateNativeWindow call, thus triggering events in the AT.
* Using aOnCreateProc guarantees that your additional initialization will
* have completed prior to the AT receiving window creation events.
*
* For example:
*
* nsWinUtils::NativeWindowCreateProc onCreate([](HWND aHwnd) -> void {
* DoSomeAwesomeInitializationStuff(aHwnd);
* DoMoreAwesomeInitializationStuff(aHwnd);
* });
* HWND hwnd = nsWinUtils::CreateNativeWindow(..., &onCreate);
* // Doing further initialization work to hwnd on this line is too late!
*/
static HWND CreateNativeWindow(LPCWSTR aWindowClass, HWND aParentWnd,
int aX, int aY, int aWidth, int aHeight,
bool aIsActive);
bool aIsActive,
NativeWindowCreateProc* aOnCreateProc = nullptr);
/**
* Helper to show window.

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

@ -229,6 +229,7 @@ class BasePopup {
browser.setAttribute("contextmenu", "contentAreaContextMenu");
browser.setAttribute("autocompletepopup", "PopupAutoComplete");
browser.setAttribute("selectmenulist", "ContentSelectDropdown");
browser.setAttribute("selectmenuconstrained", "false");
browser.sameProcessAsFrameLoader = this.extension.groupFrameLoader;
if (this.extension.remote) {

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

@ -8,6 +8,7 @@ support-files =
[browser_translation_bing.js]
[browser_translation_yandex.js]
skip-if = os == 'win' && !e10s # bug 1374446
[browser_translation_telemetry.js]
[browser_translation_infobar.js]
[browser_translation_exceptions.js]

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

@ -1,5 +1,5 @@
This is the PDF.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 1.8.532
Current extension version is: 1.8.557
Taken from upstream commit: 95093a52
Taken from upstream commit: 4a74cc41

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

@ -3693,8 +3693,8 @@ var _UnsupportedManager = function UnsupportedManagerClosure() {
}();
var version, build;
{
exports.version = version = '1.8.532';
exports.build = build = '95093a52';
exports.version = version = '1.8.557';
exports.build = build = '4a74cc41';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -4743,8 +4743,8 @@ if (!_util.globalScope.PDFJS) {
}
var PDFJS = _util.globalScope.PDFJS;
{
PDFJS.version = '1.8.532';
PDFJS.build = '95093a52';
PDFJS.version = '1.8.557';
PDFJS.build = '4a74cc41';
}
PDFJS.pdfBug = false;
if (PDFJS.verbosity !== undefined) {
@ -10072,8 +10072,8 @@ exports.TilingPattern = TilingPattern;
"use strict";
var pdfjsVersion = '1.8.532';
var pdfjsBuild = '95093a52';
var pdfjsVersion = '1.8.557';
var pdfjsBuild = '4a74cc41';
var pdfjsSharedUtil = __w_pdfjs_require__(0);
var pdfjsDisplayGlobal = __w_pdfjs_require__(8);
var pdfjsDisplayAPI = __w_pdfjs_require__(3);

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

@ -39804,8 +39804,8 @@ exports.Type1Parser = Type1Parser;
"use strict";
var pdfjsVersion = '1.8.532';
var pdfjsBuild = '95093a52';
var pdfjsVersion = '1.8.557';
var pdfjsBuild = '4a74cc41';
var pdfjsCoreWorker = __w_pdfjs_require__(17);
;
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;

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

@ -215,8 +215,8 @@ See https://github.com/adobe-type-tools/cmap-resources
<select id="scaleSelect" title="Zoom" tabindex="23" data-l10n-id="zoom">
<option id="pageAutoOption" title="" value="auto" selected="selected" data-l10n-id="page_scale_auto">Automatic Zoom</option>
<option id="pageActualOption" title="" value="page-actual" data-l10n-id="page_scale_actual">Actual Size</option>
<option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Fit Page</option>
<option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Full Width</option>
<option id="pageFitOption" title="" value="page-fit" data-l10n-id="page_scale_fit">Page Fit</option>
<option id="pageWidthOption" title="" value="page-width" data-l10n-id="page_scale_width">Page Width</option>
<option id="customScaleOption" title="" value="custom" disabled="disabled" hidden="true"></option>
<option title="" value="0.5" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 50 }'>50%</option>
<option title="" value="0.75" data-l10n-id="page_scale_percent" data-l10n-args='{ "scale": 75 }'>75%</option>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -65,23 +65,6 @@ module.exports = createClass({
),
dom.ul(
{},
dom.li(
{
className: "grid-settings-item",
},
dom.label(
{},
dom.input(
{
id: "grid-setting-extend-grid-lines",
type: "checkbox",
checked: highlighterSettings.showInfiniteLines,
onChange: this.onShowInfiniteLinesCheckboxClick,
}
),
getStr("layout.extendGridLinesInfinitely")
)
),
dom.li(
{
className: "grid-settings-item",
@ -96,7 +79,7 @@ module.exports = createClass({
onChange: this.onShowGridLineNumbersCheckboxClick,
}
),
getStr("layout.displayNumbersOnLines2")
getStr("layout.displayLineNumbers")
)
),
dom.li(
@ -113,7 +96,24 @@ module.exports = createClass({
onChange: this.onShowGridAreasCheckboxClick,
}
),
getStr("layout.displayGridAreas")
getStr("layout.displayAreaNames")
)
),
dom.li(
{
className: "grid-settings-item",
},
dom.label(
{},
dom.input(
{
id: "grid-setting-extend-grid-lines",
type: "checkbox",
checked: highlighterSettings.showInfiniteLines,
onChange: this.onShowInfiniteLinesCheckboxClick,
}
),
getStr("layout.extendLinesInfinitely")
)
)
)

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

@ -10,17 +10,17 @@
layout.cannotShowGridOutline=Cannot show outline for this grid
layout.cannotShowGridOutline.title=The selected grids outline cannot effectively fit inside the layout panel for it to be usable.
# LOCALIZATION NOTE (layout.displayGridAreas): Label of the display grid areas setting
# LOCALIZATION NOTE (layout.displayAreaNames): Label of the display area names setting
# option in the CSS Grid pane.
layout.displayGridAreas=Display grid areas
layout.displayAreaNames=Display area names
# LOCALIZATION NOTE (layout.displayNumbersOnLines2): Label of the display numbers on lines
# LOCALIZATION NOTE (layout.displayLineNumbers): Label of the display line numbers
# setting option in the CSS Grid pane.
layout.displayNumbersOnLines2=Display line numbers
layout.displayLineNumbers=Display line numbers
# LOCALIZATION NOTE (layout.extendGridLinesInfinitely): Label of the extend grid lines
# LOCALIZATION NOTE (layout.extendLinesInfinitely): Label of the extend lines
# infinitely setting option in the CSS Grid pane.
layout.extendGridLinesInfinitely=Extend grid lines infinitely
layout.extendLinesInfinitely=Extend lines infinitely
# LOCALIZATION NOTE (layout.header): The accordion header for the CSS Grid pane.
layout.header=Grid

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

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bug 1379762</title>
</head>
<img srcset> <!-- This tries to add load blockers during bfcache restoration -->
<script>
onunload = null; // enable bfcache
opener.is(opener.testCount, 0,
"We should only run once; otherwise the loadCount variable makes no sense");
var loadCount = 0;
onpageshow = function() {
++opener.testCount;
if (opener.testCount == 1) {
// Navigate forward and then back.
setTimeout(function() { location = "goback.html"; }, 0);
} else if (opener.testCount == 2) {
// Do this async so our load event gets a chance to fire if it plans to
// do it.
setTimeout(function() {
opener.nextTest();
window.close();
});
}
};
onload = function() {
++loadCount;
opener.is(loadCount, 1, "Should only get one onload");
}
</script>
</html>

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

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bug 1379762</title>
</head>
<script type="text/just-data">
onunload = null; // enable bfcache
++opener.testCount;
onpageshow = function(e) {
opener.ok(!e.persisted, "Pageshow should not be coming from bfcache " + opener.testCount);
}
if (opener.testCount == 1) {
onload = function () {
setTimeout(function() {
document.write(testScript);
}, 0);
}
} else if (opener.testCount == 2) {
// Do this async, just in case.
setTimeout(function() {
history.back();
}, 0);
} else if (opener.testCount == 3) {
// Do this async, just in case.
setTimeout(function() {
history.forward();
}, 0);
} else if (opener.testCount == 4) {
onload = function() {
opener.nextTest();
window.close();
}
}
</script>
<script>
var data = document.querySelector("script[type='text/just-data']").textContent;
// Store the string that does all out work in a global variable, so we can
// get at it later.
var testScript = "<script>" + data + "</" + "script>";
document.write(testScript);
</script>
</html>

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

@ -64,6 +64,7 @@ skip-if = (toolkit == 'android') || (!debug && (os == 'mac' || os == 'win')) # B
skip-if = (toolkit == 'android') || (debug && e10s) #too slow on Android 4.3 aws only; bug 1030403; bug 1263213 for debug e10s
[test_sessionhistory.html]
skip-if = toolkit == 'android' #RANDOM
support-files = file_bug1379762-1.html file_bug1379762-2.html
[test_sibling-matching-parent.html]
[test_sibling-off-domain.html]
[test_triggeringprincipal_frame_nav.html]

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

@ -33,6 +33,8 @@ var testFiles =
"file_scrollRestoration.html",
"file_bug1300461.html",
"file_bug1326251.html",
"file_bug1379762-1.html",
"file_bug1379762-2.html",
];
var testCount = 0; // Used by the test files.

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

@ -8804,8 +8804,11 @@ nsDocument::BlockOnload()
}
// If mScriptGlobalObject is null, we shouldn't be messing with the loadgroup
// -- it's not ours.
if (mOnloadBlockCount == 0 && mScriptGlobalObject) {
// -- it's not ours. Also, if we're already in the COMPLETE state, that means
// we already had our load event, conceptually, so there's no more need to
// mess about with the load blocker.
if (mOnloadBlockCount == 0 && mScriptGlobalObject &&
GetReadyStateEnum() != READYSTATE_COMPLETE) {
if (!nsContentUtils::IsSafeToRunScript()) {
// Because AddRequest may lead to OnStateChange calls in chrome,
// block onload only when there are no script blockers.

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

@ -24,16 +24,23 @@ function runTests()
{
var iframe = document.getElementById("iframe");
iframe.src="data:text/html,hello";
iframe.onload = function() {
ok(SpecialPowers.wrap(iframe).contentDocument.nodePrincipal.isNullPrincipal,
"iframe should have NullPrincipal.");
}
let p1 = new Promise((resolve, reject) => {
iframe.onload = function() {
ok(SpecialPowers.wrap(iframe).contentDocument.nodePrincipal.isNullPrincipal,
"iframe should have NullPrincipal.");
resolve();
}
});
var iframe1 = document.getElementById("iframe1");
iframe1.src="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%18%00%00%00%18%02%03%00%00%00%9D%19%D5k%00%00%00%04gAMA%00%00%B1%8F%0B%FCa%05%00%00%00%0CPLTE%FF%FF%FF%FF%FF%FF%F7%DC%13%00%00%00%03%80%01X%00%00%00%01tRNS%08N%3DPT%00%00%00%01bKGD%00%88%05%1DH%00%00%00%09pHYs%00%00%0B%11%00%00%0B%11%01%7Fd_%91%00%00%00%07tIME%07%D2%05%0C%14%0C%0D%D8%3F%1FQ%00%00%00%5CIDATx%9C%7D%8E%CB%09%C0%20%10D%07r%B7%20%2F%E9wV0%15h%EA%D9%12D4%BB%C1x%CC%5C%1E%0C%CC%07%C0%9C0%9Dd7()%C0A%D3%8D%E0%B8%10%1DiCHM%D0%AC%D2d%C3M%F1%B4%E7%FF%10%0BY%AC%25%93%CD%CBF%B5%B2%C0%3Alh%CD%AE%13%DF%A5%F7%E0%03byW%09A%B4%F3%E2%00%00%00%00IEND%AEB%60%82";
iframe1.onload = function() {
ok(SpecialPowers.wrap(iframe1).contentDocument.nodePrincipal.isNullPrincipal,
"iframe1 should have NullPrincipal.");
}
let p2 = new Promise((resolve, reject) => {
iframe1.onload = function() {
ok(SpecialPowers.wrap(iframe1).contentDocument.nodePrincipal.isNullPrincipal,
"iframe1 should have NullPrincipal.");
resolve();
}
});
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
@ -42,7 +49,7 @@ function runTests()
var data = canvas.toDataURL('image/png');
var img = new Image();
img.src = data;
imgListener(img).then(() => {
let p3 = imgListener(img).then(() => {
dump("img onload\n");
ctx.drawImage(img, 0, 0);
return new Promise((resolve, reject) => {
@ -79,6 +86,9 @@ function runTests()
return document.fonts.ready;
}).then(() => {
is(document.fonts.size, 1, "should load data:font");
});
Promise.all([p1, p2, p3]).then(() => {
SimpleTest.finish();
}).catch((e) => {
ok(false, "throwing " + e);

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

@ -931,6 +931,8 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
mResetLayer = true;
mBackbufferNeedsClear = true;
gl->ResetSyncCallCount("Existing WebGLContext resized.");
return NS_OK;
}
@ -1145,6 +1147,8 @@ WebGLContext::SetDimensions(int32_t signedWidth, int32_t signedHeight)
reporter.SetSuccessful();
failureId = NS_LITERAL_CSTRING("SUCCESS");
gl->ResetSyncCallCount("WebGLContext Initialization");
return NS_OK;
}
@ -1597,6 +1601,7 @@ WebGLContext::OnEndOfFrame() const
mDataAllocGLCallCount);
}
mDataAllocGLCallCount = 0;
gl->ResetSyncCallCount("WebGLContext PresentScreenBuffer");
}
// For an overview of how WebGL compositing works, see:

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

@ -119,9 +119,9 @@ static NPNetscapeFuncs sBrowserFuncs = {
_geturl,
_posturl,
_requestread,
_newstream,
_write,
_destroystream,
nullptr,
nullptr,
nullptr,
_status,
_useragent,
_memalloc,
@ -776,127 +776,6 @@ _posturl(NPP npp, const char *relativeURL, const char *target,
len, buf);
}
NPError
_newstream(NPP npp, NPMIMEType type, const char* target, NPStream* *result)
{
if (!NS_IsMainThread()) {
NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("NPN_newstream called from the wrong thread\n"));
return NPERR_INVALID_PARAM;
}
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
("NPN_NewStream: npp=%p, type=%s, target=%s\n", (void*)npp,
(const char *)type, target));
NPError err = NPERR_INVALID_INSTANCE_ERROR;
if (npp && npp->ndata) {
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance*)npp->ndata;
PluginDestructionGuard guard(inst);
nsCOMPtr<nsIOutputStream> stream;
if (NS_SUCCEEDED(inst->NewStreamFromPlugin((const char*) type, target,
getter_AddRefs(stream)))) {
auto* wrapper = new nsNPAPIStreamWrapper(stream, nullptr);
if (wrapper) {
(*result) = &wrapper->mNPStream;
err = NPERR_NO_ERROR;
} else {
err = NPERR_OUT_OF_MEMORY_ERROR;
}
} else {
err = NPERR_GENERIC_ERROR;
}
}
return err;
}
int32_t
_write(NPP npp, NPStream *pstream, int32_t len, void *buffer)
{
if (!NS_IsMainThread()) {
NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("NPN_write called from the wrong thread\n"));
return 0;
}
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
("NPN_Write: npp=%p, url=%s, len=%d, buffer=%s\n", (void*)npp,
pstream->url, len, (char*)buffer));
// negative return indicates failure to the plugin
if (!npp)
return -1;
PluginDestructionGuard guard(npp);
nsNPAPIStreamWrapper* wrapper = static_cast<nsNPAPIStreamWrapper*>(pstream->ndata);
if (!wrapper) {
return -1;
}
nsIOutputStream* stream = wrapper->GetOutputStream();
if (!stream) {
return -1;
}
uint32_t count = 0;
nsresult rv = stream->Write((char *)buffer, len, &count);
if (NS_FAILED(rv)) {
return -1;
}
return (int32_t)count;
}
NPError
_destroystream(NPP npp, NPStream *pstream, NPError reason)
{
if (!NS_IsMainThread()) {
NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("NPN_destroystream called from the wrong thread\n"));
return NPERR_INVALID_PARAM;
}
NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
("NPN_DestroyStream: npp=%p, url=%s, reason=%d\n", (void*)npp,
pstream->url, (int)reason));
if (!npp)
return NPERR_INVALID_INSTANCE_ERROR;
PluginDestructionGuard guard(npp);
nsNPAPIStreamWrapper *streamWrapper = static_cast<nsNPAPIStreamWrapper*>(pstream->ndata);
if (!streamWrapper) {
return NPERR_INVALID_PARAM;
}
nsNPAPIPluginStreamListener *listener = streamWrapper->GetStreamListener();
if (listener) {
// This type of stream is going from the browser to the plugin. It's either the
// initial src/data stream or another stream resulting from NPN_GetURL* or
// NPN_PostURL*.
//
// Calling OnStopBinding on the listener may cause it to be deleted due to the
// releasing of its last references.
listener->OnStopBinding(nullptr, NS_BINDING_ABORTED);
} else {
// This type of stream (NPStream) was created via NPN_NewStream. The plugin holds
// the reference until it is to be deleted here. Deleting the wrapper will
// release the wrapped nsIOutputStream.
//
// The NPStream the plugin references should always be a sub-object of its own
// 'ndata', which is our nsNPAPIStramWrapper. See bug 548441.
NS_ASSERTION((char*)streamWrapper <= (char*)pstream &&
((char*)pstream) + sizeof(*pstream)
<= ((char*)streamWrapper) + sizeof(*streamWrapper),
"pstream is not a subobject of wrapper");
delete streamWrapper;
}
// 'listener' and/or 'streamWrapper' may be invalid (deleted) at this point. Don't
// touch them again!
return NPERR_NO_ERROR;
}
void
_status(NPP npp, const char *message)
{

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

@ -271,15 +271,6 @@ NPError
_posturl(NPP npp, const char* relativeURL, const char *target, uint32_t len,
const char *buf, NPBool file);
NPError
_newstream(NPP npp, NPMIMEType type, const char* window, NPStream** pstream);
int32_t
_write(NPP npp, NPStream *pstream, int32_t len, void *buffer);
NPError
_destroystream(NPP npp, NPStream *pstream, NPError reason);
void
_status(NPP npp, const char *message);

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

@ -511,14 +511,6 @@ nsresult nsNPAPIPluginInstance::SetWindow(NPWindow* window)
return NS_OK;
}
nsresult
nsNPAPIPluginInstance::NewStreamFromPlugin(const char* type, const char* target,
nsIOutputStream* *result)
{
nsPluginStreamToFile* stream = new nsPluginStreamToFile(target, mOwner);
return stream->QueryInterface(kIOutputStreamIID, (void**)result);
}
nsresult
nsNPAPIPluginInstance::NewStreamListener(const char* aURL, void* notifyData,
nsNPAPIPluginStreamListener** listener)

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

@ -34,98 +34,7 @@ nsNPAPIStreamWrapper::~nsNPAPIStreamWrapper()
}
}
NS_IMPL_ISUPPORTS(nsPluginStreamToFile, nsIOutputStream)
nsPluginStreamToFile::nsPluginStreamToFile(const char* target,
nsIPluginInstanceOwner* owner)
: mTarget(PL_strdup(target)),
mOwner(owner)
{
nsresult rv;
nsCOMPtr<nsIFile> pluginTmp;
rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(pluginTmp));
if (NS_FAILED(rv)) return;
mTempFile = do_QueryInterface(pluginTmp, &rv);
if (NS_FAILED(rv)) return;
// need to create a file with a unique name - use target as the basis
rv = mTempFile->AppendNative(nsDependentCString(target));
if (NS_FAILED(rv)) return;
// Yes, make it unique.
rv = mTempFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0700);
if (NS_FAILED(rv)) return;
// create the file
rv = NS_NewLocalFileOutputStream(getter_AddRefs(mOutputStream), mTempFile, -1, 00600);
if (NS_FAILED(rv))
return;
// construct the URL we'll use later in calls to GetURL()
NS_GetURLSpecFromFile(mTempFile, mFileURL);
#ifdef DEBUG
printf("File URL = %s\n", mFileURL.get());
#endif
}
nsPluginStreamToFile::~nsPluginStreamToFile()
{
// should we be deleting mTempFile here?
if (nullptr != mTarget)
PL_strfree(mTarget);
}
NS_IMETHODIMP
nsPluginStreamToFile::Flush()
{
return NS_OK;
}
NS_IMETHODIMP
nsPluginStreamToFile::Write(const char* aBuf, uint32_t aCount,
uint32_t *aWriteCount)
{
mOutputStream->Write(aBuf, aCount, aWriteCount);
mOutputStream->Flush();
mOwner->GetURL(mFileURL.get(), mTarget, nullptr, nullptr, 0, false);
return NS_OK;
}
NS_IMETHODIMP
nsPluginStreamToFile::WriteFrom(nsIInputStream *inStr, uint32_t count,
uint32_t *_retval)
{
NS_NOTREACHED("WriteFrom");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPluginStreamToFile::WriteSegments(nsReadSegmentFun reader, void * closure,
uint32_t count, uint32_t *_retval)
{
NS_NOTREACHED("WriteSegments");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
nsPluginStreamToFile::IsNonBlocking(bool *aNonBlocking)
{
*aNonBlocking = false;
return NS_OK;
}
NS_IMETHODIMP
nsPluginStreamToFile::Close(void)
{
mOutputStream->Close();
mOwner->GetURL(mFileURL.get(), mTarget, nullptr, nullptr, 0, false);
return NS_OK;
}
// nsNPAPIPluginStreamListener Methods
NS_IMPL_ISUPPORTS(nsNPAPIPluginStreamListener,
nsITimerCallback, nsIHTTPHeaderListener)

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

@ -40,25 +40,6 @@ protected:
nsNPAPIPluginStreamListener* mStreamListener; // only valid if browser initiated
};
// Used to handle NPN_NewStream() - writes the stream as received by the plugin
// to a file and at completion (NPN_DestroyStream), tells the browser to load it into
// a plugin-specified target
class nsPluginStreamToFile : public nsIOutputStream
{
public:
nsPluginStreamToFile(const char* target, nsIPluginInstanceOwner* owner);
NS_DECL_ISUPPORTS
NS_DECL_NSIOUTPUTSTREAM
protected:
virtual ~nsPluginStreamToFile();
char* mTarget;
nsCString mFileURL;
nsCOMPtr<nsIFile> mTempFile;
nsCOMPtr<nsIOutputStream> mOutputStream;
nsIPluginInstanceOwner* mOwner;
};
class nsNPAPIPluginStreamListener : public nsITimerCallback,
public nsIHTTPHeaderListener
{

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

@ -177,16 +177,6 @@ BrowserStreamChild::NPN_RequestRead(NPByteRange* aRangeList)
return result;
}
void
BrowserStreamChild::NPN_DestroyStream(NPReason reason)
{
mStreamStatus = reason;
if (ALIVE == mState)
SendNPN_DestroyStream(reason);
EnsureDeliveryPending();
}
void
BrowserStreamChild::EnsureDeliveryPending()
{
@ -275,7 +265,10 @@ BrowserStreamChild::DeliverPendingData()
if (0 == r)
return true;
if (r < 0) { // error condition
NPN_DestroyStream(NPRES_NETWORK_ERR);
mStreamStatus = NPRES_NETWORK_ERR;
// Set up stream destruction
EnsureDeliveryPending();
return false;
}
mPendingData[0].curpos += r;

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

@ -54,7 +54,6 @@ public:
}
NPError NPN_RequestRead(NPByteRange* aRangeList);
void NPN_DestroyStream(NPReason reason);
void NotifyPending() {
NS_ASSERTION(!mNotifyPending, "Pending twice?");
@ -85,7 +84,6 @@ public:
private:
friend class StreamNotifyChild;
using PBrowserStreamChild::SendNPN_DestroyStream;
/**
* Post an event to ensure delivery of pending data/destroy/urlnotify events
@ -116,7 +114,7 @@ private:
/**
* The plugin's notion of whether a stream has been "closed" (no more
* data delivery) differs from the plugin host due to asynchronous delivery
* of data and NPN_DestroyStream. While the plugin-visible stream is open,
* of data and stream destruction. While the plugin-visible stream is open,
* mStreamStatus should be kStreamOpen (-1). mStreamStatus will be a
* failure code if either the parent or child indicates stream failure.
*/

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

@ -85,25 +85,6 @@ BrowserStreamParent::AnswerNPN_RequestRead(const IPCByteRanges& ranges,
return IPC_OK();
}
mozilla::ipc::IPCResult
BrowserStreamParent::RecvNPN_DestroyStream(const NPReason& reason)
{
switch (mState) {
case ALIVE:
break;
case DYING:
return IPC_OK();
default:
NS_ERROR("Unexpected state");
return IPC_FAIL_NO_REASON(this);
}
mNPP->mNPNIface->destroystream(mNPP->mNPP, mStream, reason);
return IPC_OK();
}
void
BrowserStreamParent::NPP_DestroyStream(NPReason reason)
{

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

@ -33,8 +33,6 @@ public:
virtual mozilla::ipc::IPCResult AnswerNPN_RequestRead(const IPCByteRanges& ranges,
NPError* result) override;
virtual mozilla::ipc::IPCResult RecvNPN_DestroyStream(const NPReason& reason) override;
virtual mozilla::ipc::IPCResult RecvStreamDestroyed() override;
int32_t WriteReady();

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

@ -38,7 +38,6 @@ child:
parent:
intr NPN_RequestRead(IPCByteRanges ranges)
returns (NPError result);
async NPN_DestroyStream(NPReason reason);
async StreamDestroyed();
/*

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

@ -7,7 +7,6 @@ include protocol PPluginBackgroundDestroyer;
include protocol PPluginModule;
include protocol PPluginScriptableObject;
include protocol PBrowserStream;
include protocol PPluginStream;
include protocol PStreamNotify;
include protocol PPluginSurface;
@ -68,7 +67,6 @@ intr protocol PPluginInstance
manages PPluginBackgroundDestroyer;
manages PPluginScriptableObject;
manages PBrowserStream;
manages PPluginStream;
manages PStreamNotify;
manages PPluginSurface;
@ -290,12 +288,6 @@ child:
returns (NPError rv,
uint16_t stype);
parent:
/* NPN_NewStream */
intr PPluginStream(nsCString mimeType,
nsCString target)
returns (NPError result);
parent:
intr PluginFocusChange(bool gotFocus);

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

@ -1,37 +0,0 @@
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
include protocol PPluginInstance;
using mozilla::plugins::Buffer from "mozilla/plugins/PluginMessageUtils.h";
using NPError from "npapi.h";
using NPReason from "npapi.h";
namespace mozilla {
namespace plugins {
/**
* PPluginStream represents an NPStream sent from the plugin to the browser.
*/
intr protocol PPluginStream
{
manager PPluginInstance;
parent:
intr NPN_Write(Buffer data) returns (int32_t written);
both:
/**
* ~PPluginStream is for both NPN_DestroyStream and NPP_DestroyStream.
* @param artificial True when the stream is closed as a by-product of
* some other call (such as a failure in NPN_Write).
*/
intr __delete__(NPReason reason, bool artificial);
};
} // namespace plugins
} // namespace mozilla

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

@ -8,7 +8,6 @@
#include "PluginInstanceChild.h"
#include "PluginModuleChild.h"
#include "BrowserStreamChild.h"
#include "PluginStreamChild.h"
#include "StreamNotifyChild.h"
#include "PluginProcessChild.h"
#include "gfxASurface.h"
@ -2529,22 +2528,6 @@ PluginInstanceChild::DeallocPBrowserStreamChild(PBrowserStreamChild* stream)
return true;
}
PPluginStreamChild*
PluginInstanceChild::AllocPPluginStreamChild(const nsCString& mimeType,
const nsCString& target,
NPError* result)
{
MOZ_CRASH("not callable");
return nullptr;
}
bool
PluginInstanceChild::DeallocPPluginStreamChild(PPluginStreamChild* stream)
{
AssertPluginThread();
delete stream;
return true;
}
PStreamNotifyChild*
PluginInstanceChild::AllocPStreamNotifyChild(const nsCString& url,
@ -2660,28 +2643,6 @@ PluginInstanceChild::GetActorForNPObject(NPObject* aObject)
return actor;
}
NPError
PluginInstanceChild::NPN_NewStream(NPMIMEType aMIMEType, const char* aWindow,
NPStream** aStream)
{
AssertPluginThread();
AutoStackHelper guard(this);
auto* ps = new PluginStreamChild();
NPError result;
CallPPluginStreamConstructor(ps, nsDependentCString(aMIMEType),
NullableString(aWindow), &result);
if (NPERR_NO_ERROR != result) {
*aStream = nullptr;
PPluginStreamChild::Call__delete__(ps, NPERR_GENERIC_ERROR, true);
return result;
}
*aStream = &ps->mStream;
return NPERR_NO_ERROR;
}
void
PluginInstanceChild::NPN_URLRedirectResponse(void* notifyData, NPBool allow)
{

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

@ -175,14 +175,6 @@ protected:
virtual bool
DeallocPBrowserStreamChild(PBrowserStreamChild* stream) override;
virtual PPluginStreamChild*
AllocPPluginStreamChild(const nsCString& mimeType,
const nsCString& target,
NPError* result) override;
virtual bool
DeallocPPluginStreamChild(PPluginStreamChild* stream) override;
virtual PStreamNotifyChild*
AllocPStreamNotifyChild(const nsCString& url, const nsCString& target,
const bool& post, const nsCString& buffer,

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

@ -14,7 +14,6 @@
#include "BrowserStreamParent.h"
#include "PluginBackgroundDestroyer.h"
#include "PluginModuleParent.h"
#include "PluginStreamParent.h"
#include "StreamNotifyParent.h"
#include "npfunctions.h"
#include "nsAutoPtr.h"
@ -241,20 +240,6 @@ PluginInstanceParent::DeallocPBrowserStreamParent(PBrowserStreamParent* stream)
return true;
}
PPluginStreamParent*
PluginInstanceParent::AllocPPluginStreamParent(const nsCString& mimeType,
const nsCString& target,
NPError* result)
{
return new PluginStreamParent(this, mimeType, target, result);
}
bool
PluginInstanceParent::DeallocPPluginStreamParent(PPluginStreamParent* stream)
{
delete stream;
return true;
}
mozilla::ipc::IPCResult
PluginInstanceParent::AnswerNPN_GetValue_NPNVnetscapeWindow(NativeWindowHandle* value,
@ -1790,24 +1775,13 @@ PluginInstanceParent::NPP_DestroyStream(NPStream* stream, NPReason reason)
// returns an error code.
return NPERR_NO_ERROR;
}
if (s->IsBrowserStream()) {
BrowserStreamParent* sp =
static_cast<BrowserStreamParent*>(s);
if (sp->mNPP != this)
MOZ_CRASH("Mismatched plugin data");
sp->NPP_DestroyStream(reason);
return NPERR_NO_ERROR;
}
else {
PluginStreamParent* sp =
static_cast<PluginStreamParent*>(s);
if (sp->mInstance != this)
MOZ_CRASH("Mismatched plugin data");
return PPluginStreamParent::Call__delete__(sp, reason, false) ?
NPERR_NO_ERROR : NPERR_GENERIC_ERROR;
}
MOZ_ASSERT(s->IsBrowserStream());
BrowserStreamParent* sp =
static_cast<BrowserStreamParent*>(s);
if (sp->mNPP != this)
MOZ_CRASH("Mismatched plugin data");
sp->NPP_DestroyStream(reason);
return NPERR_NO_ERROR;
}
void

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

@ -45,7 +45,6 @@ class PluginInstanceParent : public PPluginInstanceParent
{
friend class PluginModuleParent;
friend class BrowserStreamParent;
friend class PluginStreamParent;
friend class StreamNotifyParent;
#if defined(XP_WIN)
@ -90,13 +89,6 @@ public:
virtual bool
DeallocPBrowserStreamParent(PBrowserStreamParent* stream) override;
virtual PPluginStreamParent*
AllocPPluginStreamParent(const nsCString& mimeType,
const nsCString& target,
NPError* result) override;
virtual bool
DeallocPPluginStreamParent(PPluginStreamParent* stream) override;
virtual mozilla::ipc::IPCResult
AnswerNPN_GetValue_NPNVnetscapeWindow(NativeWindowHandle* value,
NPError* result) override;

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

@ -31,7 +31,6 @@
#include "mozilla/plugins/PluginInstanceChild.h"
#include "mozilla/plugins/StreamNotifyChild.h"
#include "mozilla/plugins/BrowserStreamChild.h"
#include "mozilla/plugins/PluginStreamChild.h"
#include "mozilla/Sprintf.h"
#include "mozilla/Unused.h"
@ -841,15 +840,6 @@ static NPError
_posturl(NPP aNPP, const char* relativeURL, const char *target, uint32_t len,
const char *buf, NPBool file);
static NPError
_newstream(NPP aNPP, NPMIMEType type, const char* window, NPStream** pstream);
static int32_t
_write(NPP aNPP, NPStream *pstream, int32_t len, void *buffer);
static NPError
_destroystream(NPP aNPP, NPStream *pstream, NPError reason);
static void
_status(NPP aNPP, const char *message);
@ -984,9 +974,9 @@ const NPNetscapeFuncs PluginModuleChild::sBrowserFuncs = {
mozilla::plugins::child::_geturl,
mozilla::plugins::child::_posturl,
mozilla::plugins::child::_requestread,
mozilla::plugins::child::_newstream,
mozilla::plugins::child::_write,
mozilla::plugins::child::_destroystream,
nullptr,
nullptr,
nullptr,
mozilla::plugins::child::_status,
mozilla::plugins::child::_useragent,
mozilla::plugins::child::_memalloc,
@ -1237,55 +1227,6 @@ _posturl(NPP aNPP,
return err;
}
NPError
_newstream(NPP aNPP,
NPMIMEType aMIMEType,
const char* aWindow,
NPStream** aStream)
{
PLUGIN_LOG_DEBUG_FUNCTION;
ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
return InstCast(aNPP)->NPN_NewStream(aMIMEType, aWindow, aStream);
}
int32_t
_write(NPP aNPP,
NPStream* aStream,
int32_t aLength,
void* aBuffer)
{
PLUGIN_LOG_DEBUG_FUNCTION;
ENSURE_PLUGIN_THREAD(0);
PluginStreamChild* ps =
static_cast<PluginStreamChild*>(static_cast<AStream*>(aStream->ndata));
ps->EnsureCorrectInstance(InstCast(aNPP));
ps->EnsureCorrectStream(aStream);
return ps->NPN_Write(aLength, aBuffer);
}
NPError
_destroystream(NPP aNPP,
NPStream* aStream,
NPError aReason)
{
PLUGIN_LOG_DEBUG_FUNCTION;
ENSURE_PLUGIN_THREAD(NPERR_INVALID_PARAM);
PluginInstanceChild* p = InstCast(aNPP);
AStream* s = static_cast<AStream*>(aStream->ndata);
if (s->IsBrowserStream()) {
BrowserStreamChild* bs = static_cast<BrowserStreamChild*>(s);
bs->EnsureCorrectInstance(p);
bs->NPN_DestroyStream(aReason);
}
else {
PluginStreamChild* ps = static_cast<PluginStreamChild*>(s);
ps->EnsureCorrectInstance(p);
PPluginStreamChild::Call__delete__(ps, aReason, false);
}
return NPERR_NO_ERROR;
}
void
_status(NPP aNPP,

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

@ -949,11 +949,6 @@ PluginModuleChromeParent::GetManagingInstance(mozilla::ipc::IProtocol* aProtocol
static_cast<PBrowserStreamParent*>(aProtocol);
return static_cast<PluginInstanceParent*>(actor->Manager());
}
case PPluginStreamMsgStart: {
PPluginStreamParent* actor =
static_cast<PPluginStreamParent*>(aProtocol);
return static_cast<PluginInstanceParent*>(actor->Manager());
}
case PStreamNotifyMsgStart: {
PStreamNotifyParent* actor =
static_cast<PStreamNotifyParent*>(aProtocol);

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

@ -1,64 +0,0 @@
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "PluginStreamChild.h"
#include "mozilla/plugins/PluginInstanceChild.h"
namespace mozilla {
namespace plugins {
PluginStreamChild::PluginStreamChild()
: mClosed(false)
{
memset(&mStream, 0, sizeof(mStream));
mStream.ndata = static_cast<AStream*>(this);
}
mozilla::ipc::IPCResult
PluginStreamChild::Answer__delete__(const NPReason& reason,
const bool& artificial)
{
AssertPluginThread();
if (!artificial)
NPP_DestroyStream(reason);
return IPC_OK();
}
int32_t
PluginStreamChild::NPN_Write(int32_t length, void* buffer)
{
AssertPluginThread();
int32_t written = 0;
CallNPN_Write(nsCString(static_cast<char*>(buffer), length),
&written);
if (written < 0)
PPluginStreamChild::Call__delete__(this, NPERR_GENERIC_ERROR, true);
// careful after here! |this| just got deleted
return written;
}
void
PluginStreamChild::NPP_DestroyStream(NPError reason)
{
AssertPluginThread();
if (mClosed)
return;
mClosed = true;
Instance()->mPluginIface->destroystream(
&Instance()->mData, &mStream, reason);
}
PluginInstanceChild*
PluginStreamChild::Instance()
{
return static_cast<PluginInstanceChild*>(Manager());
}
} // namespace plugins
} // namespace mozilla

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

@ -1,55 +0,0 @@
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_plugins_PluginStreamChild_h
#define mozilla_plugins_PluginStreamChild_h
#include "mozilla/plugins/PPluginStreamChild.h"
#include "mozilla/plugins/AStream.h"
namespace mozilla {
namespace plugins {
class PluginInstanceChild;
class PluginStreamChild : public PPluginStreamChild, public AStream
{
friend class PluginInstanceChild;
public:
PluginStreamChild();
virtual ~PluginStreamChild() { }
virtual bool IsBrowserStream() override { return false; }
virtual mozilla::ipc::IPCResult Answer__delete__(const NPReason& reason,
const bool& artificial) override;
int32_t NPN_Write(int32_t length, void* buffer);
void NPP_DestroyStream(NPError reason);
void EnsureCorrectInstance(PluginInstanceChild* i)
{
if (i != Instance())
MOZ_CRASH("Incorrect stream instance");
}
void EnsureCorrectStream(NPStream* s)
{
if (s != &mStream)
MOZ_CRASH("Incorrect stream data");
}
private:
PluginInstanceChild* Instance();
NPStream mStream;
bool mClosed;
};
} // namespace plugins
} // namespace mozilla
#endif

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

@ -1,72 +0,0 @@
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "PluginStreamParent.h"
#include "PluginInstanceParent.h"
namespace mozilla {
namespace plugins {
PluginStreamParent::PluginStreamParent(PluginInstanceParent* npp,
const nsCString& mimeType,
const nsCString& target,
NPError* result)
: mInstance(npp)
, mClosed(false)
{
*result = mInstance->mNPNIface->newstream(mInstance->mNPP,
const_cast<char*>(mimeType.get()),
NullableStringGet(target),
&mStream);
if (*result == NPERR_NO_ERROR)
mStream->pdata = static_cast<AStream*>(this);
else
mStream = nullptr;
}
void
PluginStreamParent::ActorDestroy(ActorDestroyReason aWhy)
{
// Implement me! Bug 1005166
}
mozilla::ipc::IPCResult
PluginStreamParent::AnswerNPN_Write(const Buffer& data, int32_t* written)
{
if (mClosed) {
*written = -1;
return IPC_OK();
}
*written = mInstance->mNPNIface->write(mInstance->mNPP, mStream,
data.Length(),
const_cast<char*>(data.get()));
if (*written < 0)
mClosed = true;
return IPC_OK();
}
mozilla::ipc::IPCResult
PluginStreamParent::Answer__delete__(const NPError& reason,
const bool& artificial)
{
if (!artificial)
this->NPN_DestroyStream(reason);
return IPC_OK();
}
void
PluginStreamParent::NPN_DestroyStream(NPReason reason)
{
if (mClosed)
return;
mInstance->mNPNIface->destroystream(mInstance->mNPP, mStream, reason);
mClosed = true;
}
} // namespace plugins
} // namespace mozilla

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

@ -1,46 +0,0 @@
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_plugins_PluginStreamParent_h
#define mozilla_plugins_PluginStreamParent_h
#include "mozilla/plugins/PPluginStreamParent.h"
#include "mozilla/plugins/AStream.h"
namespace mozilla {
namespace plugins {
class PluginInstanceParent;
class PluginStreamParent : public PPluginStreamParent, public AStream
{
friend class PluginModuleParent;
friend class PluginInstanceParent;
public:
PluginStreamParent(PluginInstanceParent* npp, const nsCString& mimeType,
const nsCString& target, NPError* result);
virtual ~PluginStreamParent() { }
virtual bool IsBrowserStream() override { return false; }
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
virtual mozilla::ipc::IPCResult AnswerNPN_Write(const Buffer& data, int32_t* written) override;
virtual mozilla::ipc::IPCResult Answer__delete__(const NPError& reason, const bool& artificial) override;
private:
void NPN_DestroyStream(NPReason reason);
PluginInstanceParent* mInstance;
NPStream* mStream;
bool mClosed;
};
} // namespace plugins
} // namespace mozilla
#endif

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

@ -34,8 +34,6 @@ EXPORTS.mozilla.plugins += [
'PluginScriptableObjectParent.h',
'PluginScriptableObjectUtils-inl.h',
'PluginScriptableObjectUtils.h',
'PluginStreamChild.h',
'PluginStreamParent.h',
'PluginUtilsOSX.h',
'StreamNotifyChild.h',
'StreamNotifyParent.h',
@ -77,8 +75,6 @@ UNIFIED_SOURCES += [
'PluginQuirks.cpp',
'PluginScriptableObjectChild.cpp',
'PluginScriptableObjectParent.cpp',
'PluginStreamChild.cpp',
'PluginStreamParent.cpp',
]
SOURCES += [
@ -113,7 +109,6 @@ IPDL_SOURCES += [
'PPluginInstance.ipdl',
'PPluginModule.ipdl',
'PPluginScriptableObject.ipdl',
'PPluginStream.ipdl',
'PPluginSurface.ipdl',
'PStreamNotify.ipdl',
]

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

@ -478,68 +478,33 @@ static void sendBufferToFrame(NPP instance)
outbuf.append("Error: no data in buffer");
}
if (instanceData->npnNewStream &&
instanceData->err.str().length() == 0) {
char typeHTML[] = "text/html";
NPStream* stream;
printf("calling NPN_NewStream...");
NPError err = NPN_NewStream(instance, typeHTML,
instanceData->frame.c_str(), &stream);
printf("return value %d\n", err);
if (err != NPERR_NO_ERROR) {
instanceData->err << "NPN_NewStream returned " << err;
return;
// Convert CRLF to LF, and escape most other non-alphanumeric chars.
for (size_t i = 0; i < outbuf.length(); i++) {
if (outbuf[i] == '\n') {
outbuf.replace(i, 1, "%0a");
i += 2;
}
int32_t bytesToWrite = outbuf.length();
int32_t bytesWritten = 0;
while ((bytesToWrite - bytesWritten) > 0) {
int32_t numBytes = (bytesToWrite - bytesWritten) <
instanceData->streamChunkSize ?
bytesToWrite - bytesWritten : instanceData->streamChunkSize;
int32_t written = NPN_Write(instance, stream,
numBytes, (void*)(outbuf.c_str() + bytesWritten));
if (written <= 0) {
instanceData->err << "NPN_Write returned " << written;
break;
}
bytesWritten += numBytes;
printf("%d bytes written, total %d\n", written, bytesWritten);
else if (outbuf[i] == '\r') {
outbuf.replace(i, 1, "");
i -= 1;
}
err = NPN_DestroyStream(instance, stream, NPRES_DONE);
if (err != NPERR_NO_ERROR) {
instanceData->err << "NPN_DestroyStream returned " << err;
}
}
else {
// Convert CRLF to LF, and escape most other non-alphanumeric chars.
for (size_t i = 0; i < outbuf.length(); i++) {
if (outbuf[i] == '\n') {
outbuf.replace(i, 1, "%0a");
else {
int ascii = outbuf[i];
if (!((ascii >= ',' && ascii <= ';') ||
(ascii >= 'A' && ascii <= 'Z') ||
(ascii >= 'a' && ascii <= 'z'))) {
char hex[10];
sprintf(hex, "%%%x", ascii);
outbuf.replace(i, 1, hex);
i += 2;
}
else if (outbuf[i] == '\r') {
outbuf.replace(i, 1, "");
i -= 1;
}
else {
int ascii = outbuf[i];
if (!((ascii >= ',' && ascii <= ';') ||
(ascii >= 'A' && ascii <= 'Z') ||
(ascii >= 'a' && ascii <= 'z'))) {
char hex[10];
sprintf(hex, "%%%x", ascii);
outbuf.replace(i, 1, hex);
i += 2;
}
}
}
}
NPError err = NPN_GetURL(instance, outbuf.c_str(),
instanceData->frame.c_str());
if (err != NPERR_NO_ERROR) {
instanceData->err << "NPN_GetURL returned " << err;
}
NPError err = NPN_GetURL(instance, outbuf.c_str(),
instanceData->frame.c_str());
if (err != NPERR_NO_ERROR) {
instanceData->err << "NPN_GetURL returned " << err;
}
}
@ -852,7 +817,6 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char*
instanceData->focusState = ACTIVATION_STATE_UNKNOWN;
instanceData->focusEventCount = 0;
instanceData->eventModel = 0;
instanceData->closeStream = false;
instanceData->wantsAllStreams = false;
instanceData->mouseUpEventCount = 0;
instanceData->bugMode = -1;
@ -984,9 +948,6 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char*
strcmp(argv[i], "false") == 0) {
instanceData->cleanupWidget = false;
}
if (!strcmp(argn[i], "closestream")) {
instanceData->closeStream = true;
}
if (strcmp(argn[i], "bugmode") == 0) {
instanceData->bugMode = atoi(argv[i]);
}
@ -1418,15 +1379,7 @@ NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buf
nd->size = newsize;
return len;
}
if (instanceData->closeStream) {
instanceData->closeStream = false;
if (instanceData->testrange != nullptr) {
NPN_RequestRead(stream, instanceData->testrange);
}
NPN_DestroyStream(instance, stream, NPRES_USER_BREAK);
}
else if (instanceData->streamMode == NP_SEEK &&
if (instanceData->streamMode == NP_SEEK &&
stream->end != 0 &&
stream->end == ((uint32_t)instanceData->streamBufSize + len)) {
// If the complete stream has been written, and we're doing a seek test,
@ -1453,21 +1406,13 @@ NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buf
printf("data matches!\n");
}
TestRange* range = instanceData->testrange;
bool stillwaiting = false;
while(range != nullptr) {
if (offset == range->offset &&
(uint32_t)len == range->length) {
range->waiting = false;
}
if (range->waiting) stillwaiting = true;
range = reinterpret_cast<TestRange*>(range->next);
}
if (!stillwaiting) {
NPError err = NPN_DestroyStream(instance, stream, NPRES_DONE);
if (err != NPERR_NO_ERROR) {
instanceData->err << "Error: NPN_DestroyStream returned " << err;
}
}
}
else {
if (instanceData->streamBufSize == 0) {
@ -1909,29 +1854,7 @@ NPN_PostURL(NPP instance, const char *url,
return sBrowserFuncs->posturl(instance, url, target, len, buf, file);
}
NPError
NPN_DestroyStream(NPP instance, NPStream* stream, NPError reason)
{
return sBrowserFuncs->destroystream(instance, stream, reason);
}
NPError
NPN_NewStream(NPP instance,
NPMIMEType type,
const char* target,
NPStream** stream)
{
return sBrowserFuncs->newstream(instance, type, target, stream);
}
int32_t
NPN_Write(NPP instance,
NPStream* stream,
int32_t len,
void* buf)
{
return sBrowserFuncs->write(instance, stream, len, buf);
}
bool
NPN_Enumerate(NPP instance,

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

@ -34,5 +34,6 @@ add_task(async function testPermissionUnknownInPrivateWindow() {
unregisterAllPopupEventHandlers(win);
win.gBrowser.removeCurrentTab();
await BrowserTestUtils.closeWindow(win);
win = null;
removePermission(testPageURL, "persistent-storage");
});

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

@ -19,18 +19,11 @@ interface StackFrame;
Exposed=(Window,Worker)]
interface ExceptionMembers
{
// A custom message set by the thrower. LenientThis so it can be
// gotten on the prototype, which Error.prototype.toString will do
// if someone tries to stringify DOMException.prototype.
[LenientThis]
// A custom message set by the thrower.
readonly attribute DOMString message;
// The nsresult associated with this exception.
readonly attribute unsigned long result;
// The name of the error code (ie, a string repr of |result|).
// LenientThis so it can be gotten on the prototype, which
// Error.prototype.toString will do if someone tries to stringify
// DOMException.prototype.
[LenientThis]
readonly attribute DOMString name;
// Filename location. This is the location that caused the

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

@ -30,7 +30,7 @@ InlineTranslator::TranslateRecording(char *aData, size_t aLen)
// an istream like class for reading from memory
struct MemReader {
MemReader(char *aData, size_t aLen) : mData(aData), mEnd(aData + aLen) {}
void read(char* s, streamsize n) {
void read(char* s, std::streamsize n) {
if (n <= (mEnd - mData)) {
memcpy(s, mData, n);
mData += n;

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

@ -1204,9 +1204,6 @@ private:
MOZ_IMPLICIT RecordedFilterNodeSetInput(S &aStream);
};
using namespace std;
static std::string NameFromBackend(BackendType aType)
{
switch (aType) {
@ -1516,7 +1513,7 @@ RecordedDrawTargetCreation::RecordedDrawTargetCreation(S &aStream)
}
inline void
RecordedDrawTargetCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedDrawTargetCreation::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] DrawTarget Creation (Type: " << NameFromBackend(mBackendType) << ", Size: " << mSize.width << "x" << mSize.height << ")";
}
@ -1544,7 +1541,7 @@ RecordedDrawTargetDestruction::RecordedDrawTargetDestruction(S &aStream)
}
inline void
RecordedDrawTargetDestruction::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedDrawTargetDestruction::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] DrawTarget Destruction";
}
@ -1584,7 +1581,7 @@ RecordedCreateSimilarDrawTarget::RecordedCreateSimilarDrawTarget(S &aStream)
}
inline void
RecordedCreateSimilarDrawTarget::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedCreateSimilarDrawTarget::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] CreateSimilarDrawTarget (Size: " << mSize.width << "x" << mSize.height << ")";
}
@ -1683,7 +1680,7 @@ RecordedFillRect::RecordedFillRect(S &aStream)
}
inline void
RecordedFillRect::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFillRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] FillRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
OutputSimplePatternInfo(mPattern, aStringStream);
@ -1718,7 +1715,7 @@ RecordedStrokeRect::RecordedStrokeRect(S &aStream)
}
inline void
RecordedStrokeRect::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedStrokeRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] StrokeRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height
<< ") LineWidth: " << mStrokeOptions.mLineWidth << "px ";
@ -1756,7 +1753,7 @@ RecordedStrokeLine::RecordedStrokeLine(S &aStream)
}
inline void
RecordedStrokeLine::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedStrokeLine::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] StrokeLine (" << mBegin.x << ", " << mBegin.y << " - " << mEnd.x << ", " << mEnd.y
<< ") LineWidth: " << mStrokeOptions.mLineWidth << "px ";
@ -1790,7 +1787,7 @@ RecordedFill::Record(S &aStream) const
}
inline void
RecordedFill::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFill::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] Fill (" << mPath << ") ";
OutputSimplePatternInfo(mPattern, aStringStream);
@ -1837,7 +1834,7 @@ RecordedFillGlyphs::Record(S &aStream) const
}
inline void
RecordedFillGlyphs::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFillGlyphs::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] FillGlyphs (" << mScaledFont << ") ";
OutputSimplePatternInfo(mPattern, aStringStream);
@ -1870,7 +1867,7 @@ RecordedMask::Record(S &aStream) const
}
inline void
RecordedMask::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedMask::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] Mask (Source: ";
OutputSimplePatternInfo(mSource, aStringStream);
@ -1907,7 +1904,7 @@ RecordedStroke::RecordedStroke(S &aStream)
}
inline void
RecordedStroke::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedStroke::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] Stroke ("<< mPath << ") LineWidth: " << mStrokeOptions.mLineWidth << "px ";
OutputSimplePatternInfo(mPattern, aStringStream);
@ -1936,7 +1933,7 @@ RecordedClearRect::RecordedClearRect(S &aStream)
}
inline void
RecordedClearRect::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedClearRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT<< "] ClearRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
}
@ -1969,7 +1966,7 @@ RecordedCopySurface::RecordedCopySurface(S &aStream)
}
inline void
RecordedCopySurface::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedCopySurface::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT<< "] CopySurface (" << mSourceSurface << ")";
}
@ -1997,7 +1994,7 @@ RecordedPushClip::RecordedPushClip(S &aStream)
}
inline void
RecordedPushClip::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedPushClip::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] PushClip (" << mPath << ") ";
}
@ -2025,7 +2022,7 @@ RecordedPushClipRect::RecordedPushClipRect(S &aStream)
}
inline void
RecordedPushClipRect::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedPushClipRect::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] PushClipRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
}
@ -2051,7 +2048,7 @@ RecordedPopClip::RecordedPopClip(S &aStream)
}
inline void
RecordedPopClip::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedPopClip::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] PopClip";
}
@ -2092,7 +2089,7 @@ RecordedPushLayer::RecordedPushLayer(S &aStream)
}
inline void
RecordedPushLayer::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedPushLayer::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] PushPLayer (Opaque=" << mOpaque <<
", Opacity=" << mOpacity << ", Mask Ref=" << mMask << ") ";
@ -2119,7 +2116,7 @@ RecordedPopLayer::RecordedPopLayer(S &aStream)
}
inline void
RecordedPopLayer::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedPopLayer::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] PopLayer";
}
@ -2147,7 +2144,7 @@ RecordedSetTransform::RecordedSetTransform(S &aStream)
}
inline void
RecordedSetTransform::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedSetTransform::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] SetTransform [ " << mTransform._11 << " " << mTransform._12 << " ; " <<
mTransform._21 << " " << mTransform._22 << " ; " << mTransform._31 << " " << mTransform._32 << " ]";
@ -2186,7 +2183,7 @@ RecordedDrawSurface::RecordedDrawSurface(S &aStream)
}
inline void
RecordedDrawSurface::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedDrawSurface::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] DrawSurface (" << mRefSource << ")";
}
@ -2222,7 +2219,7 @@ RecordedDrawFilter::RecordedDrawFilter(S &aStream)
}
inline void
RecordedDrawFilter::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedDrawFilter::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] DrawFilter (" << mNode << ")";
}
@ -2262,7 +2259,7 @@ RecordedDrawSurfaceWithShadow::RecordedDrawSurfaceWithShadow(S &aStream)
}
inline void
RecordedDrawSurfaceWithShadow::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedDrawSurfaceWithShadow::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] DrawSurfaceWithShadow (" << mRefSource << ") Color: (" <<
mColor.r << ", " << mColor.g << ", " << mColor.b << ", " << mColor.a << ")";
@ -2363,7 +2360,7 @@ RecordedPathCreation::RecordedPathCreation(S &aStream)
}
inline void
RecordedPathCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedPathCreation::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] Path created (OpCount: " << mPathOps.size() << ")";
}
@ -2389,7 +2386,7 @@ RecordedPathDestruction::RecordedPathDestruction(S &aStream)
}
inline void
RecordedPathDestruction::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedPathDestruction::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] Path Destroyed";
}
@ -2444,7 +2441,7 @@ RecordedSourceSurfaceCreation::RecordedSourceSurfaceCreation(S &aStream)
}
inline void
RecordedSourceSurfaceCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedSourceSurfaceCreation::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] SourceSurface created (Size: " << mSize.width << "x" << mSize.height << ")";
}
@ -2471,7 +2468,7 @@ RecordedSourceSurfaceDestruction::RecordedSourceSurfaceDestruction(S &aStream)
}
inline void
RecordedSourceSurfaceDestruction::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedSourceSurfaceDestruction::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] SourceSurface Destroyed";
}
@ -2507,7 +2504,7 @@ RecordedFilterNodeCreation::RecordedFilterNodeCreation(S &aStream)
}
inline void
RecordedFilterNodeCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFilterNodeCreation::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] FilterNode created (Type: " << int(mType) << ")";
}
@ -2534,7 +2531,7 @@ RecordedFilterNodeDestruction::RecordedFilterNodeDestruction(S &aStream)
}
inline void
RecordedFilterNodeDestruction::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFilterNodeDestruction::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] FilterNode Destroyed";
}
@ -2579,7 +2576,7 @@ RecordedGradientStopsCreation::RecordedGradientStopsCreation(S &aStream)
}
inline void
RecordedGradientStopsCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedGradientStopsCreation::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] GradientStops created (Stops: " << mNumStops << ")";
}
@ -2606,7 +2603,7 @@ RecordedGradientStopsDestruction::RecordedGradientStopsDestruction(S &aStream)
}
inline void
RecordedGradientStopsDestruction::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedGradientStopsDestruction::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] GradientStops Destroyed";
}
@ -2640,7 +2637,7 @@ RecordedIntoLuminanceSource::RecordedIntoLuminanceSource(S &aStream)
}
inline void
RecordedIntoLuminanceSource::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedIntoLuminanceSource::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] Into Luminance Source (DT: " << mDT << ")";
}
@ -2670,7 +2667,7 @@ RecordedSnapshot::RecordedSnapshot(S &aStream)
}
inline void
RecordedSnapshot::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedSnapshot::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] Snapshot Created (DT: " << mDT << ")";
}
@ -2709,7 +2706,7 @@ RecordedFontData::Record(S &aStream) const
}
inline void
RecordedFontData::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFontData::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "Font Data of size " << mFontDetails.size;
}
@ -2783,7 +2780,7 @@ RecordedFontDescriptor::Record(S &aStream) const
}
inline void
RecordedFontDescriptor::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFontDescriptor::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] Font Descriptor";
}
@ -2835,7 +2832,7 @@ RecordedUnscaledFontCreation::Record(S &aStream) const
}
inline void
RecordedUnscaledFontCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedUnscaledFontCreation::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] UnscaledFont Created";
}
@ -2882,7 +2879,7 @@ RecordedUnscaledFontDestruction::RecordedUnscaledFontDestruction(S &aStream)
}
inline void
RecordedUnscaledFontDestruction::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedUnscaledFontDestruction::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] UnscaledFont Destroyed";
}
@ -2915,7 +2912,7 @@ RecordedScaledFontCreation::Record(S &aStream) const
}
inline void
RecordedScaledFontCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedScaledFontCreation::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] ScaledFont Created";
}
@ -2962,7 +2959,7 @@ RecordedScaledFontDestruction::RecordedScaledFontDestruction(S &aStream)
}
inline void
RecordedScaledFontDestruction::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedScaledFontDestruction::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mRefPtr << "] ScaledFont Destroyed";
}
@ -2999,7 +2996,7 @@ RecordedMaskSurface::RecordedMaskSurface(S &aStream)
}
inline void
RecordedMaskSurface::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedMaskSurface::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mDT << "] MaskSurface (" << mRefMask << ") Offset: (" << mOffset.x << "x" << mOffset.y << ") Pattern: ";
OutputSimplePatternInfo(mPattern, aStringStream);
@ -3070,7 +3067,7 @@ RecordedFilterNodeSetAttribute::RecordedFilterNodeSetAttribute(S &aStream)
}
inline void
RecordedFilterNodeSetAttribute::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFilterNodeSetAttribute::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mNode << "] SetAttribute (" << mIndex << ")";
}
@ -3110,7 +3107,7 @@ RecordedFilterNodeSetInput::RecordedFilterNodeSetInput(S &aStream)
}
inline void
RecordedFilterNodeSetInput::OutputSimpleEventInfo(stringstream &aStringStream) const
RecordedFilterNodeSetInput::OutputSimpleEventInfo(std::stringstream &aStringStream) const
{
aStringStream << "[" << mNode << "] SetAttribute (" << mIndex << ", ";

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

@ -180,7 +180,9 @@ bool FramebufferState::attachmentsHaveSameDimensions() const
return false;
}
return (attachment.getSize() != attachmentSize.value());
const Extents &size = attachment.getSize();
return size.width != attachmentSize.value().width ||
size.height != attachmentSize.value().height;
};
for (const auto &attachment : mColorAttachments)

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

@ -290,6 +290,7 @@ GLContext::GLContext(CreateContextFlags flags, const SurfaceCaps& caps,
mTextureAllocCrashesOnMapFailure(false),
mNeedsCheckAfterAttachTextureToFb(false),
mWorkAroundDriverBugs(true),
mSyncGLCallCount(0),
mHeavyGLCallsSinceLastFlush(false)
{
mMaxViewportDims[0] = 0;
@ -3046,6 +3047,16 @@ bool GLContext::MakeCurrent(bool aForce)
return true;
}
void
GLContext::ResetSyncCallCount(const char* resetReason) const
{
if (ShouldSpew()) {
printf_stderr("On %s, mSyncGLCallCount = %" PRIu64 "\n",
resetReason, mSyncGLCallCount);
}
mSyncGLCallCount = 0;
}
} /* namespace gl */
} /* namespace mozilla */

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

@ -788,6 +788,16 @@ private:
// if it's bound.
void AfterGLReadCall() { }
public:
void OnSyncCall() const {
mSyncGLCallCount++;
}
uint64_t GetSyncCallCount() const {
return mSyncGLCallCount;
}
void ResetSyncCallCount(const char* resetReason) const;
// -----------------------------------------------------------------------------
// GL official entry points
@ -885,6 +895,7 @@ private:
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(data);
BEFORE_GL_CALL;
mSymbols.fBufferData(target, size, data, usage);
OnSyncCall();
AFTER_GL_CALL;
mHeavyGLCallsSinceLastFlush = true;
}
@ -1131,6 +1142,7 @@ public:
void fFinish() {
BEFORE_GL_CALL;
mSymbols.fFinish();
OnSyncCall();
AFTER_GL_CALL;
mHeavyGLCallsSinceLastFlush = false;
}
@ -1151,24 +1163,28 @@ public:
void fGetActiveAttrib(GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
BEFORE_GL_CALL;
mSymbols.fGetActiveAttrib(program, index, maxLength, length, size, type, name);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetActiveUniform(GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name) {
BEFORE_GL_CALL;
mSymbols.fGetActiveUniform(program, index, maxLength, length, size, type, name);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders) {
BEFORE_GL_CALL;
mSymbols.fGetAttachedShaders(program, maxCount, count, shaders);
OnSyncCall();
AFTER_GL_CALL;
}
GLint fGetAttribLocation(GLuint program, const GLchar* name) {
BEFORE_GL_CALL;
GLint retval = mSymbols.fGetAttribLocation(program, name);
OnSyncCall();
AFTER_GL_CALL;
return retval;
}
@ -1177,6 +1193,7 @@ private:
void raw_fGetIntegerv(GLenum pname, GLint* params) {
BEFORE_GL_CALL;
mSymbols.fGetIntegerv(pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1199,18 +1216,21 @@ public:
void fGetFloatv(GLenum pname, GLfloat* params) {
BEFORE_GL_CALL;
mSymbols.fGetFloatv(pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetBooleanv(GLenum pname, realGLboolean* params) {
BEFORE_GL_CALL;
mSymbols.fGetBooleanv(pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetBufferParameteriv(GLenum target, GLenum pname, GLint* params) {
BEFORE_GL_CALL;
mSymbols.fGetBufferParameteriv(target, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1218,6 +1238,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetDebugMessageLog);
GLuint ret = mSymbols.fGetDebugMessageLog(count, bufsize, sources, types, ids, severities, lengths, messageLog);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -1226,6 +1247,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetPointerv);
mSymbols.fGetPointerv(pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1233,6 +1255,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetObjectLabel);
mSymbols.fGetObjectLabel(identifier, name, bufSize, length, label);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1240,6 +1263,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetObjectPtrLabel);
mSymbols.fGetObjectPtrLabel(ptr, bufSize, length, label);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1252,12 +1276,14 @@ public:
void fGetProgramiv(GLuint program, GLenum pname, GLint* param) {
BEFORE_GL_CALL;
mSymbols.fGetProgramiv(program, pname, param);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog) {
BEFORE_GL_CALL;
mSymbols.fGetProgramInfoLog(program, bufSize, length, infoLog);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1282,6 +1308,7 @@ public:
const GLubyte* fGetString(GLenum name) {
BEFORE_GL_CALL;
const GLubyte* result = mSymbols.fGetString(name);
OnSyncCall();
AFTER_GL_CALL;
return result;
}
@ -1290,6 +1317,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetTexImage);
mSymbols.fGetTexImage(target, level, format, type, img);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1298,30 +1326,35 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetTexLevelParameteriv);
mSymbols.fGetTexLevelParameteriv(target, level, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) {
BEFORE_GL_CALL;
mSymbols.fGetTexParameterfv(target, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetTexParameteriv(GLenum target, GLenum pname, GLint* params) {
BEFORE_GL_CALL;
mSymbols.fGetTexParameteriv(target, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetUniformfv(GLuint program, GLint location, GLfloat* params) {
BEFORE_GL_CALL;
mSymbols.fGetUniformfv(program, location, params);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetUniformiv(GLuint program, GLint location, GLint* params) {
BEFORE_GL_CALL;
mSymbols.fGetUniformiv(program, location, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1329,12 +1362,14 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetUniformuiv);
mSymbols.fGetUniformuiv(program, location, params);
OnSyncCall();
AFTER_GL_CALL;
}
GLint fGetUniformLocation (GLint programObj, const GLchar* name) {
BEFORE_GL_CALL;
GLint retval = mSymbols.fGetUniformLocation(programObj, name);
OnSyncCall();
AFTER_GL_CALL;
return retval;
}
@ -1342,18 +1377,21 @@ public:
void fGetVertexAttribfv(GLuint index, GLenum pname, GLfloat* retval) {
BEFORE_GL_CALL;
mSymbols.fGetVertexAttribfv(index, pname, retval);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetVertexAttribiv(GLuint index, GLenum pname, GLint* retval) {
BEFORE_GL_CALL;
mSymbols.fGetVertexAttribiv(index, pname, retval);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid** retval) {
BEFORE_GL_CALL;
mSymbols.fGetVertexAttribPointerv(index, pname, retval);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1366,6 +1404,7 @@ public:
realGLboolean fIsBuffer(GLuint buffer) {
BEFORE_GL_CALL;
realGLboolean retval = mSymbols.fIsBuffer(buffer);
OnSyncCall();
AFTER_GL_CALL;
return retval;
}
@ -1497,6 +1536,7 @@ public:
ASSERT_NOT_PASSING_STACK_BUFFER_TO_GL(pixels);
BEFORE_GL_CALL;
mSymbols.fReadPixels(x, y, width, height, format, type, pixels);
OnSyncCall();
AFTER_GL_CALL;
mHeavyGLCallsSinceLastFlush = true;
}
@ -1860,12 +1900,14 @@ public:
void fGetShaderiv(GLuint shader, GLenum pname, GLint* param) {
BEFORE_GL_CALL;
mSymbols.fGetShaderiv(shader, pname, param);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog) {
BEFORE_GL_CALL;
mSymbols.fGetShaderInfoLog(shader, bufSize, length, infoLog);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1876,6 +1918,7 @@ private:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetShaderPrecisionFormat);
mSymbols.fGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1892,6 +1935,7 @@ public:
void fGetShaderSource(GLint obj, GLsizei maxLength, GLsizei* length, GLchar* source) {
BEFORE_GL_CALL;
mSymbols.fGetShaderSource(obj, maxLength, length, source);
OnSyncCall();
AFTER_GL_CALL;
}
@ -1920,6 +1964,7 @@ public:
GLenum fCheckFramebufferStatus(GLenum target) {
BEFORE_GL_CALL;
GLenum retval = mSymbols.fCheckFramebufferStatus(target);
OnSyncCall();
AFTER_GL_CALL;
return retval;
}
@ -1949,18 +1994,21 @@ public:
void fGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* value) {
BEFORE_GL_CALL;
mSymbols.fGetFramebufferAttachmentParameteriv(target, attachment, pname, value);
OnSyncCall();
AFTER_GL_CALL;
}
void fGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* value) {
BEFORE_GL_CALL;
mSymbols.fGetRenderbufferParameteriv(target, pname, value);
OnSyncCall();
AFTER_GL_CALL;
}
realGLboolean fIsFramebuffer (GLuint framebuffer) {
BEFORE_GL_CALL;
realGLboolean retval = mSymbols.fIsFramebuffer(framebuffer);
OnSyncCall();
AFTER_GL_CALL;
return retval;
}
@ -1969,6 +2017,7 @@ public:
realGLboolean fIsRenderbuffer (GLuint renderbuffer) {
BEFORE_GL_CALL;
realGLboolean retval = mSymbols.fIsRenderbuffer(renderbuffer);
OnSyncCall();
AFTER_GL_CALL;
return retval;
}
@ -2037,6 +2086,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fMapBuffer);
void* ret = mSymbols.fMapBuffer(target, access);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2068,24 +2118,28 @@ private:
void raw_fGenBuffers(GLsizei n, GLuint* names) {
BEFORE_GL_CALL;
mSymbols.fGenBuffers(n, names);
OnSyncCall();
AFTER_GL_CALL;
}
void raw_fGenFramebuffers(GLsizei n, GLuint* names) {
BEFORE_GL_CALL;
mSymbols.fGenFramebuffers(n, names);
OnSyncCall();
AFTER_GL_CALL;
}
void raw_fGenRenderbuffers(GLsizei n, GLuint* names) {
BEFORE_GL_CALL;
mSymbols.fGenRenderbuffers(n, names);
OnSyncCall();
AFTER_GL_CALL;
}
void raw_fGenTextures(GLsizei n, GLuint* names) {
BEFORE_GL_CALL;
mSymbols.fGenTextures(n, names);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2192,6 +2246,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetGraphicsResetStatus);
GLenum ret = mSymbols.fGetGraphicsResetStatus();
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2204,6 +2259,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fFenceSync);
GLsync ret = mSymbols.fFenceSync(condition, flags);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2212,6 +2268,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fIsSync);
realGLboolean ret = mSymbols.fIsSync(sync);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2227,6 +2284,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fClientWaitSync);
GLenum ret = mSymbols.fClientWaitSync(sync, flags, timeout);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2249,6 +2307,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetSynciv);
mSymbols.fGetSynciv(sync, pname, bufSize, length, values);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2391,6 +2450,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetVertexAttribIiv);
BEFORE_GL_CALL;
mSymbols.fGetVertexAttribIiv(index, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2399,6 +2459,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetVertexAttribIuiv);
BEFORE_GL_CALL;
mSymbols.fGetVertexAttribIuiv(index, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2503,6 +2564,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetFragDataLocation);
GLint result = mSymbols.fGetFragDataLocation(program, name);
OnSyncCall();
AFTER_GL_CALL;
return result;
}
@ -2526,6 +2588,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetInternalformativ);
mSymbols.fGetInternalformativ(target, internalformat, pname, bufSize, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2582,6 +2645,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetQueryiv);
mSymbols.fGetQueryiv(target, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2589,6 +2653,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetQueryObjectuiv);
mSymbols.fGetQueryObjectuiv(id, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2596,6 +2661,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fIsQuery);
realGLboolean retval = mSymbols.fIsQuery(query);
OnSyncCall();
AFTER_GL_CALL;
return retval;
}
@ -2612,6 +2678,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetQueryObjecti64v);
mSymbols.fGetQueryObjecti64v(id, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2619,6 +2686,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetQueryObjectui64v);
mSymbols.fGetQueryObjectui64v(id, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2639,6 +2707,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetQueryObjectiv);
mSymbols.fGetQueryObjectiv(id, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2667,6 +2736,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGenTransformFeedbacks);
mSymbols.fGenTransformFeedbacks(n, ids);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2683,6 +2753,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fIsTransformFeedback);
realGLboolean result = mSymbols.fIsTransformFeedback(id);
OnSyncCall();
AFTER_GL_CALL;
return result;
}
@ -2724,6 +2795,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetTransformFeedbackVarying);
mSymbols.fGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2748,6 +2820,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetIntegeri_v);
mSymbols.fGetIntegeri_v(param, index, values);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2755,6 +2828,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetInteger64i_v);
BEFORE_GL_CALL;
mSymbols.fGetInteger64i_v(target, index, data);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2790,6 +2864,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fIsVertexArray);
realGLboolean ret = mSymbols.fIsVertexArray(array);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2826,6 +2901,7 @@ public:
ASSERT_SYMBOL_PRESENT(fTestFence);
BEFORE_GL_CALL;
realGLboolean ret = mSymbols.fTestFence(fence);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2835,6 +2911,7 @@ public:
ASSERT_SYMBOL_PRESENT(fFinishFence);
BEFORE_GL_CALL;
mSymbols.fFinishFence(fence);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2843,6 +2920,7 @@ public:
ASSERT_SYMBOL_PRESENT(fIsFence);
BEFORE_GL_CALL;
realGLboolean ret = mSymbols.fIsFence(fence);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -2852,6 +2930,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetFenceiv);
BEFORE_GL_CALL;
mSymbols.fGetFenceiv(fence, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -2888,6 +2967,7 @@ public:
ASSERT_SYMBOL_PRESENT(fMapBufferRange);
BEFORE_GL_CALL;
void* data = mSymbols.fMapBufferRange(target, offset, length, access);
OnSyncCall();
AFTER_GL_CALL;
return data;
}
@ -2924,6 +3004,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fIsSampler);
realGLboolean result = mSymbols.fIsSampler(sampler);
OnSyncCall();
AFTER_GL_CALL;
return result;
}
@ -2994,6 +3075,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetUniformIndices);
BEFORE_GL_CALL;
mSymbols.fGetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3003,6 +3085,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetActiveUniformsiv);
BEFORE_GL_CALL;
mSymbols.fGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3010,6 +3093,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetUniformBlockIndex);
BEFORE_GL_CALL;
GLuint result = mSymbols.fGetUniformBlockIndex(program, uniformBlockName);
OnSyncCall();
AFTER_GL_CALL;
return result;
}
@ -3020,6 +3104,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetActiveUniformBlockiv);
BEFORE_GL_CALL;
mSymbols.fGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3029,6 +3114,7 @@ public:
ASSERT_SYMBOL_PRESENT(fGetActiveUniformBlockName);
BEFORE_GL_CALL;
mSymbols.fGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3046,6 +3132,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fTexStorage2D);
mSymbols.fTexStorage2D(target, levels, internalformat, width, height);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3054,6 +3141,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fTexStorage3D);
mSymbols.fTexStorage3D(target, levels, internalformat, width, height, depth);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3071,6 +3159,7 @@ public:
width, height, depth,
border, format, type,
data);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3083,6 +3172,7 @@ public:
mSymbols.fTexSubImage3D(target, level, xoffset, yoffset, zoffset,
width, height, depth, format, type,
pixels);
OnSyncCall();
AFTER_GL_CALL;
}
@ -3132,6 +3222,7 @@ public:
BEFORE_GL_CALL;
ASSERT_SYMBOL_PRESENT(fGetStringi);
const GLubyte* ret = mSymbols.fGetStringi(name, index);
OnSyncCall();
AFTER_GL_CALL;
return ret;
}
@ -3475,6 +3566,7 @@ protected:
bool mTextureAllocCrashesOnMapFailure;
bool mNeedsCheckAfterAttachTextureToFb;
bool mWorkAroundDriverBugs;
mutable uint64_t mSyncGLCallCount;
bool IsTextureSizeSafeToPassToDriver(GLenum target, GLsizei width, GLsizei height) const {
if (mNeedsTextureSizeChecks) {

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

@ -338,6 +338,11 @@ typedef GenericFlingAnimation FlingAnimation;
* the main thread doesn't actually need to do a repaint. This pref allows the
* main thread to skip doing those repaints in cases where it doesn't need to.
*
* \li\b apz.popups.enabled
* Determines whether APZ is used for XUL popup widgets with remote content.
* Ideally, this should always be true, but it is currently not well tested, and
* has known issues, so needs to be prefable.
*
* \li\b apz.record_checkerboarding
* Whether or not to record detailed info on checkerboarding events.
*

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

@ -329,6 +329,7 @@ private:
DECL_GFX_PREF(Live, "apz.overscroll.stretch_factor", APZOverscrollStretchFactor, float, 0.5f);
DECL_GFX_PREF(Live, "apz.paint_skipping.enabled", APZPaintSkipping, bool, true);
DECL_GFX_PREF(Live, "apz.peek_messages.enabled", APZPeekMessages, bool, true);
DECL_GFX_PREF(Live, "apz.popups.enabled", APZPopupsEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.printtree", APZPrintTree, bool, false);
DECL_GFX_PREF(Live, "apz.record_checkerboarding", APZRecordCheckerboarding, bool, false);
DECL_GFX_PREF(Live, "apz.test.fails_with_native_injection", APZTestFailsWithNativeInjection, bool, false);

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

@ -36,9 +36,7 @@ using namespace mozilla;
static NS_DEFINE_CID(kErrorServiceCID, NS_ERRORSERVICE_CID);
nsStringBundle::~nsStringBundle()
{
}
NS_IMPL_ISUPPORTS(nsStringBundle, nsIStringBundle)
nsStringBundle::nsStringBundle(const char* aURLSpec,
nsIStringBundleOverride* aOverrideStrings) :
@ -50,6 +48,10 @@ nsStringBundle::nsStringBundle(const char* aURLSpec,
{
}
nsStringBundle::~nsStringBundle()
{
}
nsresult
nsStringBundle::LoadProperties()
{
@ -113,33 +115,15 @@ nsStringBundle::LoadProperties()
return rv;
}
nsresult
nsStringBundle::GetStringFromID(int32_t aID, nsAString& aResult)
nsStringBundle::GetStringFromNameHelper(const char* aName, nsAString& aResult)
{
NS_ENSURE_ARG_POINTER(aName);
nsresult rv = LoadProperties();
if (NS_FAILED(rv)) return rv;
ReentrantMonitorAutoEnter automon(mReentrantMonitor);
nsAutoCString name;
name.AppendInt(aID, 10);
nsresult rv;
// try override first
if (mOverrideStrings) {
rv = mOverrideStrings->GetStringFromName(mPropertiesURL,
name,
aResult);
if (NS_SUCCEEDED(rv)) return rv;
}
rv = mProps->GetStringProperty(name, aResult);
return rv;
}
nsresult
nsStringBundle::GetStringFromName(const char* aName, nsAString& aResult)
{
nsresult rv;
// try override first
if (mOverrideStrings) {
@ -153,6 +137,38 @@ nsStringBundle::GetStringFromName(const char* aName, nsAString& aResult)
return rv;
}
NS_IMETHODIMP
nsStringBundle::GetStringFromID(int32_t aID, char16_t **aResult)
{
nsAutoCString idStr;
idStr.AppendInt(aID, 10);
return GetStringFromName(idStr.get(), aResult);
}
NS_IMETHODIMP
nsStringBundle::GetStringFromAUTF8Name(const nsACString& aName,
char16_t **aResult)
{
return GetStringFromName(PromiseFlatCString(aName).get(), aResult);
}
NS_IMETHODIMP
nsStringBundle::GetStringFromName(const char* aName, char16_t** aResult)
{
NS_ENSURE_ARG_POINTER(aResult);
*aResult = nullptr;
nsAutoString tmpstr;
nsresult rv = GetStringFromNameHelper(aName, tmpstr);
if (NS_FAILED(rv)) return rv;
*aResult = ToNewUnicode(tmpstr);
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
return NS_OK;
}
NS_IMETHODIMP
nsStringBundle::FormatStringFromID(int32_t aID,
const char16_t **aParams,
@ -161,7 +177,6 @@ nsStringBundle::FormatStringFromID(int32_t aID,
{
nsAutoCString idStr;
idStr.AppendInt(aID, 10);
return FormatStringFromName(idStr.get(), aParams, aLength, aResult);
}
@ -183,71 +198,18 @@ nsStringBundle::FormatStringFromName(const char* aName,
uint32_t aLength,
char16_t** aResult)
{
NS_ENSURE_ARG_POINTER(aName);
NS_ASSERTION(aParams && aLength, "FormatStringFromName() without format parameters: use GetStringFromName() instead");
NS_ENSURE_ARG_POINTER(aResult);
NS_ASSERTION(aParams && aLength, "FormatStringFromName() without format parameters: use GetStringFromName() instead");
nsresult rv;
rv = LoadProperties();
if (NS_FAILED(rv)) return rv;
*aResult = nullptr;
nsAutoString formatStr;
rv = GetStringFromName(aName, formatStr);
nsresult rv = GetStringFromNameHelper(aName, formatStr);
if (NS_FAILED(rv)) return rv;
return FormatString(formatStr.get(), aParams, aLength, aResult);
}
NS_IMPL_ISUPPORTS(nsStringBundle, nsIStringBundle)
NS_IMETHODIMP
nsStringBundle::GetStringFromID(int32_t aID, char16_t **aResult)
{
nsresult rv;
rv = LoadProperties();
if (NS_FAILED(rv)) return rv;
*aResult = nullptr;
nsAutoString tmpstr;
rv = GetStringFromID(aID, tmpstr);
NS_ENSURE_SUCCESS(rv, rv);
*aResult = ToNewUnicode(tmpstr);
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
return NS_OK;
}
NS_IMETHODIMP
nsStringBundle::GetStringFromAUTF8Name(const nsACString& aName,
char16_t **aResult)
{
return GetStringFromName(PromiseFlatCString(aName).get(), aResult);
}
NS_IMETHODIMP
nsStringBundle::GetStringFromName(const char* aName, char16_t** aResult)
{
NS_ENSURE_ARG_POINTER(aName);
NS_ENSURE_ARG_POINTER(aResult);
nsresult rv;
rv = LoadProperties();
if (NS_FAILED(rv)) return rv;
ReentrantMonitorAutoEnter automon(mReentrantMonitor);
*aResult = nullptr;
nsAutoString tmpstr;
rv = GetStringFromName(aName, tmpstr);
if (NS_FAILED(rv)) return rv;
*aResult = ToNewUnicode(tmpstr);
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
return NS_OK;
}
nsresult
nsStringBundle::GetCombinedEnumeration(nsIStringBundleOverride* aOverrideStrings,
nsISimpleEnumerator** aResult)
@ -343,7 +305,7 @@ nsStringBundle::FormatString(const char16_t *aFormatStr,
// Don't believe me? See:
// http://www.eskimo.com/~scs/C-faq/q15.13.html
// -alecf
char16_t *text =
*aResult =
nsTextFormatter::smprintf(aFormatStr,
aLength >= 1 ? aParams[0] : nullptr,
aLength >= 2 ? aParams[1] : nullptr,
@ -356,19 +318,6 @@ nsStringBundle::FormatString(const char16_t *aFormatStr,
aLength >= 9 ? aParams[8] : nullptr,
aLength >= 10 ? aParams[9] : nullptr);
if (!text) {
*aResult = nullptr;
return NS_ERROR_OUT_OF_MEMORY;
}
// nsTextFormatter does not use the shared nsMemory allocator.
// Instead it is required to free the memory it allocates using
// nsTextFormatter::smprintf_free. Let's instead use nsMemory based
// allocation for the result that we give out and free the string
// returned by smprintf ourselves!
*aResult = NS_strdup(text);
nsTextFormatter::smprintf_free(text);
return *aResult ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}
@ -426,18 +375,9 @@ nsExtensibleStringBundle::~nsExtensibleStringBundle()
nsresult nsExtensibleStringBundle::GetStringFromID(int32_t aID, char16_t ** aResult)
{
nsresult rv;
const uint32_t size = mBundles.Count();
for (uint32_t i = 0; i < size; ++i) {
nsIStringBundle *bundle = mBundles[i];
if (bundle) {
rv = bundle->GetStringFromID(aID, aResult);
if (NS_SUCCEEDED(rv))
return NS_OK;
}
}
return NS_ERROR_FAILURE;
nsAutoCString idStr;
idStr.AppendInt(aID, 10);
return GetStringFromName(idStr.get(), aResult);
}
nsresult nsExtensibleStringBundle::GetStringFromAUTF8Name(

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

@ -30,9 +30,7 @@ public:
protected:
virtual ~nsStringBundle();
// Functional decomposition of the functions repeatedly called.
nsresult GetStringFromID(int32_t aID, nsAString& aResult);
nsresult GetStringFromName(const char* aName, nsAString& aResult);
nsresult GetStringFromNameHelper(const char* aName, nsAString& aResult);
nsresult GetCombinedEnumeration(nsIStringBundleOverride* aOverrideString,
nsISimpleEnumerator** aResult);

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

@ -747,8 +747,6 @@ description =
description =
[PPluginInstance::NPP_NewStream]
description =
[PPluginInstance::PPluginStream]
description =
[PPluginInstance::PluginFocusChange]
description =
[PPluginInstance::SetPluginFocus]

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

@ -692,7 +692,7 @@ NewPromiseCapability(JSContext* cx, HandleObject C, MutableHandleObject promise,
// Steps 1-2.
if (!IsConstructor(C)) {
ReportValueError(cx, JSMSG_NOT_CONSTRUCTOR, -1, cVal, nullptr);
ReportValueError(cx, JSMSG_NOT_CONSTRUCTOR, JSDVG_SEARCH_STACK, cVal, nullptr);
return false;
}

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

@ -645,11 +645,11 @@ frontend::CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const cha
{
MOZ_ASSERT(cx->compartment() == lazy->functionNonDelazifying()->compartment());
uint32_t sourceStartColumn = lazy->scriptSource()->startColumn();
CompileOptions options(cx, lazy->version());
options.setMutedErrors(lazy->mutedErrors())
.setFileAndLine(lazy->filename(), lazy->lineno())
.setColumn(lazy->column(), sourceStartColumn)
.setColumn(lazy->column())
.setScriptSourceOffset(lazy->begin())
.setNoScriptRval(false)
.setSelfHostingMode(false);
@ -682,8 +682,9 @@ frontend::CompileLazyFunction(JSContext* cx, Handle<LazyScript*> lazy, const cha
Rooted<JSFunction*> fun(cx, lazy->functionNonDelazifying());
MOZ_ASSERT(!lazy->isLegacyGenerator());
ParseNode* pn = parser.standaloneLazyFunction(fun, lazy->toStringStart() + sourceStartColumn,
lazy->strict(), lazy->generatorKind(), lazy->asyncKind());
ParseNode* pn = parser.standaloneLazyFunction(fun, lazy->toStringStart(),
lazy->strict(), lazy->generatorKind(),
lazy->asyncKind());
if (!pn)
return false;

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

@ -10780,14 +10780,8 @@ BytecodeEmitter::emitClass(ParseNode* pn)
// offsets in the source buffer as source notes so that when we
// actually make the constructor during execution, we can give it the
// correct toString output.
//
// Token positions are already offset from the start column. Since
// toString offsets are absolute offsets into the ScriptSource,
// de-offset from the starting column.
ptrdiff_t classStart = ptrdiff_t(pn->pn_pos.begin) -
tokenStream().options().sourceStartColumn;
ptrdiff_t classEnd = ptrdiff_t(pn->pn_pos.end) -
tokenStream().options().sourceStartColumn;
ptrdiff_t classStart = ptrdiff_t(pn->pn_pos.begin);
ptrdiff_t classEnd = ptrdiff_t(pn->pn_pos.end);
if (!newSrcNote3(SRC_CLASS_SPAN, classStart, classEnd))
return false;

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

@ -3054,6 +3054,8 @@ Parser<ParseHandler, CharT>::functionArguments(YieldHandling yieldHandling,
argModifier = firstTokenModifier;
}
}
TokenPos firstTokenPos;
if (!parenFreeArrow) {
TokenKind tt;
if (!tokenStream.getToken(&tt, firstTokenModifier))
@ -3063,12 +3065,19 @@ Parser<ParseHandler, CharT>::functionArguments(YieldHandling yieldHandling,
return false;
}
firstTokenPos = pos();
// Record the start of function source (for FunctionToString). If we
// are parenFreeArrow, we will set this below, after consuming the NAME.
funbox->setStart(tokenStream);
} else {
// When delazifying, we may not have a current token and pos() is
// garbage. In that case, substitute the first token's position.
if (!tokenStream.peekTokenPos(&firstTokenPos, firstTokenModifier))
return false;
}
Node argsbody = handler.newList(PNK_PARAMSBODY, pos());
Node argsbody = handler.newList(PNK_PARAMSBODY, firstTokenPos);
if (!argsbody)
return false;
handler.setFunctionFormalParametersAndBody(funcpn, argsbody);
@ -3295,13 +3304,7 @@ Parser<FullParseHandler, char16_t>::skipLazyInnerFunction(ParseNode* pn, uint32_
PropagateTransitiveParseFlags(lazy, pc->sc());
// The position passed to tokenStream.advance() is an offset of the sort
// returned by userbuf.offset() and expected by userbuf.rawCharPtrAt(),
// while LazyScript::{begin,end} offsets are relative to the outermost
// script source.
Rooted<LazyScript*> lazyOuter(context, handler.lazyOuterFunction());
uint32_t userbufBase = lazyOuter->begin() - lazyOuter->column();
if (!tokenStream.advance(fun->lazyScript()->end() - userbufBase))
if (!tokenStream.advance(fun->lazyScript()->end()))
return false;
#if JS_HAS_EXPR_CLOSURES

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

@ -561,17 +561,8 @@ class FunctionBox : public ObjectBox, public SharedContext
}
void setStart(const TokenStream& tokenStream) {
// Token positions are already offset from the start column in
// CompileOptions. bufStart and toStringStart, however, refer to
// absolute positions within the ScriptSource buffer, and need to
// de-offset from the starting column.
uint32_t offset = tokenStream.currentToken().pos.begin;
uint32_t sourceStartColumn = tokenStream.options().sourceStartColumn;
MOZ_ASSERT(offset >= sourceStartColumn);
MOZ_ASSERT(toStringStart >= sourceStartColumn);
toStringStart -= sourceStartColumn;
bufStart = offset - sourceStartColumn;
bufStart = offset;
tokenStream.srcCoords.lineNumAndColumnIndex(offset, &startLine, &startColumn);
}
@ -579,14 +570,9 @@ class FunctionBox : public ObjectBox, public SharedContext
// For all functions except class constructors, the buffer and
// toString ending positions are the same. Class constructors override
// the toString ending position with the end of the class definition.
//
// Offsets are de-offset for the same reason as in setStart above.
uint32_t offset = tokenStream.currentToken().pos.end;
uint32_t sourceStartColumn = tokenStream.options().sourceStartColumn;
MOZ_ASSERT(offset >= sourceStartColumn);
bufEnd = offset - sourceStartColumn;
toStringEnd = bufEnd;
bufEnd = offset;
toStringEnd = offset;
}
void trace(JSTracer* trc) override;

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

@ -248,8 +248,9 @@ TokenStreamAnyChars::reservedWordToPropertyName(TokenKind tt) const
return nullptr;
}
TokenStream::SourceCoords::SourceCoords(JSContext* cx, uint32_t ln)
: lineStartOffsets_(cx), initialLineNum_(ln), lastLineIndex_(0)
TokenStream::SourceCoords::SourceCoords(JSContext* cx, uint32_t ln, uint32_t col,
uint32_t initialLineOffset)
: lineStartOffsets_(cx), initialLineNum_(ln), initialColumn_(col), lastLineIndex_(0)
{
// This is actually necessary! Removing it causes compile errors on
// GCC and clang. You could try declaring this:
@ -260,12 +261,12 @@ TokenStream::SourceCoords::SourceCoords(JSContext* cx, uint32_t ln)
//
uint32_t maxPtr = MAX_PTR;
// The first line begins at buffer offset 0. MAX_PTR is the sentinel. The
// appends cannot fail because |lineStartOffsets_| has statically-allocated
// elements.
// The first line begins at buffer offset |initialLineOffset|. MAX_PTR is
// the sentinel. The appends cannot fail because |lineStartOffsets_| has
// statically-allocated elements.
MOZ_ASSERT(lineStartOffsets_.capacity() >= 2);
MOZ_ALWAYS_TRUE(lineStartOffsets_.reserve(2));
lineStartOffsets_.infallibleAppend(0);
lineStartOffsets_.infallibleAppend(initialLineOffset);
lineStartOffsets_.infallibleAppend(maxPtr);
}
@ -275,7 +276,8 @@ TokenStream::SourceCoords::add(uint32_t lineNum, uint32_t lineStartOffset)
uint32_t lineIndex = lineNumToIndex(lineNum);
uint32_t sentinelIndex = lineStartOffsets_.length() - 1;
MOZ_ASSERT(lineStartOffsets_[0] == 0 && lineStartOffsets_[sentinelIndex] == MAX_PTR);
MOZ_ASSERT(lineStartOffsets_[0] <= lineStartOffset &&
lineStartOffsets_[sentinelIndex] == MAX_PTR);
if (lineIndex == sentinelIndex) {
// We haven't seen this newline before. Update lineStartOffsets_
@ -303,6 +305,7 @@ TokenStream::SourceCoords::add(uint32_t lineNum, uint32_t lineStartOffset)
MOZ_ALWAYS_INLINE bool
TokenStreamAnyChars::SourceCoords::fill(const TokenStreamAnyChars::SourceCoords& other)
{
MOZ_ASSERT(lineStartOffsets_[0] == other.lineStartOffsets_[0]);
MOZ_ASSERT(lineStartOffsets_.back() == MAX_PTR);
MOZ_ASSERT(other.lineStartOffsets_.back() == MAX_PTR);
@ -380,21 +383,16 @@ TokenStreamAnyChars::SourceCoords::lineNum(uint32_t offset) const
uint32_t
TokenStreamAnyChars::SourceCoords::columnIndex(uint32_t offset) const
{
uint32_t lineIndex = lineIndexOf(offset);
uint32_t lineStartOffset = lineStartOffsets_[lineIndex];
MOZ_ASSERT(offset >= lineStartOffset);
return offset - lineStartOffset;
return lineIndexAndOffsetToColumn(lineIndexOf(offset), offset);
}
void
TokenStreamAnyChars::SourceCoords::lineNumAndColumnIndex(uint32_t offset, uint32_t* lineNum,
uint32_t* columnIndex) const
uint32_t* column) const
{
uint32_t lineIndex = lineIndexOf(offset);
*lineNum = lineIndexToNum(lineIndex);
uint32_t lineStartOffset = lineStartOffsets_[lineIndex];
MOZ_ASSERT(offset >= lineStartOffset);
*columnIndex = offset - lineStartOffset;
*column = lineIndexAndOffsetToColumn(lineIndex, offset);
}
#ifdef _MSC_VER
@ -404,7 +402,7 @@ TokenStreamAnyChars::SourceCoords::lineNumAndColumnIndex(uint32_t offset, uint32
TokenStreamAnyChars::TokenStreamAnyChars(JSContext* cx, const ReadOnlyCompileOptions& options,
StrictModeGetter* smg)
: srcCoords(cx, options.lineno),
: srcCoords(cx, options.lineno, options.column, options.scriptSourceOffset),
options_(options),
tokens(),
cursor(),
@ -425,7 +423,7 @@ TokenStreamAnyChars::TokenStreamAnyChars(JSContext* cx, const ReadOnlyCompileOpt
TokenStream::TokenStream(JSContext* cx, const ReadOnlyCompileOptions& options,
const CharT* base, size_t length, StrictModeGetter* smg)
: TokenStreamAnyChars(cx, options, smg),
userbuf(cx, base, length, options.column),
userbuf(cx, base, length, options.scriptSourceOffset),
tokenbuf(cx)
{
// Nb: the following tables could be static, but initializing them here is

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

@ -466,7 +466,8 @@ class TokenStreamAnyChars
// For a given buffer holding source code, |lineStartOffsets_| has one
// element per line of source code, plus one sentinel element. Each
// non-sentinel element holds the buffer offset for the start of the
// corresponding line of source code. For this example script:
// corresponding line of source code. For this example script,
// assuming an initialLineOffset of 0:
//
// 1 // xyz [line starts at offset 0]
// 2 var x; [line starts at offset 7]
@ -484,8 +485,8 @@ class TokenStreamAnyChars
// which is 14. (Note that |initialLineNum_| is often 1, but not
// always.)
//
// The first element is always 0, and the last element is always the
// MAX_PTR sentinel.
// The first element is always initialLineOffset, passed to the
// constructor, and the last element is always the MAX_PTR sentinel.
//
// offset-to-line/column lookups are O(log n) in the worst case (binary
// search), but in practice they're heavily clustered and we do better
@ -497,6 +498,7 @@ class TokenStreamAnyChars
//
Vector<uint32_t, 128> lineStartOffsets_;
uint32_t initialLineNum_;
uint32_t initialColumn_;
// This is mutable because it's modified on every search, but that fact
// isn't visible outside this class.
@ -508,9 +510,17 @@ class TokenStreamAnyChars
uint32_t lineIndexToNum(uint32_t lineIndex) const { return lineIndex + initialLineNum_; }
uint32_t lineNumToIndex(uint32_t lineNum) const { return lineNum - initialLineNum_; }
uint32_t lineIndexAndOffsetToColumn(uint32_t lineIndex, uint32_t offset) const {
uint32_t lineStartOffset = lineStartOffsets_[lineIndex];
MOZ_RELEASE_ASSERT(offset >= lineStartOffset);
uint32_t column = offset - lineStartOffset;
if (lineIndex == 0)
return column + initialColumn_;
return column;
}
public:
SourceCoords(JSContext* cx, uint32_t ln);
SourceCoords(JSContext* cx, uint32_t ln, uint32_t col, uint32_t initialLineOffset);
MOZ_MUST_USE bool add(uint32_t lineNum, uint32_t lineStartOffset);
MOZ_MUST_USE bool fill(const SourceCoords& other);
@ -526,7 +536,7 @@ class TokenStreamAnyChars
uint32_t lineNum(uint32_t offset) const;
uint32_t columnIndex(uint32_t offset) const;
void lineNumAndColumnIndex(uint32_t offset, uint32_t* lineNum, uint32_t* columnIndex) const;
void lineNumAndColumnIndex(uint32_t offset, uint32_t* lineNum, uint32_t* column) const;
};
SourceCoords srcCoords;

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

@ -477,6 +477,17 @@ js::Nursery::renderProfileJSON(JSONPrinter& json) const
return;
}
if (previousGC.reason == JS::gcreason::NO_REASON) {
// If the nursery was empty when the last minorGC was requested, then
// no nursery collection will have been performed but JSON may still be
// requested. (And as a public API, this function should not crash in
// such a case.)
json.beginObject();
json.property("status", "no collection");
json.endObject();
return;
}
json.beginObject();
json.property("reason", JS::gcreason::ExplainReason(previousGC.reason));
@ -601,6 +612,7 @@ js::Nursery::collect(JS::gcreason::Reason reason)
TenureCountCache tenureCounts;
double promotionRate = 0;
previousGC.reason = JS::gcreason::NO_REASON;
if (!isEmpty())
promotionRate = doCollection(reason, tenureCounts);

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

@ -0,0 +1,38 @@
load(libdir + "evalInFrame.js");
// Test that computing the implicit 'this' in calls for D.F.eval is as if it
// were a pasted-in eval.
var G = this;
function globalFun(check, expectedThis) {
if (check)
assertEq(this, expectedThis);
return this;
}
var expectedGlobalFunThis = globalFun(false);
evalInFrame(0, "globalFun(true, expectedGlobalFunThis)");
(function testInnerFun() {
function innerFun(check, expectedThis) {
if (check)
assertEq(this, expectedThis);
return this;
}
var expectedInnerFunThis = innerFun(false);
evalInFrame(0, "innerFun(true, expectedInnerFunThis)");
})();
(function testWith() {
var o = {
withFun: function withFun(check, expectedThis) {
if (check)
assertEq(this, expectedThis);
return this;
}
};
with (o) {
var expectedWithFunThis = withFun(false);
evalInFrame(0, "withFun(true, expectedWithFunThis)");
}
})();

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

@ -0,0 +1 @@
evaluate("\n(y => 1)()", { columnNumber: 1729 })

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

@ -0,0 +1,20 @@
load(libdir + "asserts.js");
let foo = {};
for (let method of ["resolve", "reject", "race"]) {
assertErrorMessage(
() => Promise[method].call(foo),
TypeError,
"foo is not a constructor"
);
assertErrorMessage(
() => Promise[method].call(foo, []),
TypeError,
"foo is not a constructor"
);
assertErrorMessage(
() => Promise[method].call({}, [], foo),
TypeError,
"({}) is not a constructor"
);
}

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

@ -6455,18 +6455,31 @@ IonBuilder::jsop_initprop(PropertyName* name)
useSlowPath = true;
}
if (useSlowPath) {
current->pop();
MInitProp* init = MInitProp::New(alloc(), obj, name, value);
current->add(init);
return resumeAfter(init);
}
MInstruction* last = *current->rbegin();
// This is definitely initializing an 'own' property of the object, treat
// it as an assignment.
MOZ_TRY(jsop_setprop(name));
if (!useSlowPath && !forceInlineCaches()) {
// This is definitely initializing an 'own' property of the object, treat
// it as an assignment.
MOZ_TRY(jsop_setprop(name));
} else {
if (*pc != JSOP_INITPROP) {
current->pop();
MInitProp* init = MInitProp::New(alloc(), obj, name, value);
current->add(init);
return resumeAfter(init);
}
MDefinition* value = current->pop();
MDefinition* obj = current->pop();
TemporaryTypeSet* objTypes = obj->resultTypeSet();
bool barrier = PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current, &obj, name, &value,
/* canModify = */ true);
bool emitted = false;
MOZ_TRY(setPropTryCache(&emitted, obj, name, value, barrier, objTypes));
MOZ_ASSERT(emitted == true);
}
// SETPROP pushed the value, instead of the object. Fix this on the stack,
// and check the most recent resume point to see if it needs updating too.

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

@ -6187,36 +6187,33 @@ jit::PropertyReadNeedsTypeBarrier(JSContext* propertycx,
// If this access has never executed, try to add types to the observed set
// according to any property which exists on the object or its prototype.
if (observed->empty() && name) {
JSObject* obj;
if (key->isSingleton())
obj = key->singleton();
else
obj = key->proto().isDynamic() ? nullptr : key->proto().toObjectOrNull();
while (obj) {
if (!obj->getClass()->isNative())
TypeSet::ObjectKey* obj = key;
do {
if (!obj->clasp()->isNative())
break;
TypeSet::ObjectKey* key = TypeSet::ObjectKey::get(obj);
if (propertycx)
key->ensureTrackedProperty(propertycx, NameToId(name));
obj->ensureTrackedProperty(propertycx, NameToId(name));
if (!key->unknownProperties()) {
HeapTypeSetKey property = key->property(NameToId(name));
if (property.maybeTypes()) {
TypeSet::TypeList types;
if (!property.maybeTypes()->enumerateTypes(&types))
break;
if (types.length() == 1) {
// Note: the return value here is ignored.
observed->addType(types[0], GetJitContext()->temp->lifoAlloc());
break;
}
if (obj->unknownProperties())
break;
HeapTypeSetKey property = obj->property(NameToId(name));
if (property.maybeTypes()) {
TypeSet::TypeList types;
if (!property.maybeTypes()->enumerateTypes(&types))
break;
if (types.length() == 1) {
// Note: the return value here is ignored.
observed->addType(types[0], GetJitContext()->temp->lifoAlloc());
}
break;
}
obj = obj->staticPrototype();
}
if (!obj->proto().isObject())
break;
obj = TypeSet::ObjectKey::get(obj->proto().toObject());
} while (obj);
}
// If any objects which could be observed are similar to ones that have

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

@ -3942,7 +3942,7 @@ JS::ReadOnlyCompileOptions::copyPODOptions(const ReadOnlyCompileOptions& rhs)
copyPODTransitiveOptions(rhs);
lineno = rhs.lineno;
column = rhs.column;
sourceStartColumn = rhs.sourceStartColumn;
scriptSourceOffset = rhs.scriptSourceOffset;
isRunOnce = rhs.isRunOnce;
noScriptRval = rhs.noScriptRval;
}

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

@ -3978,7 +3978,7 @@ class JS_FRIEND_API(ReadOnlyCompileOptions) : public TransitiveCompileOptions
: TransitiveCompileOptions(),
lineno(1),
column(0),
sourceStartColumn(0),
scriptSourceOffset(0),
isRunOnce(false),
noScriptRval(false)
{ }
@ -4001,7 +4001,18 @@ class JS_FRIEND_API(ReadOnlyCompileOptions) : public TransitiveCompileOptions
// POD options.
unsigned lineno;
unsigned column;
unsigned sourceStartColumn;
// The offset within the ScriptSource's full uncompressed text of the first
// character we're presenting for compilation with this CompileOptions.
//
// When we compile a LazyScript, we pass the compiler only the substring of
// the source the lazy function occupies. With chunked decompression, we
// may not even have the complete uncompressed source present in memory. But
// parse node positions are offsets within the ScriptSource's full text,
// and LazyScripts indicate their substring of the full source by its
// starting and ending offsets within the full text. This
// scriptSourceOffset field lets the frontend convert between these
// offsets and offsets within the substring presented for compilation.
unsigned scriptSourceOffset;
// isRunOnce only applies to non-function scripts.
bool isRunOnce;
bool noScriptRval;
@ -4074,12 +4085,8 @@ class JS_FRIEND_API(OwningCompileOptions) : public ReadOnlyCompileOptions
return *this;
}
OwningCompileOptions& setUTF8(bool u) { utf8 = u; return *this; }
OwningCompileOptions& setColumn(unsigned c, unsigned ssc) {
MOZ_ASSERT(ssc <= c);
column = c;
sourceStartColumn = ssc;
return *this;
}
OwningCompileOptions& setColumn(unsigned c) { column = c; return *this; }
OwningCompileOptions& setScriptSourceOffset(unsigned o) { scriptSourceOffset = o; return *this; }
OwningCompileOptions& setIsRunOnce(bool once) { isRunOnce = once; return *this; }
OwningCompileOptions& setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
OwningCompileOptions& setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }
@ -4175,12 +4182,8 @@ class MOZ_STACK_CLASS JS_FRIEND_API(CompileOptions) final : public ReadOnlyCompi
return *this;
}
CompileOptions& setUTF8(bool u) { utf8 = u; return *this; }
CompileOptions& setColumn(unsigned c, unsigned ssc) {
MOZ_ASSERT(ssc <= c);
column = c;
sourceStartColumn = ssc;
return *this;
}
CompileOptions& setColumn(unsigned c) { column = c; return *this; }
CompileOptions& setScriptSourceOffset(unsigned o) { scriptSourceOffset = o; return *this; }
CompileOptions& setIsRunOnce(bool once) { isRunOnce = once; return *this; }
CompileOptions& setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
CompileOptions& setSelfHostingMode(bool shm) { selfHostingMode = shm; return *this; }

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

@ -2326,7 +2326,6 @@ ScriptSource::initFromOptions(JSContext* cx, const ReadOnlyCompileOptions& optio
introductionType_ = options.introductionType;
setIntroductionOffset(options.introductionOffset);
startColumn_ = options.sourceStartColumn;
parameterListEnd_ = parameterListEnd.isSome() ? parameterListEnd.value() : 0;
if (options.hasIntroductionInfo) {

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

@ -434,12 +434,6 @@ class ScriptSource
UniqueTwoByteChars sourceMapURL_;
bool mutedErrors_;
// The start column of the source. Offsets kept for toString and the
// function source in LazyScripts are absolute positions within a
// ScriptSource buffer. To get their positions, they need to be offset
// with the starting column.
uint32_t startColumn_;
// bytecode offset in caller script that generated this code.
// This is present for eval-ed code, as well as "new Function(...)"-introduced
// scripts.
@ -516,7 +510,6 @@ class ScriptSource
displayURL_(nullptr),
sourceMapURL_(nullptr),
mutedErrors_(false),
startColumn_(0),
introductionOffset_(0),
parameterListEnd_(0),
introducerFilename_(nullptr),
@ -631,8 +624,6 @@ class ScriptSource
bool mutedErrors() const { return mutedErrors_; }
uint32_t startColumn() const { return startColumn_; }
bool hasIntroductionOffset() const { return hasIntroductionOffset_; }
uint32_t introductionOffset() const {
MOZ_ASSERT(hasIntroductionOffset());

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

@ -1305,7 +1305,7 @@ ParseCompileOptions(JSContext* cx, CompileOptions& options, HandleObject opts,
int32_t c;
if (!ToInt32(cx, v, &c))
return false;
options.setColumn(c, c);
options.setColumn(c);
}
if (!JS_GetProperty(cx, opts, "sourceIsLazy", &v))

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

@ -1470,6 +1470,12 @@ ComputeImplicitThis(JSObject* obj)
if (IsCacheableEnvironment(obj))
return UndefinedValue();
// Debugger environments need special casing, as despite being
// non-syntactic, they wrap syntactic environments and should not be
// treated like other embedding-specific non-syntactic environments.
if (obj->is<DebugEnvironmentProxy>())
return ComputeImplicitThis(&obj->as<DebugEnvironmentProxy>().environment());
return GetThisValue(obj);
}

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

@ -1063,7 +1063,13 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
nsIDocShell *docShell = window->GetDocShell();
NS_ENSURE_TRUE(docShell, NS_ERROR_UNEXPECTED);
docShell->GetRestoringDocument(&restoring);
// Unfortunately, docShell->GetRestoringDocument() might no longer be set
// correctly. In particular, it can be false by now if someone took it upon
// themselves to block onload from inside restoration and unblock it later.
// But we can detect the restoring case very simply: by whether our
// document's readyState is COMPLETE.
restoring = (mDocument->GetReadyStateEnum() ==
nsIDocument::READYSTATE_COMPLETE);
if (!restoring) {
NS_ASSERTION(mDocument->IsXULDocument() || // readyState for XUL is bogus
mDocument->GetReadyStateEnum() ==
@ -1074,6 +1080,13 @@ nsDocumentViewer::LoadComplete(nsresult aStatus)
nsIDocument::READYSTATE_UNINITIALIZED &&
NS_IsAboutBlank(mDocument->GetDocumentURI())),
"Bad readystate");
#ifdef DEBUG
bool docShellThinksWeAreRestoring;
docShell->GetRestoringDocument(&docShellThinksWeAreRestoring);
MOZ_ASSERT(!docShellThinksWeAreRestoring,
"How can docshell think we are restoring if we don't have a "
"READYSTATE_COMPLETE document?");
#endif // DEBUG
nsCOMPtr<nsIDocument> d = mDocument;
mDocument->SetReadyStateInternal(nsIDocument::READYSTATE_COMPLETE);

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

@ -1413,10 +1413,15 @@ nsPresContext::SetFullZoom(float aZoom)
void
nsPresContext::SetOverrideDPPX(float aDPPX)
{
mOverrideDPPX = aDPPX;
// SetOverrideDPPX is called during navigations, including history
// traversals. In that case, it's typically called with our current value,
// and we don't need to actually do anything.
if (aDPPX != mOverrideDPPX) {
mOverrideDPPX = aDPPX;
if (HasCachedStyleData()) {
MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
if (HasCachedStyleData()) {
MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
}
}
}

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

@ -0,0 +1,2 @@
<body onload='parent.childLoaded()' style='background:lime'>
<p>Hello<p>Hello<p>Hello<p>Hello<p>Hello<p>

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

@ -27,7 +27,7 @@ SimpleTest.waitForExplicitFinish();
window.onload = function() {
window.waitForAllPaintsFlushed(function () {
// Supply random key to ensure load actually happens
ourFrame.src = "data:text/html,<body onload='parent.childLoaded()' style='background:lime'><p>Hello<p>Hello<p>Hello<p>Hello<p>Hello<p>" + Math.random();
ourFrame.src = "bug1041200_frame.html?" + Math.random();
}, document.getElementById("ourFrame").contentDocument);
};

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

@ -8,6 +8,7 @@ support-files =
chrome_content_integration_window.xul
default_background_window.xul
dialog_with_positioning_window.xul
file_bug458898.html
no_clip_iframe_subdoc.html
no_clip_iframe_window.xul
printpreview_bug396024_helper.xul
@ -30,7 +31,9 @@ skip-if = os == 'linux' && !debug # Bug 1208197
[test_bug847890_paintFlashing.html]
[test_bug1018265.xul]
[test_bug1041200.xul]
support-files=bug1041200_window.html
support-files =
bug1041200_frame.html
bug1041200_window.html
[test_chrome_content_integration.xul]
[test_chrome_over_plugin.xul]
support-files =

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

@ -0,0 +1 @@
<div style='height:200px; width:100px;'>

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

@ -18,7 +18,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=458898
<script class="testbody" type="text/javascript">
SimpleTest.waitForExplicitFinish();
var win = window.openDialog("data:text/html,<div style='height:200px; width:100px;'>");
var win = window.openDialog("file_bug458898.html");
function loaded() {
var disableWindowResizePref = "dom.disable_window_move_resize";

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

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=391747
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=391747">Mozilla Bug 391747</a>
<p id="display"></p>
<div id="content" style="display: block">
<iframe id="iframe_391747" src="data:text/html,<table><tr><td style='width:500px;height:500px;border:1px solid blue'>x</td>"></iframe>
<iframe id="iframe_391747" srcdoc="<table><tr><td style='width:500px;height:500px;border:1px solid blue'>x</td>"></iframe>
</div>
<pre id="test">
<script class="testbody" type="text/javascript">

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

@ -25,7 +25,7 @@ SimpleTest.waitForExplicitFinish();
var f = document.createElement('iframe');
document.body.appendChild(f);
src = "data:text/html,<meta charset='utf-8'><body><p id='sel'>Selection</p><scr" + "ipt>"
src = "<meta charset='utf-8'><body><p id='sel'>Selection</p><scr" + "ipt>"
src += "try {"
src += "var range = document.createRange();"
src += "range.selectNode(document.getElementById('sel'));"
@ -37,7 +37,7 @@ src += "parent.is(sel.toString(), 'Selection', 'Selection.toString() after expli
src += "} finally { parent.ok(true,'silence no test run warning'); parent.SimpleTest.finish(); }"
src += "</scr"+"ipt>";
f.src = src;
f.srcdoc = src;
</script>
</pre>

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

@ -18,6 +18,6 @@ i.onload = function() {
"Check whether an error was reported");
SimpleTest.finish();
};
i.src = "data:text/html,<base href='http://basetag/basetag'><video id='v' onerror='v.failed=true'></video>";
i.srcdoc = "<base href='http://basetag/basetag'><video id='v' onerror='v.failed=true'></video>";
</script>

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

@ -20,7 +20,7 @@
<embed id="p1" type="application/x-test"
style="position:absolute; left:300px; top:10px;"></embed>
<iframe id="f1" style="position:absolute; left:0; top:250px;"
src="data:text/html,&lt;embed id='p2' type='application/x-test' style='position:absolute; left:10px; top:10px'&gt;"></iframe>
srcdoc="&lt;embed id='p2' type='application/x-test' style='position:absolute; left:10px; top:10px'&gt;"></iframe>
<embed id="p3" type="application/x-test"
style="position:absolute; left:320px; top:250px;
outline:5px solid blue;

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

@ -32,6 +32,6 @@ function runtest() {
});
}
</script>
<iframe onload="runtest()" id="iframe" class="" src="data:text/html,<p>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br></p>"></iframe><br>
<iframe onload="runtest()" id="iframe" class="" srcdoc="<p>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br>bla<br></p>"></iframe><br>
</body>
</html>

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

@ -41,7 +41,7 @@
<body>
<div id="div1" class="testingDiv">
aaaaaaa
<iframe id="iframe" src="data:text/html,<style type='text/css'>*{margin: 0; padding: 0; font-size: 16px;}</style><div>ffffff ffffff ffffff ffffff</div>"></iframe>
<iframe id="iframe" srcdoc="<style type='text/css'>*{margin: 0; padding: 0; font-size: 16px;}</style><div>ffffff ffffff ffffff ffffff</div>"></iframe>
aaaaaaa aaaaaaa<br>aaaaaaa aaaaaaa aaaaaaa aaaaaaa<br>aaaaaaa
</div>
<div id="div2" class="testingDiv">

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

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=462789
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=462789">Mozilla Bug 462789</a>
<p id="display"><iframe id="bug462789_iframe" src="data:text/html,<html><head><style>*{color:black;}</style></head><body>xxx" style="display: none;"></iframe></p>
<p id="display"><iframe id="bug462789_iframe" srcdoc="<html><head><style>*{color:black;}</style></head><body>xxx" style="display: none;"></iframe></p>
<div id="content" style="display: none">
</div>

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

@ -0,0 +1,6 @@
<div id=div style="display:none">Page 1</div>
<script>
window.onload = function() {
opener.postMessage("loaded", "*");
}
</script>

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

@ -0,0 +1,6 @@
<div>Page 2</div>
<script>
window.onload = function() {
opener.postMessage("loaded", "*");
}
</script>;

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

@ -10,6 +10,8 @@ support-files =
descriptor_database.js
display_mode_reflow_iframe.html
empty.html
file_computed_style_bfcache_display_none.html
file_computed_style_bfcache_display_none2.html
media_queries_dynamic_xbl_binding.xml
media_queries_dynamic_xbl_iframe.html
media_queries_dynamic_xbl_style.css

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

@ -10,20 +10,19 @@ SimpleTest.waitForExplicitFinish();
let testDiv;
let loadedPromiseResolve;
const TEST_PATH = "http://mochi.test:8888/tests/layout/style/test/";
const TEST_FILE1 = TEST_PATH + "file_computed_style_bfcache_display_none.html";
const TEST_FILE2 = TEST_PATH + "file_computed_style_bfcache_display_none2.html";
// Open a new window.
const w = window.open('data:text/html,'
+ '<div id=div style="display:none">Page 1</div>'
+ '<script>window.onload = function() { '
+ 'opener.postMessage("loaded", "*"); }</' + 'script>');
const w = window.open(TEST_FILE1);
waitForLoadMessage().then(() => {
// Take a reference to a node in the new window.
testDiv = w.document.getElementById('div');
// Open a new document so that the test div now refers to a node in a
// document in the bfcache.
w.location = 'data:text/html,<div>Page 2</div>'
+ '<script>window.onload = function() { '
+ 'opener.postMessage("loaded", "*"); }</' + 'script>';
w.location = TEST_FILE2;
return waitForLoadMessage();
}).then(() => {
// Compute styles for the node in the bfcache document.

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

@ -0,0 +1,8 @@
// SJS file for test_bug386386.html
"use strict";
function handleRequest(request, response) {
response.setHeader("Cache-Control", "no-cache", false);
response.setHeader("Content-Type", "application/vnd.mozilla.xul+xml;charset=utf-8", false);
response.write("%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Cwindow%3E%3C/window%3E");
}

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

@ -1,5 +1,6 @@
[DEFAULT]
support-files =
file_bug386386.sjs
[test_bug386386.html]
[test_bug394800.xhtml]
[test_bug511075.html]

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

@ -7,7 +7,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=386386
</head>
<body>
<iframe id="test386386" src="data:application/vnd.mozilla.xul+xml;charset=utf-8,%3C%3Fxml%20version%3D%221.0%22%3F%3E%0A%3Cwindow%3E%3C/window%3E"></iframe>
<iframe id="test386386" src="file_bug386386.sjs"></iframe>
<script class="testbody" type="application/javascript">

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

@ -10,7 +10,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=563416
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=563416">Mozilla Bug 563416</a>
<p id="display"><iframe id="test" src='data:text/html,<textarea style="box-sizing:content-box; -moz-appearance:none; height: 0px; padding: 0px;" cols="20" rows="10">hsldkjvmshlkkajskdlfksdjflskdjflskdjflskdjflskdjfddddddddd</textarea>'></iframe></p>
<p id="display"><iframe id="test" srcdoc='<textarea style="box-sizing:content-box; -moz-appearance:none; height: 0px; padding: 0px;" cols="20" rows="10">hsldkjvmshlkkajskdlfksdjflskdjflskdjflskdjflskdjfddddddddd</textarea>'></iframe></p>
<div id="content" style="display: none">
</div>

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

@ -105,6 +105,16 @@ Preferences::DirtyCallback()
NS_WARNING_ASSERTION(!sPreferences->mProfileShutdown,
"Setting user pref after profile shutdown.");
if (sPreferences->AllowOffMainThreadSave() && !sPreferences->mSavePending) {
sPreferences->mSavePending = true;
static const int PREF_DELAY_MS = 500;
NS_DelayedDispatchToCurrentThread(
mozilla::NewRunnableMethod("Preferences::SavePrefFileAsynchronous",
sPreferences,
&Preferences::SavePrefFileAsynchronous),
PREF_DELAY_MS);
}
}
}
@ -1158,6 +1168,8 @@ Preferences::SavePrefFileInternal(nsIFile *aFile, SaveMethod aSaveMethod)
// unmodified pref file (see the original bug 160377 when we added this.)
if (nullptr == aFile) {
mSavePending = false;
// Off main thread writing only if allowed
if (!AllowOffMainThreadSave()) {
aSaveMethod = SaveMethod::Blocking;

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

@ -487,6 +487,9 @@ private:
nsCOMPtr<nsIFile> mCurrentFile;
bool mDirty = false;
bool mProfileShutdown = false;
// we wait a bit after prefs are dirty before writing them. In this
// period, mDirty and mSavePending will both be true.
bool mSavePending = false;
static Preferences* sPreferences;
static nsIPrefBranch* sRootBranch;

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

@ -720,6 +720,7 @@ pref("apz.overscroll.stretch_factor", "0.35");
pref("apz.paint_skipping.enabled", true);
// Fetch displayport updates early from the message queue
pref("apz.peek_messages.enabled", true);
pref("apz.popups.enabled", false);
// Whether to print the APZC tree for debugging
pref("apz.printtree", false);
@ -4737,7 +4738,7 @@ pref("network.tcp.keepalive.retry_interval", 1); // seconds
pref("network.tcp.keepalive.probe_count", 4);
#endif
pref("network.tcp.tcp_fastopen_enable", false);
pref("network.tcp.tcp_fastopen_enable", true);
pref("network.tcp.tcp_fastopen_consecutive_failure_limit", 5);
// Whether to disable acceleration for all widgets.

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