Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2016-04-13 11:58:47 +02:00
commit 4c2ef97599
287 changed files with 3044 additions and 1896 deletions

View File

@ -228,6 +228,8 @@ EventTree::Process()
if (mFireReorder) {
nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_REORDER, mContainer);
}
mDependentEvents.Clear();
}
}
@ -384,6 +386,23 @@ EventTree::FindOrInsert(Accessible* aContainer)
return prevNode->mNext = new EventTree(aContainer);
}
void
EventTree::Clear()
{
mFirst = nullptr;
mNext = nullptr;
mContainer = nullptr;
uint32_t eventsCount = mDependentEvents.Length();
for (uint32_t jdx = 0; jdx < eventsCount; jdx++) {
AccHideEvent* ev = downcast_accEvent(mDependentEvents[jdx]);
if (ev && ev->NeedsShutdown()) {
ev->GetDocAccessible()->ShutdownChildrenInSubtree(ev->mAccessible);
}
}
mDependentEvents.Clear();
}
const EventTree*
EventTree::Find(const Accessible* aContainer) const
{
@ -458,13 +477,13 @@ EventTree::Mutated(AccMutationEvent* aEv)
{
// If shown or hidden node is a root of previously mutated subtree, then
// discard those subtree mutations as we are no longer interested in them.
EventTree* node = mFirst;
while (node) {
if (node->mContainer == aEv->mAccessible) {
node->Clear();
nsAutoPtr<EventTree>* node = &mFirst;
while (*node) {
if ((*node)->mContainer == aEv->mAccessible) {
*node = Move((*node)->mNext);
break;
}
node = node->mNext;
node = &(*node)->mNext;
}
AccMutationEvent* prevEvent = mDependentEvents.SafeLastElement(nullptr);

View File

@ -56,7 +56,7 @@ private:
class EventTree final {
public:
EventTree() :
mFirst(nullptr), mNext(nullptr), mContainer(nullptr), mFireReorder(true) { }
mFirst(nullptr), mNext(nullptr), mContainer(nullptr), mFireReorder(false) { }
explicit EventTree(Accessible* aContainer) :
mFirst(nullptr), mNext(nullptr), mContainer(aContainer), mFireReorder(true) { }
~EventTree() { Clear(); }
@ -94,7 +94,7 @@ private:
EventTree* FindOrInsert(Accessible* aContainer);
void Mutated(AccMutationEvent* aEv);
void Clear() { mFirst = nullptr; mNext = nullptr; mContainer = nullptr; }
void Clear();
nsAutoPtr<EventTree> mFirst;
nsAutoPtr<EventTree> mNext;

View File

@ -13,6 +13,8 @@
<script type="application/javascript"
src="../common.js"></script>
<script type="application/javascript"
src="../states.js"></script>
<script type="application/javascript"
src="../events.js"></script>
@ -349,11 +351,81 @@
}
}
/**
* Remove a child, and then its parent.
*/
function test3()
{
this.o = getAccessible("t3_o");
this.ofc = getAccessible("t3_o").firstChild;
this.eventSeq = [
new invokerChecker(EVENT_HIDE, this.o),
new invokerChecker(EVENT_REORDER, "t3_lb"),
new unexpectedInvokerChecker(EVENT_HIDE, this.ofc),
new unexpectedInvokerChecker(EVENT_REORDER, this.o)
];
this.invoke = function test3_invoke()
{
getNode("t3_o").textContent = "";
getNode("t3_lb").removeChild(getNode("t3_o"));
}
this.finalCheck = function test3_finalCheck()
{
testIsDefunct(this.o);
testIsDefunct(this.ofc);
}
this.getID = function test3_getID() {
return "remove a child, and then its parent";
}
}
/**
* Remove children, and then a parent of 2nd child.
*/
function test4()
{
this.o1 = getAccessible("t4_o1");
this.o1fc = this.o1.firstChild;
this.o2 = getAccessible("t4_o2");
this.o2fc = this.o2.firstChild;
this.eventSeq = [
new invokerChecker(EVENT_HIDE, this.o1fc),
new invokerChecker(EVENT_HIDE, this.o2),
new invokerChecker(EVENT_REORDER, "t4_lb"),
new unexpectedInvokerChecker(EVENT_HIDE, this.o2fc),
new unexpectedInvokerChecker(EVENT_REORDER, this.o1),
new unexpectedInvokerChecker(EVENT_REORDER, this.o2)
];
this.invoke = function test4_invoke()
{
getNode("t4_o1").textContent = "";
getNode("t4_o2").textContent = "";
getNode("t4_lb").removeChild(getNode("t4_o2"));
}
this.finalCheck = function test4_finalCheck()
{
testIsDefunct(this.o1fc);
testIsDefunct(this.o2);
testIsDefunct(this.o2fc);
}
this.getID = function test4_getID() {
return "remove children, and then a parent of 2nd child";
}
}
////////////////////////////////////////////////////////////////////////////
// Do tests.
//gA11yEventDumpToConsole = true; // debug stuff
//enableLogging("events,tree,eventTree,verbose");
//enableLogging("tree,eventTree,verbose");
var gQueue = null;
function doTests()
@ -377,6 +449,8 @@
gQueue.push(new showParentNAddChild("select12", true));
gQueue.push(new removeGrandChildrenNHideParent("t1_child1", "t1_child2", "t1_parent"));
gQueue.push(new test3());
gQueue.push(new test4());
gQueue.invoke(); // Will call SimpleTest.finish();
}
@ -447,5 +521,18 @@
<div id="t1_mid2"><div id="t1_child2"></div></div>
</div>
</div>
<div id="t3">
<div role="listbox" id="t3_lb">
<div role="option" id="t3_o">opt</div>
</div>
</div>
<div id="t4">
<div role="listbox" id="t4_lb">
<div role="option" id="t4_o1">opt1</div>
<div role="option" id="t4_o2">opt2</div>
</div>
</div>
</body>
</html>

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 121389802,
"digest": "2be6b42cfa1e92de4b49a57123f54043fec2d3cf8385276516dc6aaed99c88768ac4aebd7ce2e007ab074163523da29223436a4d1aef82f0f750f08f1b14cd71",
"version": "clang 3.8.0",
"size": 133060926,
"digest": "aff5ad3ac2d41db19d1ba0df5f97b189a7d7e1b6af8c56e22c2b0cced84d75fa98394ded6a4ba5713652e6684a0a46f47aeccf87991f9e849bf8d7d82e564f6f",
"algorithm": "sha512",
"filename": "clang.tar.bz2",
"unpack": true

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 121389802,
"digest": "2be6b42cfa1e92de4b49a57123f54043fec2d3cf8385276516dc6aaed99c88768ac4aebd7ce2e007ab074163523da29223436a4d1aef82f0f750f08f1b14cd71",
"version": "clang 3.8.0",
"size": 133060926,
"digest": "aff5ad3ac2d41db19d1ba0df5f97b189a7d7e1b6af8c56e22c2b0cced84d75fa98394ded6a4ba5713652e6684a0a46f47aeccf87991f9e849bf8d7d82e564f6f",
"algorithm": "sha512",
"filename": "clang.tar.bz2",
"unpack": true

View File

@ -127,7 +127,6 @@ support-files =
!/toolkit/components/passwordmgr/test/browser/insecure_test.html
!/toolkit/components/passwordmgr/test/browser/insecure_test_subframe.html
!/toolkit/content/tests/browser/common/mockTransfer.js
!/toolkit/crashreporter/test/browser/crashreport.sjs
!/toolkit/modules/tests/browser/metadata_*.html
!/toolkit/mozapps/extensions/test/xpinstall/amosigned.xpi
!/toolkit/mozapps/extensions/test/xpinstall/corrupt.xpi

View File

@ -1,6 +1,8 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// This is testing the aboutCertError page (Bug 1207107).
const GOOD_PAGE = "https://example.com/";
@ -149,15 +151,15 @@ add_task(function* checkAdvancedDetails() {
};
});
is(message.divDisplay, "block", "Debug information is visible");
ok(message.text.contains(BAD_CERT), "Correct URL found");
ok(message.text.contains("Certificate has expired"),
ok(message.text.includes(BAD_CERT), "Correct URL found");
ok(message.text.includes("Certificate has expired"),
"Correct error message found");
ok(message.text.contains("HTTP Strict Transport Security: false"),
ok(message.text.includes("HTTP Strict Transport Security: false"),
"Correct HSTS value found");
ok(message.text.contains("HTTP Public Key Pinning: false"),
ok(message.text.includes("HTTP Public Key Pinning: false"),
"Correct HPKP value found");
let certChain = getCertChain(message.securityInfoAsString);
ok(message.text.contains(certChain), "Found certificate chain");
ok(message.text.includes(certChain), "Found certificate chain");
gBrowser.removeCurrentTab();
});
@ -221,15 +223,15 @@ add_task(function* checkAdvancedDetailsForHSTS() {
};
});
is(message.divDisplay, "block", "Debug information is visible");
ok(message.text.contains(badStsUri.spec), "Correct URL found");
ok(message.text.contains("requested domain name does not match the server's certificate"),
ok(message.text.includes(badStsUri.spec), "Correct URL found");
ok(message.text.includes("requested domain name does not match the server's certificate"),
"Correct error message found");
ok(message.text.contains("HTTP Strict Transport Security: false"),
ok(message.text.includes("HTTP Strict Transport Security: false"),
"Correct HSTS value found");
ok(message.text.contains("HTTP Public Key Pinning: true"),
ok(message.text.includes("HTTP Public Key Pinning: true"),
"Correct HPKP value found");
let certChain = getCertChain(message.securityInfoAsString);
ok(message.text.contains(certChain), "Found certificate chain");
ok(message.text.includes(certChain), "Found certificate chain");
gBrowser.removeCurrentTab();
});

View File

@ -15,5 +15,5 @@ add_task(function* () {
yield promiseRemoveTab(tab);
let closedTabData = ss.getClosedTabData(window);
ok(!closedTabData.contains(r), "tab not stored in _closedTabs");
ok(!closedTabData.includes(r), "tab not stored in _closedTabs");
});

View File

@ -17,5 +17,5 @@ add_task(function* () {
yield promiseRemoveTab(tab);
let closedTabData = ss.getClosedTabData(window);
ok(!closedTabData.contains(r), "tab not stored in _closedTabs");
ok(!closedTabData.includes(r), "tab not stored in _closedTabs");
});

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 106877168,
"digest": "1c50c6348eaf429ed59bb603cff63bcc1f870f59216dd3c234db5b1156cfd351d5ee7b820ec31be4d2661eb4213b2e0030e2ba2782b42905d1ec19c7f8bd322a",
"version": "clang 3.8.0, libgcc 4.8.5",
"size": 118876936,
"digest": "f021d7b23cbbcc4086514b4bf20c86c9f94dbe5b4e0f1ef3aaf2bea337430f7c0d0965c55fe8be0e944a46c3b1555b9245c7af8b8b141eac4b47deea977b4852",
"algorithm": "sha512",
"filename": "clang.tar.xz",
"unpack": true,

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 106877168,
"digest": "1c50c6348eaf429ed59bb603cff63bcc1f870f59216dd3c234db5b1156cfd351d5ee7b820ec31be4d2661eb4213b2e0030e2ba2782b42905d1ec19c7f8bd322a",
"version": "clang 3.8.0, libgcc 4.8.5",
"size": 118876936,
"digest": "f021d7b23cbbcc4086514b4bf20c86c9f94dbe5b4e0f1ef3aaf2bea337430f7c0d0965c55fe8be0e944a46c3b1555b9245c7af8b8b141eac4b47deea977b4852",
"algorithm": "sha512",
"filename": "clang.tar.xz",
"unpack": true

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 106877168,
"digest": "1c50c6348eaf429ed59bb603cff63bcc1f870f59216dd3c234db5b1156cfd351d5ee7b820ec31be4d2661eb4213b2e0030e2ba2782b42905d1ec19c7f8bd322a",
"version": "clang 3.8.0, libgcc 4.8.5",
"size": 118876936,
"digest": "f021d7b23cbbcc4086514b4bf20c86c9f94dbe5b4e0f1ef3aaf2bea337430f7c0d0965c55fe8be0e944a46c3b1555b9245c7af8b8b141eac4b47deea977b4852",
"algorithm": "sha512",
"filename": "clang.tar.xz",
"unpack": true

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 121389802,
"digest": "2be6b42cfa1e92de4b49a57123f54043fec2d3cf8385276516dc6aaed99c88768ac4aebd7ce2e007ab074163523da29223436a4d1aef82f0f750f08f1b14cd71",
"version": "clang 3.8.0",
"size": 133060926,
"digest": "aff5ad3ac2d41db19d1ba0df5f97b189a7d7e1b6af8c56e22c2b0cced84d75fa98394ded6a4ba5713652e6684a0a46f47aeccf87991f9e849bf8d7d82e564f6f",
"algorithm": "sha512",
"filename": "clang.tar.bz2",
"unpack": true

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 106877168,
"digest": "1c50c6348eaf429ed59bb603cff63bcc1f870f59216dd3c234db5b1156cfd351d5ee7b820ec31be4d2661eb4213b2e0030e2ba2782b42905d1ec19c7f8bd322a",
"version": "clang 3.8.0, libgcc 4.8.5",
"size": 118876936,
"digest": "f021d7b23cbbcc4086514b4bf20c86c9f94dbe5b4e0f1ef3aaf2bea337430f7c0d0965c55fe8be0e944a46c3b1555b9245c7af8b8b141eac4b47deea977b4852",
"algorithm": "sha512",
"filename": "clang.tar.xz",
"unpack": true

View File

@ -1,8 +1,8 @@
[
{
"version": "clang 3.8.0/r247539",
"size": 121389802,
"digest": "2be6b42cfa1e92de4b49a57123f54043fec2d3cf8385276516dc6aaed99c88768ac4aebd7ce2e007ab074163523da29223436a4d1aef82f0f750f08f1b14cd71",
"version": "clang 3.8.0",
"size": 133060926,
"digest": "aff5ad3ac2d41db19d1ba0df5f97b189a7d7e1b6af8c56e22c2b0cced84d75fa98394ded6a4ba5713652e6684a0a46f47aeccf87991f9e849bf8d7d82e564f6f",
"algorithm": "sha512",
"filename": "clang.tar.bz2",
"unpack": true

View File

@ -403,7 +403,7 @@ add_task(function* test_createRoom() {
// We can't check the value of the key, but check we've got a # which indicates
// there should be one.
Assert.ok(room.roomUrl.contains("#"), "Created room url should have a key");
Assert.ok(room.roomUrl.includes("#"), "Created room url should have a key");
var key = room.roomUrl.split("#")[1];
Assert.ok(key.length, "Created room url should have non-zero length key");

View File

@ -612,7 +612,7 @@ var pktApi = (function() {
*/
function getSignupAB() {
var setting = getSetting('signupAB');
if (!setting || setting.contains('hero'))
if (!setting || setting.includes('hero'))
{
var rand = (Math.floor(Math.random()*100+1));
if (rand > 90)

View File

@ -95,17 +95,20 @@ if test -n "$ENABLE_CLANG_PLUGIN"; then
dnl Check for the new ASTMatcher API names. Since this happened in the
dnl middle of the 3.8 cycle, our CLANG_VERSION_FULL is impossible to use
dnl correctly, so we have to detect this at configure time.
AC_CACHE_CHECK(for new ASTMatcher names,
ac_cv_have_new_ASTMatcher_names,
AC_CACHE_CHECK(for new ASTMatcher API,
ac_cv_have_new_ASTMatcher_api,
[
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
_SAVE_CXXFLAGS="$CXXFLAGS"
_SAVE_CXX="$CXX"
CXXFLAGS="${LLVM_CXXFLAGS}"
CXX="${HOST_CXX}"
AC_TRY_COMPILE([#include "clang/ASTMatchers/ASTMatchers.h"],
[clang::ast_matchers::cxxConstructExpr();],
ac_cv_have_new_ASTMatcher_names="yes",
ac_cv_have_new_ASTMatcher_names="no")
CXX="$_SAVE_CXX"
CXXFLAGS="$_SAVE_CXXFLAGS"
AC_LANG_RESTORE
])

View File

@ -114,29 +114,21 @@ def mkdir_p(path):
raise
def build_and_use_libgcc(env, clang_dir):
with updated_env(env):
tempdir = tempfile.mkdtemp()
gcc_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"..", "build-gcc")
run_in(gcc_dir, ["./build-gcc.sh", tempdir, "libgcc"])
run_in(tempdir, ["tar", "-xf", "gcc.tar.xz"])
libgcc_dir = glob.glob(os.path.join(tempdir,
"gcc", "lib", "gcc",
"x86_64-unknown-linux-gnu",
def install_libgcc(gcc_dir, clang_dir):
libgcc_dir = glob.glob(os.path.join(gcc_dir, "lib", "gcc",
"x86_64-*linux-gnu",
"[0-9]*"))[0]
clang_lib_dir = os.path.join(clang_dir, "lib", "gcc",
"x86_64-unknown-linux-gnu",
os.path.basename(libgcc_dir))
mkdir_p(clang_lib_dir)
copy_dir_contents(libgcc_dir, clang_lib_dir)
libgcc_dir = os.path.join(tempdir, "gcc", "lib64")
libgcc_dir = os.path.join(gcc_dir, "lib64")
clang_lib_dir = os.path.join(clang_dir, "lib")
copy_dir_contents(libgcc_dir, clang_lib_dir)
include_dir = os.path.join(tempdir, "gcc", "include")
include_dir = os.path.join(gcc_dir, "include")
clang_include_dir = os.path.join(clang_dir, "include")
copy_dir_contents(include_dir, clang_include_dir)
shutil.rmtree(tempdir)
def svn_co(source_dir, url, directory, revision):
@ -147,12 +139,6 @@ def svn_update(directory, revision):
run_in(directory, ["svn", "update", "-r", revision])
def build_one_stage(cc, cxx, src_dir, stage_dir, build_libcxx,
build_type, assertions, python_path):
build_one_stage_aux(cc, cxx, src_dir, stage_dir, build_libcxx,
build_type, assertions, python_path)
def get_platform():
p = platform.system()
if p == "Darwin":
@ -183,8 +169,8 @@ def is_windows():
return platform.system() == "Windows"
def build_one_stage_aux(cc, cxx, src_dir, stage_dir, build_libcxx,
build_type, assertions, python_path):
def build_one_stage(cc, cxx, src_dir, stage_dir, build_libcxx,
build_type, assertions, python_path, gcc_dir):
if not os.path.exists(stage_dir):
os.mkdir(stage_dir)
@ -196,8 +182,10 @@ def build_one_stage_aux(cc, cxx, src_dir, stage_dir, build_libcxx,
run_cmake = False
cmake_args = ["-GNinja",
"-DCMAKE_C_COMPILER=%s" % cc,
"-DCMAKE_CXX_COMPILER=%s" % cxx,
"-DCMAKE_C_COMPILER=%s" % cc[0],
"-DCMAKE_CXX_COMPILER=%s" % cxx[0],
"-DCMAKE_C_FLAGS=%s" % ' '.join(cc[1:]),
"-DCMAKE_CXX_FLAGS=%s" % ' '.join(cxx[1:]),
"-DCMAKE_BUILD_TYPE=%s" % build_type,
"-DLLVM_TARGETS_TO_BUILD=X86;ARM",
"-DLLVM_ENABLE_ASSERTIONS=%s" % ("ON" if assertions else "OFF"),
@ -208,6 +196,10 @@ def build_one_stage_aux(cc, cxx, src_dir, stage_dir, build_libcxx,
src_dir];
build_package(build_dir, run_cmake, cmake_args)
if is_linux():
install_libgcc(gcc_dir, inst_dir)
if __name__ == "__main__":
# The directories end up in the debug info, so the easy way of getting
# a reproducible build is to run it in a know absolute directory.
@ -343,61 +335,54 @@ if __name__ == "__main__":
final_stage_dir = stage1_dir
if is_darwin():
extra_cflags = ""
extra_cxxflags = "-stdlib=libc++"
extra_cflags2 = ""
extra_cxxflags2 = "-stdlib=libc++"
extra_cflags = []
extra_cxxflags = ["-stdlib=libc++"]
extra_cflags2 = []
extra_cxxflags2 = ["-stdlib=libc++"]
elif is_linux():
extra_cflags = "-static-libgcc"
extra_cxxflags = "-static-libgcc -static-libstdc++"
extra_cflags2 = "-fPIC --gcc-toolchain=%s" % gcc_dir
extra_cxxflags2 = "-fPIC --gcc-toolchain=%s" % gcc_dir
extra_cflags = ["-static-libgcc"]
extra_cxxflags = ["-static-libgcc", "-static-libstdc++"]
extra_cflags2 = ["-fPIC"]
extra_cxxflags2 = ["-fPIC"]
if os.environ.has_key('LD_LIBRARY_PATH'):
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/:%s' % (gcc_dir, os.environ['LD_LIBRARY_PATH']);
else:
os.environ['LD_LIBRARY_PATH'] = '%s/lib64/' % gcc_dir
elif is_windows():
extra_cflags = ""
extra_cxxflags = ""
extra_cflags2 = ""
extra_cxxflags2 = ""
extra_cflags = []
extra_cxxflags = []
extra_cflags2 = []
extra_cxxflags2 = []
build_one_stage(
cc + " %s" % extra_cflags,
cxx + " %s" % extra_cxxflags,
[cc] + extra_cflags,
[cxx] + extra_cxxflags,
llvm_source_dir, stage1_dir, build_libcxx,
build_type, assertions, python_path)
build_type, assertions, python_path, gcc_dir)
if stages > 1:
stage2_dir = build_dir + '/stage2'
stage2_inst_dir = stage2_dir + '/clang'
final_stage_dir = stage2_dir
build_one_stage(
stage1_inst_dir + "/bin/%s%s %s" %
(cc_name, exe_ext, extra_cflags2),
stage1_inst_dir + "/bin/%s%s %s" %
(cxx_name, exe_ext, extra_cxxflags2),
[stage1_inst_dir + "/bin/%s%s" %
(cc_name, exe_ext)] + extra_cflags2,
[stage1_inst_dir + "/bin/%s%s" %
(cxx_name, exe_ext)] + extra_cxxflags2,
llvm_source_dir, stage2_dir, build_libcxx,
build_type, assertions, python_path)
build_type, assertions, python_path, gcc_dir)
if stages > 2:
stage3_dir = build_dir + '/stage3'
final_stage_dir = stage3_dir
build_one_stage(
stage2_inst_dir + "/bin/%s%s %s" %
(cc_name, exe_ext, extra_cflags2),
stage2_inst_dir + "/bin/%s%s %s" %
(cxx_name, exe_ext, extra_cxxflags2),
llvm_source_dir, stage3_dir, build_libcxx,
build_type, assertions, python_path)
if is_linux():
final_stage_inst_dir = final_stage_dir + '/clang'
build_and_use_libgcc(
{"CC": cc + " %s" % extra_cflags,
"CXX": cxx + " %s" % extra_cxxflags},
final_stage_inst_dir)
if stages > 2:
stage3_dir = build_dir + '/stage3'
final_stage_dir = stage3_dir
build_one_stage(
[stage2_inst_dir + "/bin/%s%s" %
(cc_name, exe_ext)] + extra_cflags2,
[stage2_inst_dir + "/bin/%s%s" %
(cxx_name, exe_ext)] + extra_cxxflags2,
llvm_source_dir, stage3_dir, build_libcxx,
build_type, assertions, python_path, gcc_dir)
if is_darwin() or is_windows():
build_tar_package("tar", "clang.tar.bz2", final_stage_dir, "clang")

View File

@ -1,32 +0,0 @@
{
"llvm_revision": "247539",
"stages": "3",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/home/worker/workspace/build/src/gcc",
"cc": "/home/worker/workspace/build/src/gcc/bin/gcc",
"cxx": "/home/worker/workspace/build/src/gcc/bin/g++",
"patches": {
"macosx64": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
],
"linux64": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
],
"linux32": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
]
}
}

View File

@ -1,31 +1,28 @@
{
"llvm_revision": "247539",
"llvm_revision": "262557",
"stages": "3",
"build_libcxx": false,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
"python_path": "/usr/local/bin/python2.7",
"gcc_dir": "/tools/gcc-4.7.3-0moz1",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_380/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_380/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_380/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_380/final",
"python_path": "/usr/bin/python2.7",
"gcc_dir": "/home/worker/workspace/build/src/gcc",
"cc": "/home/worker/workspace/build/src/gcc/bin/gcc",
"cxx": "/home/worker/workspace/build/src/gcc/bin/g++",
"patches": {
"macosx64": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
],
"linux64": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
],
"linux32": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
]
}

View File

@ -1,30 +1,28 @@
{
"llvm_revision": "247539",
"llvm_revision": "262557",
"stages": "3",
"build_libcxx": true,
"build_type": "Release",
"assertions": false,
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/trunk",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/trunk",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/trunk",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/trunk",
"llvm_repo": "https://llvm.org/svn/llvm-project/llvm/tags/RELEASE_380/final",
"clang_repo": "https://llvm.org/svn/llvm-project/cfe/tags/RELEASE_380/final",
"compiler_repo": "https://llvm.org/svn/llvm-project/compiler-rt/tags/RELEASE_380/final",
"libcxx_repo": "https://llvm.org/svn/llvm-project/libcxx/tags/RELEASE_380/final",
"python_path": "/usr/local/bin/python2.7",
"cc": "/usr/bin/clang",
"cxx": "/usr/bin/clang++",
"cc": "/Users/cltbld/clang/bin/clang",
"cxx": "/Users/cltbld/clang/bin/clang++",
"patches": {
"macosx64": [
"disable-mac-tsan.patch",
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
],
"linux64": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
],
"linux32": [
"llvm-debug-frame.patch",
"query-selector-visibility.patch",
"return-empty-string-non-mangled.patch"
]
}

View File

@ -0,0 +1,11 @@
--- a/compiler-rt/cmake/config-ix.cmake
+++ b/compiler-rt/cmake/config-ix.cmake
@@ -617,7 +617,7 @@
endif()
if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND
- OS_NAME MATCHES "Darwin|Linux|FreeBSD")
+ OS_NAME MATCHES "Linux|FreeBSD")
set(COMPILER_RT_HAS_TSAN TRUE)
else()
set(COMPILER_RT_HAS_TSAN FALSE)

View File

@ -4,10 +4,10 @@ Date: Mon Sep 14 17:47:21 2015 -0400
Add support for querying the visibility of a cursor
diff --git a/llvm/tools/clang/include/clang-c/Index.h b/llvm/tools/clang/include/clang-c/Index.h
diff --git a/clang/include/clang-c/Index.h b/clang/include/clang-c/Index.h
index fad9cfa..311bfcb 100644
--- a/llvm/tools/clang/include/clang-c/Index.h
+++ b/llvm/tools/clang/include/clang-c/Index.h
--- a/clang/include/clang-c/Index.h
+++ b/clang/include/clang-c/Index.h
@@ -2440,6 +2440,24 @@ enum CXLinkageKind {
CINDEX_LINKAGE enum CXLinkageKind clang_getCursorLinkage(CXCursor cursor);
@ -33,10 +33,10 @@ index fad9cfa..311bfcb 100644
* \brief Determine the availability of the entity that this cursor refers to,
* taking the current target platform into account.
*
diff --git a/llvm/tools/clang/tools/libclang/CIndex.cpp b/llvm/tools/clang/tools/libclang/CIndex.cpp
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 8225a6c..9fa18d3 100644
--- a/llvm/tools/clang/tools/libclang/CIndex.cpp
+++ b/llvm/tools/clang/tools/libclang/CIndex.cpp
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -6361,6 +6361,27 @@ CXLinkageKind clang_getCursorLinkage(CXCursor cursor) {
} // end: extern "C"
@ -65,10 +65,10 @@ index 8225a6c..9fa18d3 100644
// Operations for querying language of a cursor.
//===----------------------------------------------------------------------===//
diff --git a/llvm/tools/clang/tools/libclang/libclang.exports b/llvm/tools/clang/tools/libclang/libclang.exports
diff --git a/clang/tools/libclang/libclang.exports b/clang/tools/libclang/libclang.exports
index f6a7175..a919a8e 100644
--- a/llvm/tools/clang/tools/libclang/libclang.exports
+++ b/llvm/tools/clang/tools/libclang/libclang.exports
--- a/clang/tools/libclang/libclang.exports
+++ b/clang/tools/libclang/libclang.exports
@@ -173,6 +173,7 @@ clang_getCursorSemanticParent
clang_getCursorSpelling
clang_getCursorType

View File

@ -1,14 +1,12 @@
commit 009de5ea7a1913f0b4619cf514787bd52af38c28
Author: Michael Wu <mwu@mozilla.com>
Date: Thu Sep 24 11:36:08 2015 -0400
Return an empty string when a symbol isn't mangled
diff --git a/llvm/tools/clang/tools/libclang/CIndex.cpp b/llvm/tools/clang/tools/libclang/CIndex.cpp
index 9fa18d3..1253832 100644
--- a/llvm/tools/clang/tools/libclang/CIndex.cpp
+++ b/llvm/tools/clang/tools/libclang/CIndex.cpp
@@ -3891,6 +3891,10 @@ CXString clang_Cursor_getMangling(CXCursor C) {
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3990,6 +3990,10 @@
ASTContext &Ctx = ND->getASTContext();
std::unique_ptr<MangleContext> MC(Ctx.createMangleContext());
@ -18,4 +16,4 @@ index 9fa18d3..1253832 100644
+
std::string FrontendBuf;
llvm::raw_string_ostream FrontendBufOS(FrontendBuf);
MC->mangleName(ND, FrontendBufOS);
if (MC->shouldMangleDeclName(ND)) {

View File

@ -338,6 +338,7 @@ option(env='MOZILLABUILD', nargs=1,
# It feels dirty replicating this from python/mozbuild/mozbuild/mozconfig.py,
# but the end goal being that the configure script would go away...
@depends('MOZILLABUILD')
@checking('for a shell')
@imports('sys')
def shell(mozillabuild):
shell = 'sh'
@ -345,7 +346,7 @@ def shell(mozillabuild):
shell = mozillabuild[0] + '/msys/bin/sh'
if sys.platform == 'win32':
shell = shell + '.exe'
return shell
return find_program(shell)
# Host and target systems

View File

@ -14,6 +14,7 @@ def encoded_open(path, mode):
option(env='AUTOCONF', nargs=1, help='Path to autoconf 2.13')
@depends(mozconfig, 'AUTOCONF')
@checking('for autoconf')
@imports('re')
def autoconf(mozconfig, autoconf):
mozconfig_autoconf = None

View File

@ -4,27 +4,6 @@
include $(topsrcdir)/config/rules.mk
REDIST_FILES =
ifdef WIN32_REDIST_DIR
REDIST_FILES += '$(WIN32_REDIST_DIR)'/$(MSVC_C_RUNTIME_DLL)
REDIST_FILES += '$(WIN32_REDIST_DIR)'/$(MSVC_CXX_RUNTIME_DLL)
endif
ifdef WIN_UCRT_REDIST_DIR
REDIST_FILES += $(wildcard $(WIN_UCRT_REDIST_DIR)/api-ms-win-*.dll)
REDIST_FILES += '$(WIN_UCRT_REDIST_DIR)'/ucrtbase.dll
endif
ifdef REDIST_FILES
libs-preqs = \
$(call mkdir_deps,$(FINAL_TARGET)) \
$(NULL)
libs:: $(libs-preqs)
install --preserve-timestamps $(REDIST_FILES) $(FINAL_TARGET)
endif
# run the binscope tool to make sure the binary and all libraries
# are using all available Windows OS-level security mechanisms
# Don't do this in clang-cl since it doesn't support debug information yet.

View File

@ -14,3 +14,15 @@ if CONFIG['ENABLE_TESTS']:
USE_STATIC_LIBS = True
NO_PGO = True
if CONFIG['WIN32_REDIST_DIR']:
for f in ['MSVC_C_RUNTIME_DLL', 'MSVC_CXX_RUNTIME_DLL']:
FINAL_TARGET_FILES += [
'%%%s/%s' % (CONFIG['WIN32_REDIST_DIR'], CONFIG[f])
]
if CONFIG['WIN_UCRT_REDIST_DIR']:
for f in ['api-ms-win-*.dll', 'ucrtbase.dll']:
FINAL_TARGET_FILES += [
'%%%s/%s' % (CONFIG['WIN_UCRT_REDIST_DIR'], f)
]

View File

@ -65,19 +65,6 @@ TOPSRCDIR := $(CWD)
endif
endif
# try to find autoconf 2.13 - discard errors from 'which'
# MacOS X 10.4 sends "no autoconf*" errors to stdout, discard those via grep
AUTOCONF ?= $(shell which autoconf-2.13 autoconf2.13 autoconf213 2>/dev/null | grep -v '^no autoconf' | head -1)
# See if the autoconf package was installed through fink
ifeq (,$(strip $(AUTOCONF)))
AUTOCONF = $(shell which fink >/dev/null 2>&1 && echo `which fink`/../../lib/autoconf2.13/bin/autoconf)
endif
ifeq (,$(strip $(AUTOCONF)))
AUTOCONF=$(error Could not find autoconf 2.13)
endif
SH := /bin/sh
PERL ?= perl
PYTHON ?= $(shell which python2.7 > /dev/null 2>&1 && echo python2.7 || echo python)
@ -319,8 +306,9 @@ EXTRA_CONFIG_DEPS := \
$(NULL)
$(CONFIGURES): %: %.in $(EXTRA_CONFIG_DEPS)
@echo Generating $@ using autoconf
cd $(@D); $(AUTOCONF)
@echo Generating $@
sed '1,/^divert/d' $< > $@
chmod +x $@
CONFIG_STATUS_DEPS := \
$(wildcard $(TOPSRCDIR)/*/confvars.sh) \

View File

@ -1,6 +1,8 @@
// Check to make sure that a worker can be attached to a toolbox
// directly, and that the toolbox has expected properties.
"use strict";
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejections should be fixed.
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("[object Object]");
@ -33,7 +35,7 @@ add_task(function* () {
Toolbox.HostType.WINDOW);
is(toolbox._host.type, "window", "correct host");
ok(toolbox._host._window.document.title.contains(WORKER_URL),
ok(toolbox._host._window.document.title.includes(WORKER_URL),
"worker URL in host title");
let toolTabs = toolbox.doc.querySelectorAll(".devtools-tab");

View File

@ -10,7 +10,6 @@ support-files =
!/devtools/client/framework/test/shared-redux-head.js
[browser_device_width.js]
skip-if = (e10s && debug) # Bug 1262432 - crashes at nsLayoutUtils::HasDisplayPort(content)
[browser_exit_button.js]
[browser_resize_cmd.js]
[browser_screenshot_button.js]

View File

@ -16,7 +16,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("promises-actor-test");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

View File

@ -18,7 +18,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("promises-actor-test");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

View File

@ -15,7 +15,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("promises-object-test");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise.");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

View File

@ -16,7 +16,7 @@ add_task(function*() {
let client = yield startTestDebuggerServer("test-promises-timetosettle");
let chromeActors = yield getChromeActors(client);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise.");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

View File

@ -17,7 +17,7 @@ add_task(function*() {
let chromeActors = yield getChromeActors(client);
yield attachTab(client, chromeActors);
ok(Promise.toString().contains("native code"), "Expect native DOM Promise.");
ok(Promise.toString().includes("native code"), "Expect native DOM Promise.");
// We have to attach the chrome TabActor before playing with the PromiseActor
yield attachTab(client, chromeActors);

View File

@ -664,12 +664,12 @@ function makeFilterPredicate(filterString) {
}
if (isSavedFrame(node.name)) {
return node.name.source.contains(filterString)
|| (node.name.functionDisplayName || "").contains(filterString)
|| (node.name.asyncCause || "").contains(filterString);
return node.name.source.includes(filterString)
|| (node.name.functionDisplayName || "").includes(filterString)
|| (node.name.asyncCause || "").includes(filterString);
}
return String(node.name).contains(filterString);
return String(node.name).includes(filterString);
};
}

View File

@ -98,13 +98,16 @@ struct DevTools : public ::testing::Test {
}
static const JSClass* getGlobalClass() {
static const JSClass globalClass = {
"global", JSCLASS_GLOBAL_FLAGS,
static const JSClassOps globalClassOps = {
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
JS_GlobalObjectTraceHook
};
static const JSClass globalClass = {
"global", JSCLASS_GLOBAL_FLAGS,
&globalClassOps
};
return &globalClass;
}

View File

@ -33,7 +33,7 @@ do_register_cleanup(() => {
add_task(function* test_normal() {
yield DevToolsUtils.fetch(NORMAL_URL).then(({content}) => {
ok(content.contains("The content looks correct."),
ok(content.includes("The content looks correct."),
"The content looks correct.");
});
});

View File

@ -10948,8 +10948,13 @@ nsDocShell::DoURILoad(nsIURI* aURI,
nsCOMPtr<nsITimedChannel> timedChannel(do_QueryInterface(channel));
if (timedChannel) {
timedChannel->SetTimingEnabled(true);
if (IsFrame()) {
timedChannel->SetInitiatorType(NS_LITERAL_STRING("subdocument"));
nsCOMPtr<nsPIDOMWindowOuter> win = GetWindow();
if (IsFrame() && win) {
nsCOMPtr<Element> frameElement = win->GetFrameElementInternal();
if (frameElement) {
timedChannel->SetInitiatorType(frameElement->LocalName());
}
}
}

View File

@ -409,7 +409,7 @@ private:
// If something goes wrong, we still need to release the ConsoleCallData
// object. For this reason we have a custom Cancel method.
NS_IMETHOD
nsresult
Cancel() override
{
mRunnable->ReleaseData();

View File

@ -72,7 +72,7 @@ GetBRGADataSourceSurfaceSync(already_AddRefed<layers::Image> aImage)
return helper->GetDataSurfaceSafe();
}
class EncodingCompleteEvent : public nsCancelableRunnable
class EncodingCompleteEvent : public CancelableRunnable
{
virtual ~EncodingCompleteEvent() {}

View File

@ -14,8 +14,6 @@
namespace mozilla {
namespace dom {
class CancelableRunnable;
class SameProcessMessageQueue
{
public:
@ -45,8 +43,6 @@ public:
static SameProcessMessageQueue* Get();
private:
friend class CancelableRunnable;
nsTArray<RefPtr<Runnable>> mQueue;
static SameProcessMessageQueue* sSingleton;
};

View File

@ -253,7 +253,7 @@ NS_IMPL_ISUPPORTS(WebSocketImpl,
nsIRequest,
nsIEventTarget)
class CallDispatchConnectionCloseEvents final : public nsCancelableRunnable
class CallDispatchConnectionCloseEvents final : public CancelableRunnable
{
public:
explicit CallDispatchConnectionCloseEvents(WebSocketImpl* aWebSocketImpl)

View File

@ -7455,17 +7455,32 @@ nsContentUtils::TransferableToIPCTransferable(nsITransferable* aTransferable,
blobImpl = do_QueryInterface(data);
}
if (blobImpl) {
IPCDataTransferData data;
// If we failed to create the blob actor, then this blob probably
// can't get the file size for the underlying file, ignore it for
// now. TODO pass this through anyway.
if (aChild) {
auto* child = mozilla::dom::BlobChild::GetOrCreate(aChild,
static_cast<BlobImpl*>(blobImpl.get()));
if (!child) {
continue;
}
data = child;
} else if (aParent) {
auto* parent = mozilla::dom::BlobParent::GetOrCreate(aParent,
static_cast<BlobImpl*>(blobImpl.get()));
if (!parent) {
continue;
}
data = parent;
}
IPCDataTransferItem* item = aIPCDataTransfer->items().AppendElement();
item->flavor() = nsCString(flavorStr);
if (aChild) {
item->data() =
mozilla::dom::BlobChild::GetOrCreate(aChild,
static_cast<BlobImpl*>(blobImpl.get()));
} else if (aParent) {
item->data() =
mozilla::dom::BlobParent::GetOrCreate(aParent,
static_cast<BlobImpl*>(blobImpl.get()));
}
item->data() = data;
} else {
// This is a hack to support kFilePromiseMime.
// On Windows there just needs to be an entry for it,

View File

@ -1136,7 +1136,7 @@ PerformanceBase::CancelNotificationObservers()
mPendingNotificationObserversTask = false;
}
class NotifyObserversTask final : public nsCancelableRunnable
class NotifyObserversTask final : public CancelableRunnable
{
public:
explicit NotifyObserversTask(PerformanceBase* aPerformance)
@ -1152,7 +1152,7 @@ public:
return NS_OK;
}
NS_IMETHOD Cancel() override
nsresult Cancel() override
{
mPerformance->CancelNotificationObservers();
mPerformance = nullptr;

View File

@ -0,0 +1,16 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=769117
-->
<head>
</head>
<body>
<embed id="testembed"
src="https://mochitest.youtube.com/v/Xm5i5kbIXzc"
type="application/x-shockwave-flash"
allowscriptaccess="always"></embed>
<object id="testobject"
data="https://mochitest.youtube.com/v/Xm5i5kbIXzc"></embed>
</body>
</html>

View File

@ -147,6 +147,7 @@ support-files =
file_bug707142_utf-16.json
file_bug708620-2.html
file_bug708620.html
file_bug769117.html
file_bug782342.txt
file_bug787778.sjs
file_bug804395.jar

View File

@ -13,39 +13,43 @@
/** Test for Bug 769117 **/
"use strict";
function onLoad () {
let youtube_url = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
let youtube_changed_url = "https://mochitest.youtube.com/embed/Xm5i5kbIXzc";
SpecialPowers.pushPrefEnv({"set": [["plugins.rewrite_youtube_embeds", true]]}, function() {
function testEmbed(embed) {
ok (embed, "Embed node exists");
embed = SpecialPowers.wrap(embed);
is (embed.srcURI.spec, youtube_changed_url, "Should have src uri of " + youtube_changed_url);
}
info("Running static embed youtube rewrite test");
testEmbed(document.getElementById("testembed"));
testEmbed(document.getElementById("testobject"));
let youtube_url = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
let youtube_changed_url = "https://mochitest.youtube.com/embed/Xm5i5kbIXzc";
let static_iframe = document.getElementById("staticiframe");
info("Running dynamic embed youtube rewrite test");
let embed_dynamic = document.createElement("embed");
embed_dynamic.src = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
embed_dynamic.type = "application/x-shockwave-flash";
function testEmbed(embed) {
ok (embed, "Embed node exists");
embed = SpecialPowers.wrap(embed);
is (embed.srcURI.spec, youtube_changed_url, "Should have src uri of " + youtube_changed_url);
}
document.body.appendChild(embed_dynamic);
function testStatic() {
info("Running static embed youtube rewrite test");
iframe_doc = static_iframe.contentWindow.document;
testEmbed(iframe_doc.getElementById("testembed"));
testEmbed(iframe_doc.getElementById("testobject"));
SimpleTest.executeSoon(() => {
testEmbed(embed_dynamic);
SimpleTest.finish();
});
}
SimpleTest.executeSoon(() =>
{
testEmbed(embed_dynamic);
SimpleTest.finish();
});
info("Running dynamic embed youtube rewrite test");
let embed_dynamic = document.createElement("embed");
embed_dynamic.src = "https://mochitest.youtube.com/v/Xm5i5kbIXzc";
embed_dynamic.type = "application/x-shockwave-flash";
document.body.appendChild(embed_dynamic);
static_iframe.onload = testStatic;
static_iframe.src = "file_bug769117.html"
});
}
</script>
</head>
<body onload="onLoad()">
<embed id="testembed"
src="https://mochitest.youtube.com/v/Xm5i5kbIXzc"
type="application/x-shockwave-flash"
allowscriptaccess="always"></embed>
<object id="testobject"
data="https://mochitest.youtube.com/v/Xm5i5kbIXzc"></embed>
<iframe id="staticiframe"></iframe>
</body>
</html>

View File

@ -1806,6 +1806,21 @@ NativePropertyHooks sEmptyNativePropertyHooks = {
nullptr
};
const js::ClassOps sBoringInterfaceObjectClassClassOps = {
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* mayResolve */
nullptr, /* finalize */
ThrowingConstructor, /* call */
InterfaceHasInstance, /* hasInstance */
ThrowingConstructor, /* construct */
nullptr, /* trace */
};
const js::ObjectOps sInterfaceObjectClassObjectOps = {
nullptr, /* lookupProperty */
nullptr, /* defineProperty */

View File

@ -2508,6 +2508,8 @@ XrayGetNativeProto(JSContext* cx, JS::Handle<JSObject*> obj,
extern NativePropertyHooks sEmptyNativePropertyHooks;
extern const js::ClassOps sBoringInterfaceObjectClassClassOps;
extern const js::ObjectOps sInterfaceObjectClassObjectOps;
// We use one constructor JSNative to represent all DOM interface objects (so
@ -2540,7 +2542,7 @@ inline bool
HasConstructor(JSObject* obj)
{
return JS_IsNativeFunction(obj, Constructor) ||
js::GetObjectClass(obj)->construct;
js::GetObjectClass(obj)->getConstruct();
}
#endif

View File

@ -440,6 +440,21 @@ class CGDOMJSClass(CGThing):
return fill(
"""
static const js::ClassOps sClassOps = {
${addProperty}, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
${enumerate}, /* enumerate */
${resolve}, /* resolve */
${mayResolve}, /* mayResolve */
${finalize}, /* finalize */
${call}, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
${trace}, /* trace */
};
static const js::ClassExtension sClassExtension = {
nullptr, /* weakmapKeyDelegateOp */
${objectMoved} /* objectMovedOp */
@ -448,18 +463,7 @@ class CGDOMJSClass(CGThing):
static const DOMJSClass sClass = {
{ "${name}",
${flags},
${addProperty}, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
${enumerate}, /* enumerate */
${resolve}, /* resolve */
${mayResolve}, /* mayResolve */
${finalize}, /* finalize */
${call}, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
${trace}, /* trace */
&sClassOps,
JS_NULL_CLASS_SPEC,
&sClassExtension,
JS_NULL_OBJECT_OPS
@ -594,18 +598,7 @@ class CGPrototypeJSClass(CGThing):
{
"${name}Prototype",
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(${slotCount}),
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* mayResolve */
nullptr, /* finalize */
nullptr, /* call */
nullptr, /* hasInstance */
nullptr, /* construct */
nullptr, /* trace */
JS_NULL_CLASS_OPS,
JS_NULL_CLASS_SPEC,
JS_NULL_CLASS_EXT,
JS_NULL_OBJECT_OPS
@ -684,24 +677,39 @@ class CGInterfaceObjectJSClass(CGThing):
len(self.descriptor.interface.namedConstructors))
(protoGetter, _) = InterfaceObjectProtoGetter(self.descriptor)
return fill(
if ctorname == "ThrowingConstructor" and hasinstance == "InterfaceHasInstance":
ret = ""
classOpsPtr = "&sBoringInterfaceObjectClassClassOps"
else:
ret = fill(
"""
static const js::ClassOps sInterfaceObjectClassOps = {
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* mayResolve */
nullptr, /* finalize */
${ctorname}, /* call */
${hasInstance}, /* hasInstance */
${ctorname}, /* construct */
nullptr, /* trace */
};
""",
ctorname=ctorname,
hasInstance=hasinstance)
classOpsPtr = "&sInterfaceObjectClassOps"
ret = ret + fill(
"""
static const DOMIfaceAndProtoJSClass sInterfaceObjectClass = {
{
"Function",
JSCLASS_IS_DOMIFACEANDPROTOJSCLASS | JSCLASS_HAS_RESERVED_SLOTS(${slotCount}),
nullptr, /* addProperty */
nullptr, /* delProperty */
nullptr, /* getProperty */
nullptr, /* setProperty */
nullptr, /* enumerate */
nullptr, /* resolve */
nullptr, /* mayResolve */
nullptr, /* finalize */
${ctorname}, /* call */
${hasInstance}, /* hasInstance */
${ctorname}, /* construct */
nullptr, /* trace */
${classOpsPtr},
JS_NULL_CLASS_SPEC,
JS_NULL_CLASS_EXT,
&sInterfaceObjectClassObjectOps
@ -717,12 +725,13 @@ class CGInterfaceObjectJSClass(CGThing):
slotCount=slotCount,
ctorname=ctorname,
hasInstance=hasinstance,
classOpsPtr=classOpsPtr,
hooks=NativePropertyHooks(self.descriptor),
name=self.descriptor.interface.identifier.name,
prototypeID=prototypeID,
depth=depth,
protoGetter=protoGetter)
return ret
class CGList(CGThing):
"""

View File

@ -70,14 +70,7 @@ SimpleGlobal_moved(JSObject *obj, const JSObject *old)
globalObject->UpdateWrapper(obj, old);
}
static const js::ClassExtension SimpleGlobalClassExtension = {
nullptr,
SimpleGlobal_moved
};
const js::Class SimpleGlobalClass = {
"",
JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
static const js::ClassOps SimpleGlobalClassOps = {
nullptr,
nullptr,
nullptr,
@ -90,6 +83,17 @@ const js::Class SimpleGlobalClass = {
nullptr,
nullptr,
JS_GlobalObjectTraceHook,
};
static const js::ClassExtension SimpleGlobalClassExtension = {
nullptr,
SimpleGlobal_moved
};
const js::Class SimpleGlobalClass = {
"",
JSCLASS_GLOBAL_FLAGS | JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS,
&SimpleGlobalClassOps,
JS_NULL_CLASS_SPEC,
&SimpleGlobalClassExtension,
JS_NULL_OBJECT_OPS

View File

@ -142,7 +142,8 @@ private:
ErrorResult& mRv;
};
class BCPostMessageRunnable final : public nsICancelableRunnable
class BCPostMessageRunnable final : public nsIRunnable,
public nsICancelableRunnable
{
public:
NS_DECL_ISUPPORTS
@ -190,7 +191,7 @@ public:
return NS_OK;
}
NS_IMETHODIMP Cancel() override
nsresult Cancel() override
{
mActor = nullptr;
return NS_OK;
@ -205,7 +206,8 @@ private:
NS_IMPL_ISUPPORTS(BCPostMessageRunnable, nsICancelableRunnable, nsIRunnable)
class CloseRunnable final : public nsICancelableRunnable
class CloseRunnable final : public nsIRunnable,
public nsICancelableRunnable
{
public:
NS_DECL_ISUPPORTS
@ -222,7 +224,7 @@ public:
return NS_OK;
}
NS_IMETHODIMP Cancel() override
nsresult Cancel() override
{
mBC = nullptr;
return NS_OK;
@ -236,7 +238,8 @@ private:
NS_IMPL_ISUPPORTS(CloseRunnable, nsICancelableRunnable, nsIRunnable)
class TeardownRunnable final : public nsICancelableRunnable
class TeardownRunnable final : public nsIRunnable,
public nsICancelableRunnable
{
public:
NS_DECL_ISUPPORTS
@ -256,7 +259,7 @@ public:
return NS_OK;
}
NS_IMETHODIMP Cancel() override
nsresult Cancel() override
{
mActor = nullptr;
return NS_OK;

View File

@ -24,7 +24,7 @@ LOCAL_INCLUDES += [
]
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
include('/ipc/chromium/chromium-config.mozbuild')

View File

@ -0,0 +1,6 @@
[DEFAULT]
skip-if = buildapp == 'b2g' || os == 'android'
support-files =
blank.html
[browser_private_browsing.js]

View File

@ -0,0 +1,74 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
const URL = "http://mochi.test:8888/browser/dom/broadcastchannel/tests/blank.html";
add_task(function*() {
var win1 = OpenBrowserWindow({private: true});
var win1Promise = new win1.Promise(resolve => {
win1.addEventListener("load", function onLoad() {
win1.removeEventListener("load", onLoad, false);
resolve();
});
});
yield win1Promise;
var win2 = OpenBrowserWindow({private: false});
var win2Promise = new win2.Promise(resolve => {
win2.addEventListener("load", function onLoad() {
win2.removeEventListener("load", onLoad, false);
resolve();
});
});
yield win2Promise;
var tab1 = win1.gBrowser.addTab(URL);
yield BrowserTestUtils.browserLoaded(win1.gBrowser.getBrowserForTab(tab1));
var browser1 = gBrowser.getBrowserForTab(tab1);
var tab2 = win2.gBrowser.addTab(URL);
yield BrowserTestUtils.browserLoaded(win2.gBrowser.getBrowserForTab(tab2));
var browser2 = gBrowser.getBrowserForTab(tab2);
var p1 = ContentTask.spawn(browser1, null, function(opts) {
return new content.window.Promise(resolve => {
content.window.bc = new content.window.BroadcastChannel('foobar');
content.window.bc.onmessage = function(e) { resolve(e.data); }
});
});
var p2 = ContentTask.spawn(browser2, null, function(opts) {
return new content.window.Promise(resolve => {
content.window.bc = new content.window.BroadcastChannel('foobar');
content.window.bc.onmessage = function(e) { resolve(e.data); }
});
});
yield ContentTask.spawn(browser1, null, function(opts) {
return new content.window.Promise(resolve => {
var bc = new content.window.BroadcastChannel('foobar');
bc.postMessage('hello world from private browsing');
resolve();
});
});
yield ContentTask.spawn(browser2, null, function(opts) {
return new content.window.Promise(resolve => {
var bc = new content.window.BroadcastChannel('foobar');
bc.postMessage('hello world from non private browsing');
resolve();
});
});
var what1 = yield p1;
ok(what1, 'hello world from private browsing', 'No messages received from the other window.');
var what2 = yield p2;
ok(what1, 'hello world from non private browsing', 'No messages received from the other window.');
yield BrowserTestUtils.removeTab(tab1);
yield BrowserTestUtils.closeWindow(win1);
yield BrowserTestUtils.removeTab(tab2);
yield BrowserTestUtils.closeWindow(win2);
});

View File

@ -1,6 +0,0 @@
[DEFAULT]
skip-if = e10s || buildapp == 'b2g' || os == 'android'
support-files =
blank.html
[test_broadcastchannel_private_browsing.html]

View File

@ -1,118 +0,0 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test for BroadcastChannel - Private Browsing</title>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
</head>
<body>
<script type="application/javascript">
const Ci = Components.interfaces;
var mainWindow;
var prefBranch = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
prefBranch.setIntPref("browser.startup.page", 0);
prefBranch.setCharPref("browser.startup.homepage_override.mstone", "ignore");
var contentPage = "http://mochi.test:8888/chrome/dom/broadcastchannel/tests/blank.html";
function testOnWindow(aIsPrivate, aCallback) {
var win = mainWindow.OpenBrowserWindow({private: aIsPrivate});
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad, false);
win.addEventListener("DOMContentLoaded", function onInnerLoad() {
if (win.content.location.href != contentPage) {
win.gBrowser.loadURI(contentPage);
return;
}
win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
SimpleTest.executeSoon(function() { aCallback(win); });
}, true);
if (!aIsPrivate) {
win.gBrowser.loadURI(contentPage);
}
}, true);
}
function setupWindow() {
mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindow);
runTest();
}
var gCounter = 0;
function check(msg, private) {
is(msg, private ? "private" : "public", "Correct context!");
gCounter++;
if (gCounter > 1) {
runTest();
}
}
var wN;
var wP;
function doTests() {
testOnWindow(false, function(aWin) {
wN = aWin;
testOnWindow(true, function(aWin) {
wP = aWin;
var bcP = new wP.content.BroadcastChannel('foobar');
bcP.onmessage = function(e) { ok(false, "This should not be called!"); }
var bc = new wP.content.BroadcastChannel('foobar');
bc.onmessage = function(e) { check(e.data, true); }
var bcN = new wN.content.BroadcastChannel('foobar');
bcN.onmessage = function(e) { ok(false, "This should not be called!"); }
var bc = new wN.content.BroadcastChannel('foobar');
bc.onmessage = function(e) { check(e.data, false); }
bcP.postMessage('private');
bcN.postMessage('public');
});
});
}
var steps = [
setupWindow,
doTests
];
function runTest() {
if (!steps.length) {
wN.close();
wP.close();
prefBranch.clearUserPref("browser.startup.page")
prefBranch.clearUserPref("browser.startup.homepage_override.mstone");
SimpleTest.finish();
return;
}
var step = steps.shift();
step();
}
SimpleTest.waitForExplicitFinish();
runTest();
</script>
</body>
</html>

View File

@ -17,7 +17,7 @@ namespace dom {
namespace cache {
class CachePushStreamChild::Callback final : public nsIInputStreamCallback
, public nsICancelableRunnable
, public CancelableRunnable
{
public:
explicit Callback(CachePushStreamChild* aActor)
@ -56,7 +56,7 @@ public:
return NS_OK;
}
NS_IMETHOD
nsresult
Cancel() override
{
// Cancel() gets called when the Worker thread is being shutdown. We have
@ -85,12 +85,12 @@ private:
CachePushStreamChild* mActor;
nsCOMPtr<nsIThread> mOwningThread;
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_ISUPPORTS_INHERITED
};
NS_IMPL_ISUPPORTS(CachePushStreamChild::Callback, nsIInputStreamCallback,
nsIRunnable,
nsICancelableRunnable);
NS_IMPL_ISUPPORTS_INHERITED(CachePushStreamChild::Callback,
CancelableRunnable,
nsIInputStreamCallback);
CachePushStreamChild::CachePushStreamChild(Feature* aFeature,
nsISupports* aParent,

View File

@ -117,7 +117,7 @@ private:
// be done on the thread associated with the PBackground actor. Must be
// cancelable to execute on Worker threads (which can occur when the
// ReadStream is constructed on a child process Worker thread).
class ReadStream::Inner::NoteClosedRunnable final : public nsCancelableRunnable
class ReadStream::Inner::NoteClosedRunnable final : public CancelableRunnable
{
public:
explicit NoteClosedRunnable(ReadStream::Inner* aStream)
@ -133,7 +133,7 @@ public:
// Note, we must proceed with the Run() method since our actor will not
// clean itself up until we note that the stream is closed.
NS_IMETHOD Cancel()
nsresult Cancel()
{
Run();
return NS_OK;
@ -152,7 +152,7 @@ private:
// it on the thread associated with the PBackground actor. Must be
// cancelable to execute on Worker threads (which can occur when the
// ReadStream is constructed on a child process Worker thread).
class ReadStream::Inner::ForgetRunnable final : public nsCancelableRunnable
class ReadStream::Inner::ForgetRunnable final : public CancelableRunnable
{
public:
explicit ForgetRunnable(ReadStream::Inner* aStream)
@ -168,7 +168,7 @@ public:
// Note, we must proceed with the Run() method so that we properly
// call RemoveListener on the actor.
NS_IMETHOD Cancel()
nsresult Cancel()
{
Run();
return NS_OK;

View File

@ -4751,7 +4751,11 @@ CanvasRenderingContext2D::DrawDirectlyToCanvas(
// the matrix even though this is a temp gfxContext.
AutoRestoreTransform autoRestoreTransform(mTarget);
RefPtr<gfxContext> context = new gfxContext(tempTarget);
RefPtr<gfxContext> context = gfxContext::ForDrawTarget(tempTarget);
if (!context) {
gfxDevCrash(LogReason::InvalidContext) << "Canvas context problem";
return;
}
context->SetMatrix(contextMatrix.
Scale(1.0 / contextScale.width,
1.0 / contextScale.height).
@ -4950,19 +4954,21 @@ CanvasRenderingContext2D::DrawWindow(nsGlobalWindow& aWindow, double aX,
GlobalAlpha() == 1.0f &&
UsedOperation() == CompositionOp::OP_OVER)
{
thebes = new gfxContext(mTarget);
thebes = gfxContext::ForDrawTarget(mTarget);
MOZ_ASSERT(thebes); // alrady checked the draw target above
thebes->SetMatrix(gfxMatrix(matrix._11, matrix._12, matrix._21,
matrix._22, matrix._31, matrix._32));
} else {
drawDT =
gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget(IntSize(ceil(sw), ceil(sh)),
SurfaceFormat::B8G8R8A8);
if (!drawDT) {
if (!drawDT || !drawDT->IsValid()) {
aError.Throw(NS_ERROR_FAILURE);
return;
}
thebes = new gfxContext(drawDT);
thebes = gfxContext::ForDrawTarget(drawDT);
MOZ_ASSERT(thebes); // alrady checked the draw target above
thebes->SetMatrix(gfxMatrix::Scaling(matrix._11, matrix._22));
}

View File

@ -79,11 +79,12 @@ DocumentRendererChild::RenderDocument(nsPIDOMWindowOuter* window,
IntSize(renderSize.width, renderSize.height),
4 * renderSize.width,
SurfaceFormat::B8G8R8A8);
if (!dt) {
if (!dt || !dt->IsValid()) {
gfxWarning() << "DocumentRendererChild::RenderDocument failed to Factory::CreateDrawTargetForData";
return false;
}
RefPtr<gfxContext> ctx = new gfxContext(dt);
RefPtr<gfxContext> ctx = gfxContext::ForDrawTarget(dt);
MOZ_ASSERT(ctx); // already checked the draw target above
ctx->SetMatrix(mozilla::gfx::ThebesMatrix(transform));
nsCOMPtr<nsIPresShell> shell = presContext->PresShell();

View File

@ -1538,7 +1538,7 @@ WebGLContext::RunContextLossTimer()
mContextLossHandler->RunTimer();
}
class UpdateContextLossStatusTask : public nsCancelableRunnable
class UpdateContextLossStatusTask : public CancelableRunnable
{
RefPtr<WebGLContext> mWebGL;
@ -1548,14 +1548,14 @@ public:
{
}
NS_IMETHOD Run() {
NS_IMETHOD Run() override {
if (mWebGL)
mWebGL->UpdateContextLossStatus();
return NS_OK;
}
NS_IMETHOD Cancel() {
nsresult Cancel() override {
mWebGL = nullptr;
return NS_OK;
}

View File

@ -38,7 +38,7 @@ private:
nsCOMPtr<nsIEventTarget> mEventTarget;
};
class ContextLossWorkerRunnable final : public nsICancelableRunnable
class ContextLossWorkerRunnable final : public CancelableRunnable
{
public:
explicit ContextLossWorkerRunnable(nsIRunnable* aRunnable)
@ -46,8 +46,7 @@ public:
{
}
NS_DECL_NSICANCELABLERUNNABLE
NS_DECL_THREADSAFE_ISUPPORTS
nsresult Cancel() override;
NS_FORWARD_NSIRUNNABLE(mRunnable->)
@ -84,10 +83,7 @@ ContextLossWorkerEventTarget::IsOnCurrentThread(bool* aResult)
return mEventTarget->IsOnCurrentThread(aResult);
}
NS_IMPL_ISUPPORTS(ContextLossWorkerRunnable, nsICancelableRunnable,
nsIRunnable)
NS_IMETHODIMP
nsresult
ContextLossWorkerRunnable::Cancel()
{
mRunnable = nullptr;

View File

@ -57,7 +57,7 @@ if (NS_FAILED(rv)) { \
return; \
}
class WebCryptoTask : public nsCancelableRunnable,
class WebCryptoTask : public CancelableRunnable,
public nsNSSShutDownObject
{
public:

View File

@ -54,7 +54,7 @@ AsyncEventDispatcher::Run()
return NS_OK;
}
NS_IMETHODIMP
nsresult
AsyncEventDispatcher::Cancel()
{
mCanceled = true;

View File

@ -25,7 +25,7 @@ namespace mozilla {
* the wrong time, in order to avoid resulting instability.
*/
class AsyncEventDispatcher : public nsCancelableRunnable
class AsyncEventDispatcher : public CancelableRunnable
{
public:
/**
@ -60,7 +60,7 @@ public:
AsyncEventDispatcher(dom::EventTarget* aTarget, WidgetEvent& aEvent);
NS_IMETHOD Run() override;
NS_IMETHOD Cancel() override;
nsresult Cancel() override;
nsresult PostDOMEvent();
void RunDOMEventWhenSafe();

View File

@ -77,7 +77,7 @@ PBackgroundInitializer::ActorCreated(mozilla::ipc::PBackgroundChild* aActor)
// This must be a CancelableRunnable because it can be dispatched to a worker
// thread. But we don't care about the Cancel() because in that case, Run() is
// not called and the task is deleted by the DTOR.
class AsyncStartRunnable final : public nsCancelableRunnable
class AsyncStartRunnable final : public CancelableRunnable
{
public:
explicit AsyncStartRunnable(FileSystemTaskChildBase* aTask)

View File

@ -78,7 +78,7 @@ DispatchToIOThread(nsIRunnable* aRunnable)
// This runnable is used when an error value is set before doing any real
// operation on the I/O thread. In this case we skip all and we directly
// communicate the error.
class ErrorRunnable final : public nsCancelableRunnable
class ErrorRunnable final : public CancelableRunnable
{
public:
explicit ErrorRunnable(FileSystemTaskChildBase* aTask)

View File

@ -1263,7 +1263,7 @@ HTMLCanvasElement::OnVisibilityChange()
}
if (mOffscreenCanvas) {
class Runnable final : public nsCancelableRunnable
class Runnable final : public CancelableRunnable
{
public:
explicit Runnable(AsyncCanvasRenderer* aRenderer)
@ -1305,7 +1305,7 @@ void
HTMLCanvasElement::OnMemoryPressure()
{
if (mOffscreenCanvas) {
class Runnable final : public nsCancelableRunnable
class Runnable final : public CancelableRunnable
{
public:
explicit Runnable(AsyncCanvasRenderer* aRenderer)

View File

@ -2530,8 +2530,10 @@ BackgroundRequestChild::Recv__delete__(const RequestResponse& aResponse)
* BackgroundCursorChild
******************************************************************************/
// Does not need to be threadsafe since this only runs on one thread, but
// inheriting from CancelableRunnable is easy.
class BackgroundCursorChild::DelayedActionRunnable final
: public nsICancelableRunnable
: public CancelableRunnable
{
using ActionFunc = void (BackgroundCursorChild::*)();
@ -2552,15 +2554,12 @@ public:
MOZ_ASSERT(mActionFunc);
}
// Does not need to be threadsafe since this only runs on one thread.
NS_DECL_ISUPPORTS
private:
~DelayedActionRunnable()
{ }
NS_DECL_NSIRUNNABLE
NS_DECL_NSICANCELABLERUNNABLE
nsresult Cancel() override;
};
BackgroundCursorChild::BackgroundCursorChild(IDBRequest* aRequest,
@ -2997,10 +2996,6 @@ BackgroundCursorChild::RecvResponse(const CursorResponse& aResponse)
return true;
}
NS_IMPL_ISUPPORTS(BackgroundCursorChild::DelayedActionRunnable,
nsIRunnable,
nsICancelableRunnable)
NS_IMETHODIMP
BackgroundCursorChild::
DelayedActionRunnable::Run()
@ -3018,7 +3013,7 @@ DelayedActionRunnable::Run()
return NS_OK;
}
NS_IMETHODIMP
nsresult
BackgroundCursorChild::
DelayedActionRunnable::Cancel()
{

View File

@ -7792,7 +7792,7 @@ class NormalJSRuntime
{
friend class nsAutoPtr<NormalJSRuntime>;
static const JSClass kGlobalClass;
static const JSClass sGlobalClass;
static const uint32_t kRuntimeHeapSize = 768 * 1024;
JSRuntime* mRuntime;
@ -23761,9 +23761,7 @@ CreateIndexOp::DoDatabaseWork(DatabaseConnection* aConnection)
return NS_OK;
}
const JSClass NormalJSRuntime::kGlobalClass = {
"IndexedDBTransactionThreadGlobal",
JSCLASS_GLOBAL_FLAGS,
static const JSClassOps sNormalJSRuntimeGlobalClassOps = {
/* addProperty */ nullptr,
/* delProperty */ nullptr,
/* getProperty */ nullptr,
@ -23778,6 +23776,12 @@ const JSClass NormalJSRuntime::kGlobalClass = {
/* trace */ JS_GlobalObjectTraceHook
};
const JSClass NormalJSRuntime::sGlobalClass = {
"IndexedDBTransactionThreadGlobal",
JSCLASS_GLOBAL_FLAGS,
&sNormalJSRuntimeGlobalClassOps
};
bool
NormalJSRuntime::Init()
{
@ -23799,7 +23803,7 @@ NormalJSRuntime::Init()
JSAutoRequest ar(mContext);
JS::CompartmentOptions options;
mGlobal = JS_NewGlobalObject(mContext, &kGlobalClass, nullptr,
mGlobal = JS_NewGlobalObject(mContext, &sGlobalClass, nullptr,
JS::FireOnNewGlobalHook, options);
if (NS_WARN_IF(!mGlobal)) {
return false;

View File

@ -67,7 +67,7 @@ const char kMemoryPressureObserverTopic[] = "memory-pressure";
const char kWindowObserverTopic[] = "inner-window-destroyed";
class CancelableRunnableWrapper final
: public nsICancelableRunnable
: public CancelableRunnable
{
nsCOMPtr<nsIRunnable> mRunnable;
@ -79,14 +79,12 @@ public:
MOZ_ASSERT(aRunnable);
}
NS_DECL_ISUPPORTS
private:
~CancelableRunnableWrapper()
{ }
NS_DECL_NSIRUNNABLE
NS_DECL_NSICANCELABLERUNNABLE
nsresult Cancel() override;
};
class DatabaseFile final
@ -1275,8 +1273,6 @@ IDBDatabase::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
return IDBDatabaseBinding::Wrap(aCx, this, aGivenProto);
}
NS_IMPL_ISUPPORTS(CancelableRunnableWrapper, nsIRunnable, nsICancelableRunnable)
NS_IMETHODIMP
CancelableRunnableWrapper::Run()
{
@ -1290,7 +1286,7 @@ CancelableRunnableWrapper::Run()
return NS_OK;
}
NS_IMETHODIMP
nsresult
CancelableRunnableWrapper::Cancel()
{
if (mRunnable) {

View File

@ -212,7 +212,7 @@ EventTargetIsOnCurrentThread(nsIEventTarget* aEventTarget)
}
class CancelableRunnableWrapper final
: public nsCancelableRunnable
: public CancelableRunnable
{
nsCOMPtr<nsIRunnable> mRunnable;
#ifdef DEBUG
@ -238,10 +238,10 @@ private:
{ }
NS_DECL_NSIRUNNABLE
NS_DECL_NSICANCELABLERUNNABLE
nsresult Cancel() override;
};
NS_IMPL_ISUPPORTS_INHERITED0(CancelableRunnableWrapper, nsCancelableRunnable)
NS_IMPL_ISUPPORTS_INHERITED0(CancelableRunnableWrapper, CancelableRunnable)
NS_IMETHODIMP
CancelableRunnableWrapper::Run()
@ -261,7 +261,7 @@ CancelableRunnableWrapper::Run()
return NS_OK;
}
NS_IMETHODIMP
nsresult
CancelableRunnableWrapper::Cancel()
{
DebugOnly<bool> onTarget;

View File

@ -42,6 +42,7 @@
#include "mozilla/ipc/FileDescriptorSetChild.h"
#include "mozilla/ipc/FileDescriptorUtils.h"
#include "mozilla/ipc/GeckoChildProcessHost.h"
#include "mozilla/ipc/ProcessChild.h"
#include "mozilla/ipc/TestShellChild.h"
#include "mozilla/jsipc/CrossProcessObjectWrappers.h"
#include "mozilla/layers/APZChild.h"
@ -2229,14 +2230,14 @@ ContentChild::ActorDestroy(ActorDestroyReason why)
{
if (AbnormalShutdown == why) {
NS_WARNING("shutting down early because of crash!");
QuickExit();
ProcessChild::QuickExit();
}
#ifndef NS_FREE_PERMANENT_DATA
// In release builds, there's no point in the content process
// going through the full XPCOM shutdown path, because it doesn't
// keep persistent state.
QuickExit();
ProcessChild::QuickExit();
#else
if (sFirstIdleTask) {
sFirstIdleTask->Cancel();
@ -2257,7 +2258,7 @@ ContentChild::ActorDestroy(ActorDestroyReason why)
if (IsNuwaProcess()) {
// The Nuwa cannot go through the full XPCOM shutdown path or deadlock
// will result.
QuickExit();
ProcessChild::QuickExit();
}
#endif
@ -2298,21 +2299,6 @@ ContentChild::ProcessingError(Result aCode, const char* aReason)
NS_RUNTIMEABORT("Content child abort due to IPC error");
}
void
ContentChild::QuickExit()
{
NS_WARNING("content process _exit()ing");
#ifdef XP_WIN
// In bug 1254829, the destructor got called when dll got detached on windows,
// switch to TerminateProcess to bypass dll detach handler during the process
// termination.
TerminateProcess(GetCurrentProcess(), 0);
#else
_exit(0);
#endif
}
nsresult
ContentChild::AddRemoteAlertObserver(const nsString& aData,
nsIObserver* aObserver)

View File

@ -615,12 +615,6 @@ private:
virtual void ProcessingError(Result aCode, const char* aReason) override;
/**
* Exit *now*. Do not shut down XPCOM, do not pass Go, do not run
* static destructors, do not collect $200.
*/
MOZ_NORETURN void QuickExit();
InfallibleTArray<nsAutoPtr<AlertObserver> > mAlertObservers;
RefPtr<ConsoleListener> mConsoleListener;

View File

@ -19,12 +19,14 @@
#include "gmp-video-encode.h"
#include "GMPPlatform.h"
#include "mozilla/dom/CrashReporterChild.h"
#include "mozilla/ipc/ProcessChild.h"
#include "GMPUtils.h"
#include "prio.h"
#ifdef MOZ_WIDEVINE_EME
#include "widevine-adapter/WidevineAdapter.h"
#endif
using namespace mozilla::ipc;
using mozilla::dom::CrashReporterChild;
static const int MAX_VOUCHER_LENGTH = 500000;
@ -430,7 +432,7 @@ GMPChild::ActorDestroy(ActorDestroyReason aWhy)
}
if (AbnormalShutdown == aWhy) {
NS_WARNING("Abnormal shutdown of GMP process!");
_exit(0);
ProcessChild::QuickExit();
}
XRE_ShutdownChildProcess();

View File

@ -378,10 +378,11 @@ MediaCodecDataDecoder::InitDecoder(Surface::Param aSurface)
NS_ENSURE_SUCCESS(rv = ResetInputBuffers(), rv);
NS_ENSURE_SUCCESS(rv = ResetOutputBuffers(), rv);
NS_NewNamedThread("MC Decoder", getter_AddRefs(mThread),
NS_NewRunnableMethod(this, &MediaCodecDataDecoder::DecoderLoop));
rv = NS_NewNamedThread(
"MC Decoder", getter_AddRefs(mThread),
NS_NewRunnableMethod(this, &MediaCodecDataDecoder::DecoderLoop));
return NS_OK;
return rv;
}
// This is in usec, so that's 10ms.
@ -671,18 +672,27 @@ MediaCodecDataDecoder::State() const
return mState;
}
void
bool
MediaCodecDataDecoder::State(ModuleState aState)
{
LOG("%s -> %s", ModuleStateStr(mState), ModuleStateStr(aState));
bool ok = true;
if (aState == kDrainDecoder) {
MOZ_ASSERT(mState == kDrainQueue);
if (mState == kShutdown) {
ok = false;
} else if (mState == kStopping) {
ok = aState == kShutdown;
} else if (aState == kDrainDecoder) {
ok = mState == kDrainQueue;
} else if (aState == kDrainWaitEOS) {
MOZ_ASSERT(mState == kDrainDecoder);
ok = mState == kDrainDecoder;
}
mState = aState;
if (ok) {
LOG("%s -> %s", ModuleStateStr(mState), ModuleStateStr(aState));
mState = aState;
}
return ok;
}
template<typename T>
@ -728,7 +738,9 @@ nsresult
MediaCodecDataDecoder::Flush()
{
MonitorAutoLock lock(mMonitor);
State(kFlushing);
if (!State(kFlushing)) {
return NS_OK;
}
lock.Notify();
while (State() == kFlushing) {
@ -758,15 +770,10 @@ MediaCodecDataDecoder::Shutdown()
{
MonitorAutoLock lock(mMonitor);
if (State() == kStopping) {
// Already shutdown or in the process of doing so
return NS_OK;
}
State(kStopping);
lock.Notify();
while (mThread && State() == kStopping) {
while (mThread && State() != kShutdown) {
lock.Wait();
}

View File

@ -107,7 +107,8 @@ protected:
widget::sdk::MediaFormat::Param aFormat,
int32_t aStatus);
ModuleState State() const;
void State(ModuleState aState);
// Sets decoder state and returns whether the new state has become effective.
bool State(ModuleState aState);
void DecoderLoop();
virtual void ClearQueue();

View File

@ -295,10 +295,11 @@ MediaEngineTabVideoSource::Draw() {
size,
stride,
SurfaceFormat::B8G8R8X8);
if (!dt) {
if (!dt || !dt->IsValid()) {
return;
}
RefPtr<gfxContext> context = new gfxContext(dt);
RefPtr<gfxContext> context = gfxContext::ForDrawTarget(dt);
MOZ_ASSERT(context); // already checked the draw target above
context->SetMatrix(context->CurrentMatrix().Scale((((float) size.width)/mViewportWidth),
(((float) size.height)/mViewportHeight)));

View File

@ -48,13 +48,11 @@ using namespace mozilla::dom::workers;
namespace mozilla {
namespace dom {
class PostMessageRunnable final : public nsICancelableRunnable
class PostMessageRunnable final : public CancelableRunnable
{
friend class MessagePort;
public:
NS_DECL_ISUPPORTS
PostMessageRunnable(MessagePort* aPort, SharedMessagePortMessage* aData)
: mPort(aPort)
, mData(aData)
@ -81,7 +79,7 @@ public:
return rv;
}
NS_IMETHOD
nsresult
Cancel() override
{
mPort = nullptr;
@ -165,8 +163,6 @@ private:
RefPtr<SharedMessagePortMessage> mData;
};
NS_IMPL_ISUPPORTS(PostMessageRunnable, nsICancelableRunnable, nsIRunnable)
NS_IMPL_CYCLE_COLLECTION_CLASS(MessagePort)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(MessagePort,

View File

@ -218,8 +218,23 @@ CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj,
JS::Handle<jsid> id, NPVariant* getPropertyResult,
JS::MutableHandle<JS::Value> vp);
const static js::ClassOps sNPObjectJSWrapperClassOps = {
NPObjWrapper_AddProperty,
NPObjWrapper_DelProperty,
NPObjWrapper_GetProperty,
NPObjWrapper_SetProperty,
nullptr,
NPObjWrapper_Resolve,
nullptr, /* mayResolve */
NPObjWrapper_Finalize,
NPObjWrapper_Call,
nullptr, /* hasInstance */
NPObjWrapper_Construct,
nullptr, /* trace */
};
const static js::ClassExtension sNPObjectJSWrapperClassExtension = {
nullptr, /* weakmapKeyDelegateOp */
nullptr, /* weakmapKeyDelegateOp */
NPObjWrapper_ObjectMoved
};
@ -237,26 +252,14 @@ const static js::ObjectOps sNPObjectJSWrapperObjectOps = {
nullptr,
};
const static js::Class sNPObjectJSWrapperClass =
{
const static js::Class sNPObjectJSWrapperClass = {
NPRUNTIME_JSCLASS_NAME,
JSCLASS_HAS_PRIVATE,
NPObjWrapper_AddProperty,
NPObjWrapper_DelProperty,
NPObjWrapper_GetProperty,
NPObjWrapper_SetProperty,
nullptr,
NPObjWrapper_Resolve,
nullptr, /* mayResolve */
NPObjWrapper_Finalize,
NPObjWrapper_Call,
nullptr, /* hasInstance */
NPObjWrapper_Construct,
nullptr, /* trace */
&sNPObjectJSWrapperClassOps,
JS_NULL_CLASS_SPEC,
&sNPObjectJSWrapperClassExtension,
&sNPObjectJSWrapperObjectOps
};
};
typedef struct NPObjectMemberPrivate {
JS::Heap<JSObject *> npobjWrapper;
@ -281,14 +284,17 @@ NPObjectMember_Trace(JSTracer *trc, JSObject *obj);
static bool
NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, JS::Value *vp);
static const JSClass sNPObjectMemberClass =
{
"NPObject Ambiguous Member class", JSCLASS_HAS_PRIVATE,
nullptr, nullptr, NPObjectMember_GetProperty, nullptr,
nullptr, nullptr, nullptr,
NPObjectMember_Finalize, NPObjectMember_Call,
nullptr, nullptr, NPObjectMember_Trace
};
static const JSClassOps sNPObjectMemberClassOps = {
nullptr, nullptr, NPObjectMember_GetProperty, nullptr,
nullptr, nullptr, nullptr,
NPObjectMember_Finalize, NPObjectMember_Call,
nullptr, nullptr, NPObjectMember_Trace
};
static const JSClass sNPObjectMemberClass = {
"NPObject Ambiguous Member class", JSCLASS_HAS_PRIVATE,
&sNPObjectMemberClassOps
};
static void
OnWrapperDestroyed();

View File

@ -5,7 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifdef MOZ_WIDGET_QT
#include <unistd.h> // for _exit()
#include <QtCore/QTimer>
#include "nsQAppInstance.h"
#include "NestedLoopTimer.h"
@ -33,6 +32,7 @@
#ifdef MOZ_X11
# include "mozilla/X11Util.h"
#endif
#include "mozilla/ipc/ProcessChild.h"
#include "mozilla/plugins/PluginInstanceChild.h"
#include "mozilla/plugins/StreamNotifyChild.h"
#include "mozilla/plugins/BrowserStreamChild.h"
@ -57,6 +57,7 @@
#include "GeckoProfiler.h"
using namespace mozilla;
using namespace mozilla::ipc;
using namespace mozilla::plugins;
using namespace mozilla::widget;
using mozilla::dom::CrashReporterChild;
@ -786,13 +787,6 @@ PluginModuleChild::RecvSetAudioSessionData(const nsID& aId,
#endif
}
void
PluginModuleChild::QuickExit()
{
NS_WARNING("plugin process _exit()ing");
_exit(0);
}
PPluginModuleChild*
PluginModuleChild::AllocPPluginModuleChild(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherPid)
@ -843,7 +837,7 @@ PluginModuleChild::ActorDestroy(ActorDestroyReason why)
if (AbnormalShutdown == why) {
NS_WARNING("shutting down early because of crash!");
QuickExit();
ProcessChild::QuickExit();
}
if (!mHasShutdown) {

View File

@ -142,8 +142,6 @@ protected:
virtual void
ActorDestroy(ActorDestroyReason why) override;
MOZ_NORETURN void QuickExit();
virtual bool
RecvProcessNativeEventsInInterruptCall() override;

View File

@ -4,7 +4,6 @@ support-files =
hang_test.js
privatemode_perwindowpb.xul
plugin-utils.js
!/toolkit/crashreporter/test/browser/crashreport.sjs
[test_bug479979.xul]
[test_bug751809.html]

View File

@ -21,7 +21,7 @@
namespace mozilla {
namespace dom {
class FlushRejections: public nsCancelableRunnable
class FlushRejections: public CancelableRunnable
{
public:
static void Init() {

View File

@ -51,6 +51,7 @@ support-files =
!/image/test/mochitest/damon.jpg
!/image/test/mochitest/over.png
!/image/test/mochitest/red.png
!/dom/base/test/file_empty.html
[test_497898.html]
skip-if = ((buildapp == 'mulet' || buildapp == 'b2g') && toolkit != 'gonk') || toolkit == 'android' #Bug 931116, b2g desktop specific, initial triage
@ -135,3 +136,4 @@ skip-if = buildapp == 'b2g' # Bug 1184427 - no SSL certs on b2g
skip-if = buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android' # Mouse doesn't select in the same way
# Disabled on Android, see bug 1230232
[test_WebKitCSSMatrix.html]
[test_resource_timing_frameset.html]

View File

@ -35,7 +35,7 @@ function doTest() {
var resources = window.performance.getEntriesByType("resource");
for (var i = 0 ; i < resources.length; i++) {
var entry = resources[i];
if (entry.initiatorType === "subdocument") {
if (entry.initiatorType === "iframe") {
ok(false, "unexpected iframe " + entry.name);
}
}

View File

@ -188,7 +188,7 @@ function checkEntries(anEntryList) {
"http://mochi.test:8888/tests/image/test/mochitest/blue.png" : "img",
"http://mochi.test:8888/tests/image/test/mochitest/red.png" : "object",
"http://mochi.test:8888/tests/image/test/mochitest/big.png" : "embed",
"http://mochi.test:8888/tests/dom/tests/mochitest/general/resource_timing_iframe.html" : "subdocument"};
"http://mochi.test:8888/tests/dom/tests/mochitest/general/resource_timing_iframe.html" : "iframe"};
for (resourceName in allResources) {
// Check that we have a resource with the specific name.

View File

@ -0,0 +1,29 @@
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html lang="en">
<head>
<meta charset="utf-8">
<title>browser_frametree_sample_frameset.html</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="text/javascript">
SimpleTest.waitForExplicitFinish();
window.addEventListener("load", function() {
var frameEntries = performance.getEntriesByName("http://mochi.test:8888/tests/dom/base/test/file_empty.html");
is(frameEntries.length, 2, "correct number");
is(frameEntries[0].initiatorType, "frame", "correct type");
SimpleTest.finish();
});
</script>
</head>
<frameset id="frames" rows="50%, 50%">
<frame src="http://mochi.test:8888/tests/dom/base/test/file_empty.html">
<frame src="http://mochi.test:8888/tests/dom/base/test/file_empty.html">
</frameset>
</html>

View File

@ -318,7 +318,8 @@ private:
PostRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate, bool aRunResult)
override;
NS_DECL_NSICANCELABLERUNNABLE
nsresult
Cancel() override;
void
ShutdownScriptLoader(JSContext* aCx,
@ -1892,7 +1893,7 @@ ScriptExecutorRunnable::PostRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
}
}
NS_IMETHODIMP
nsresult
ScriptExecutorRunnable::Cancel()
{
if (mLastIndex == mScriptLoader.mLoadInfos.Length() - 1) {

View File

@ -161,7 +161,7 @@ public:
return true;
}
NS_IMETHOD
nsresult
Cancel() override
{
Done(false);
@ -378,7 +378,7 @@ public:
return DispatchLifecycleEvent(aCx, aWorkerPrivate);
}
NS_IMETHOD
nsresult
Cancel() override
{
mCallback->SetResult(false);
@ -845,7 +845,7 @@ private:
bool
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override;
NS_IMETHOD
nsresult
Cancel() override
{
// Always ensure the handler is released on the worker thread, even if we
@ -1264,7 +1264,7 @@ public:
return DispatchFetchEvent(aCx, aWorkerPrivate);
}
NS_IMETHOD
nsresult
Cancel() override
{
nsCOMPtr<nsIRunnable> runnable = new ResumeRequest(mInterceptedChannel);

View File

@ -213,11 +213,11 @@ SwapToISupportsArray(SmartPtr<T>& aSrc,
// from the worker's EventTarget).
class ExternalRunnableWrapper final : public WorkerRunnable
{
nsCOMPtr<nsICancelableRunnable> mWrappedRunnable;
nsCOMPtr<nsIRunnable> mWrappedRunnable;
public:
ExternalRunnableWrapper(WorkerPrivate* aWorkerPrivate,
nsICancelableRunnable* aWrappedRunnable)
nsIRunnable* aWrappedRunnable)
: WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount),
mWrappedRunnable(aWrappedRunnable)
{
@ -244,10 +244,14 @@ private:
return true;
}
NS_IMETHOD
nsresult
Cancel() override
{
nsresult rv = mWrappedRunnable->Cancel();
nsresult rv;
nsCOMPtr<nsICancelableRunnable> cancelable =
do_QueryInterface(mWrappedRunnable);
MOZ_ASSERT(cancelable); // We checked this earlier!
rv = cancelable->Cancel();
nsresult rv2 = WorkerRunnable::Cancel();
return NS_FAILED(rv) ? rv : rv2;
}
@ -624,7 +628,7 @@ private:
return true;
}
NS_IMETHOD Cancel() override
nsresult Cancel() override
{
// We need to run regardless.
Run();
@ -1345,7 +1349,7 @@ private:
return true;
}
NS_IMETHOD Cancel() override
nsresult Cancel() override
{
// We need to run regardless.
Run();
@ -1655,7 +1659,7 @@ private:
return aWorkerPrivate->ConnectMessagePort(aCx, mPortIdentifier);
}
NS_IMETHOD
nsresult
Cancel() override
{
MessagePort::ForceClose(mPortIdentifier);
@ -2472,7 +2476,7 @@ WorkerPrivateParent<Derived>::MaybeWrapAsWorkerRunnable(already_AddRefed<nsIRunn
}
workerRunnable =
new ExternalRunnableWrapper(ParentAsWorkerPrivate(), cancelable);
new ExternalRunnableWrapper(ParentAsWorkerPrivate(), runnable);
return workerRunnable.forget();
}

View File

@ -215,7 +215,7 @@ NS_IMPL_RELEASE(WorkerRunnable)
NS_INTERFACE_MAP_BEGIN(WorkerRunnable)
NS_INTERFACE_MAP_ENTRY(nsIRunnable)
NS_INTERFACE_MAP_ENTRY(nsICancelableRunnable)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIRunnable)
// kWorkerRunnableIID is special in that it does not AddRef its result.
if (aIID.Equals(kWorkerRunnableIID)) {
*aInstancePtr = this;
@ -402,7 +402,7 @@ WorkerRunnable::Run()
return result ? NS_OK : NS_ERROR_FAILURE;
}
NS_IMETHODIMP
nsresult
WorkerRunnable::Cancel()
{
uint32_t canceledCount = ++mCanceled;
@ -477,7 +477,7 @@ StopSyncLoopRunnable::StopSyncLoopRunnable(
#endif
}
NS_IMETHODIMP
nsresult
StopSyncLoopRunnable::Cancel()
{
nsresult rv = Run();
@ -534,7 +534,7 @@ WorkerControlRunnable::WorkerControlRunnable(WorkerPrivate* aWorkerPrivate,
}
#endif
NS_IMETHODIMP
nsresult
WorkerControlRunnable::Cancel()
{
if (NS_FAILED(Run())) {

View File

@ -29,7 +29,8 @@ class WorkerPrivate;
// Use this runnable to communicate from the worker to its parent or vice-versa.
// The busy count must be taken into consideration and declared at construction
// time.
class WorkerRunnable : public nsICancelableRunnable
class WorkerRunnable : public nsIRunnable,
public nsICancelableRunnable
{
public:
enum TargetAndBusyBehavior {
@ -71,7 +72,8 @@ public:
// If you override Cancel() then you'll need to either call the base class
// Cancel() method or override IsCanceled() so that the Run() method bails out
// appropriately.
NS_DECL_NSICANCELABLERUNNABLE
nsresult
Cancel() override;
// The return value is true if and only if both PreDispatch and
// DispatchInternal return true.
@ -277,7 +279,8 @@ public:
// By default StopSyncLoopRunnables cannot be canceled since they could leave
// a sync loop spinning forever.
NS_DECL_NSICANCELABLERUNNABLE
nsresult
Cancel() override;
protected:
virtual ~StopSyncLoopRunnable()
@ -354,7 +357,7 @@ protected:
virtual ~WorkerControlRunnable()
{ }
NS_IMETHOD
nsresult
Cancel() override;
public:

View File

@ -499,7 +499,7 @@ class LoadStartDetectionRunnable final : public nsRunnable,
return true;
}
NS_IMETHOD
nsresult
Cancel() override
{
// This must run!

View File

@ -72,10 +72,10 @@ onconnect = function(event) {
throw new Error("'connect' event has data: " + event.data);
}
// "".contains("") should trigger a warning in debug builds, but NOT fire
// error events at us. If we ever actually remove contains() we'll need
// something else to test this case.
"".contains("");
// The expression closures should trigger a warning in debug builds, but NOT
// fire error events at us. If we ever actually remove expression closures
// (in bug 1083458), we'll need something else to test this case.
(function() "Expected console warning: expression closures are deprecated");
event.ports[0].onmessage = function(event) {
if (!(event instanceof MessageEvent)) {

View File

@ -86,15 +86,19 @@ XBLEnumerate(JSContext *cx, JS::Handle<JSObject*> obj)
return protoBinding->ResolveAllFields(cx, obj);
}
static const JSClassOps gPrototypeJSClassOps = {
nullptr, nullptr, nullptr, nullptr,
XBLEnumerate, nullptr,
nullptr, XBLFinalize,
nullptr, nullptr, nullptr, nullptr
};
static const JSClass gPrototypeJSClass = {
"XBL prototype JSClass",
JSCLASS_HAS_PRIVATE | JSCLASS_PRIVATE_IS_NSISUPPORTS |
// Our one reserved slot holds the relevant nsXBLPrototypeBinding
JSCLASS_HAS_RESERVED_SLOTS(1),
nullptr, nullptr, nullptr, nullptr,
XBLEnumerate, nullptr,
nullptr, XBLFinalize,
nullptr, nullptr, nullptr, nullptr
&gPrototypeJSClassOps
};
// Implementation /////////////////////////////////////////////////////////////////

Some files were not shown because too many files have changed in this diff Show More