Merge inbound to mozilla-central. a=merge

This commit is contained in:
Margareta Eliza Balazs 2018-08-17 12:46:14 +03:00
Родитель 0d855aa7f1 af13fc5613
Коммит 6c198262de
80 изменённых файлов: 815 добавлений и 449 удалений

1
Cargo.lock сгенерированный
Просмотреть файл

@ -1878,7 +1878,6 @@ version = "0.19.0"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.24.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",

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

@ -311,11 +311,8 @@ else
ifneq ($(CC_TYPE),msvc)
maybe_clobber_profiledbuild: clean
ifneq (,$(findstring clang,$(CC_TYPE)))
# 32-bit Windows PGO is currently blocked by bug 1479800
ifneq ($(CC_TYPE)_$(CPU_ARCH),clang-cl_x86)
$(LLVM_PROFDATA) merge -o $(DEPTH)/merged.profdata $(DEPTH)/*.profraw
endif
endif
else
maybe_clobber_profiledbuild:
$(RM) $(DIST)/bin/*.pgc

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

@ -149,6 +149,7 @@ support-files =
run-if = e10s
[browser_urlHighlight.js]
[browser_urlOverflow.js]
skip-if = true # Bug 1482557
[browser_wyciwyg_urlbarCopying.js]
subsuite = clipboard
support-files =

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

@ -6,7 +6,6 @@
/* globals ExtensionAPI */
const STYLESHEET_URI = "chrome://formautofill/content/formautofill.css";
const CACHED_STYLESHEETS = new WeakMap();
ChromeUtils.import("resource://gre/modules/Services.jsm");
@ -44,7 +43,9 @@ function onMaybeOpenPopup(evt) {
return;
}
insertStyleSheet(domWindow, STYLESHEET_URI);
insertStyleSheet(domWindow, "chrome://formautofill/content/formautofill.css");
insertStyleSheet(domWindow, "resource://formautofill/autocomplete-item-shared.css");
insertStyleSheet(domWindow, "resource://formautofill/autocomplete-item.css");
}
function isAvailable() {

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

@ -72,6 +72,8 @@ add_task(async function test_phishing_warning_single_category() {
ok(warningBox, "Got phishing warning box");
await expectWarningText(browser, "Autofills phone");
is(warningBox.ownerGlobal.getComputedStyle(warningBox).backgroundColor,
"rgba(248, 232, 28, 0.2)", "Check warning text background color");
await closePopup(browser);
});

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

@ -63,6 +63,14 @@ def import_clang_tidy(source_dir):
def build_package(package_build_dir, cmake_args):
if not os.path.exists(package_build_dir):
os.mkdir(package_build_dir)
# If CMake has already been run, it may have been run with different
# arguments, so we need to re-run it. Make sure the cached copy of the
# previous CMake run is cleared before running it again.
if os.path.exists(package_build_dir + "/CMakeCache.txt"):
os.remove(package_build_dir + "/CMakeCache.txt")
if os.path.exists(package_build_dir + "/CMakeFiles"):
shutil.rmtree(package_build_dir + "/CMakeFiles")
run_in(package_build_dir, ["cmake"] + cmake_args)
run_in(package_build_dir, ["ninja", "install"])
@ -176,66 +184,70 @@ def is_windows():
def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool,
src_dir, stage_dir, build_libcxx,
osx_cross_compile, build_type, assertions,
python_path, gcc_dir, libcxx_include_dir):
python_path, gcc_dir, libcxx_include_dir,
is_final_stage=False):
if not os.path.exists(stage_dir):
os.mkdir(stage_dir)
build_dir = stage_dir + "/build"
inst_dir = stage_dir + "/clang"
# If CMake has already been run, it may have been run with different
# arguments, so we need to re-run it. Make sure the cached copy of the
# previous CMake run is cleared before running it again.
if os.path.exists(build_dir + "/CMakeCache.txt"):
os.remove(build_dir + "/CMakeCache.txt")
if os.path.exists(build_dir + "/CMakeFiles"):
shutil.rmtree(build_dir + "/CMakeFiles")
# cmake doesn't deal well with backslashes in paths.
def slashify_path(path):
return path.replace('\\', '/')
cmake_args = ["-GNinja",
"-DCMAKE_C_COMPILER=%s" % slashify_path(cc[0]),
"-DCMAKE_CXX_COMPILER=%s" % slashify_path(cxx[0]),
"-DCMAKE_ASM_COMPILER=%s" % slashify_path(asm[0]),
"-DCMAKE_LINKER=%s" % slashify_path(ld[0]),
"-DCMAKE_AR=%s" % slashify_path(ar),
"-DCMAKE_C_FLAGS=%s" % ' '.join(cc[1:]),
"-DCMAKE_CXX_FLAGS=%s" % ' '.join(cxx[1:]),
"-DCMAKE_ASM_FLAGS=%s" % ' '.join(asm[1:]),
"-DCMAKE_EXE_LINKER_FLAGS=%s" % ' '.join(ld[1:]),
"-DCMAKE_SHARED_LINKER_FLAGS=%s" % ' '.join(ld[1:]),
"-DCMAKE_BUILD_TYPE=%s" % build_type,
"-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64",
"-DLLVM_ENABLE_ASSERTIONS=%s" % ("ON" if assertions else "OFF"),
"-DPYTHON_EXECUTABLE=%s" % slashify_path(python_path),
"-DCMAKE_INSTALL_PREFIX=%s" % inst_dir,
"-DLLVM_TOOL_LIBCXX_BUILD=%s" % ("ON" if build_libcxx else "OFF"),
"-DLIBCXX_LIBCPPABI_VERSION=\"\"",
src_dir]
if is_windows():
cmake_args.insert(-1, "-DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON")
cmake_args.insert(-1, "-DLLVM_USE_CRT_RELEASE=MT")
if ranlib is not None:
cmake_args += ["-DCMAKE_RANLIB=%s" % slashify_path(ranlib)]
if libtool is not None:
cmake_args += ["-DCMAKE_LIBTOOL=%s" % slashify_path(libtool)]
if osx_cross_compile:
cmake_args += ["-DCMAKE_SYSTEM_NAME=Darwin",
"-DCMAKE_SYSTEM_VERSION=10.10",
"-DLLVM_ENABLE_THREADS=OFF",
"-DLIBCXXABI_LIBCXX_INCLUDES=%s" % libcxx_include_dir,
"-DCMAKE_OSX_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
"-DCMAKE_FIND_ROOT_PATH=%s" % slashify_path(os.getenv("CROSS_CCTOOLS_PATH")), # noqa
"-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER",
"-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY",
"-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY",
"-DCMAKE_MACOSX_RPATH=ON",
"-DCMAKE_OSX_ARCHITECTURES=x86_64",
"-DDARWIN_osx_ARCHS=x86_64",
"-DDARWIN_osx_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
"-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin11"]
def cmake_base_args(cc, cxx, asm, ld, ar, ranlib, libtool, inst_dir):
cmake_args = [
"-GNinja",
"-DCMAKE_C_COMPILER=%s" % slashify_path(cc[0]),
"-DCMAKE_CXX_COMPILER=%s" % slashify_path(cxx[0]),
"-DCMAKE_ASM_COMPILER=%s" % slashify_path(asm[0]),
"-DCMAKE_LINKER=%s" % slashify_path(ld[0]),
"-DCMAKE_AR=%s" % slashify_path(ar),
"-DCMAKE_C_FLAGS=%s" % ' '.join(cc[1:]),
"-DCMAKE_CXX_FLAGS=%s" % ' '.join(cxx[1:]),
"-DCMAKE_ASM_FLAGS=%s" % ' '.join(asm[1:]),
"-DCMAKE_EXE_LINKER_FLAGS=%s" % ' '.join(ld[1:]),
"-DCMAKE_SHARED_LINKER_FLAGS=%s" % ' '.join(ld[1:]),
"-DCMAKE_BUILD_TYPE=%s" % build_type,
"-DCMAKE_INSTALL_PREFIX=%s" % inst_dir,
"-DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64",
"-DLLVM_ENABLE_ASSERTIONS=%s" % ("ON" if assertions else "OFF"),
"-DPYTHON_EXECUTABLE=%s" % slashify_path(python_path),
"-DLLVM_TOOL_LIBCXX_BUILD=%s" % ("ON" if build_libcxx else "OFF"),
"-DLIBCXX_LIBCPPABI_VERSION=\"\"",
]
if is_windows():
cmake_args.insert(-1, "-DLLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON")
cmake_args.insert(-1, "-DLLVM_USE_CRT_RELEASE=MT")
if ranlib is not None:
cmake_args += ["-DCMAKE_RANLIB=%s" % slashify_path(ranlib)]
if libtool is not None:
cmake_args += ["-DCMAKE_LIBTOOL=%s" % slashify_path(libtool)]
if osx_cross_compile:
cmake_args += [
"-DCMAKE_SYSTEM_NAME=Darwin",
"-DCMAKE_SYSTEM_VERSION=10.10",
"-DLLVM_ENABLE_THREADS=OFF",
"-DLIBCXXABI_LIBCXX_INCLUDES=%s" % libcxx_include_dir,
"-DCMAKE_OSX_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
"-DCMAKE_FIND_ROOT_PATH=%s" % slashify_path(os.getenv("CROSS_CCTOOLS_PATH")), # noqa
"-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER",
"-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY",
"-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY",
"-DCMAKE_MACOSX_RPATH=ON",
"-DCMAKE_OSX_ARCHITECTURES=x86_64",
"-DDARWIN_osx_ARCHS=x86_64",
"-DDARWIN_osx_SYSROOT=%s" % slashify_path(os.getenv("CROSS_SYSROOT")),
"-DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-apple-darwin11"
]
return cmake_args
cmake_args = cmake_base_args(
cc, cxx, asm, ld, ar, ranlib, libtool, inst_dir)
cmake_args += [
src_dir
]
build_package(build_dir, cmake_args)
if is_linux():
@ -243,6 +255,44 @@ def build_one_stage(cc, cxx, asm, ld, ar, ranlib, libtool,
# For some reasons the import library clang.lib of clang.exe is not
# installed, so we copy it by ourselves.
if is_windows():
# The compiler-rt cmake scripts don't allow to build it for multiple
# targets at once on Windows, so manually build the 32-bits compiler-rt
# during the final stage.
build_32_bit = False
if is_final_stage:
# Only build the 32-bits compiler-rt when we originally built for
# 64-bits, which we detect through the contents of the LIB
# environment variable, which we also adjust for a 32-bits build
# at the same time.
old_lib = os.environ['LIB']
new_lib = []
for l in old_lib.split(os.pathsep):
if l.endswith('x64'):
l = l[:-3] + 'x86'
build_32_bit = True
elif l.endswith('amd64'):
l = l[:-5]
build_32_bit = True
new_lib.append(l)
if build_32_bit:
os.environ['LIB'] = os.pathsep.join(new_lib)
compiler_rt_build_dir = stage_dir + '/compiler-rt'
compiler_rt_inst_dir = inst_dir + '/lib/clang/'
subdirs = os.listdir(compiler_rt_inst_dir)
assert len(subdirs) == 1
compiler_rt_inst_dir += subdirs[0]
cmake_args = cmake_base_args(
[os.path.join(inst_dir, 'bin', 'clang-cl.exe'), '-m32'] + cc[1:],
[os.path.join(inst_dir, 'bin', 'clang-cl.exe'), '-m32'] + cxx[1:],
[os.path.join(inst_dir, 'bin', 'clang-cl.exe'), '-m32'] + asm[1:],
ld, ar, ranlib, libtool, compiler_rt_inst_dir)
cmake_args += [
'-DLLVM_CONFIG_PATH=%s' % slashify_path(
os.path.join(inst_dir, 'bin', 'llvm-config')),
os.path.join(src_dir, 'projects', 'compiler-rt'),
]
build_package(compiler_rt_build_dir, cmake_args)
os.environ['LIB'] = old_lib
install_import_library(build_dir, inst_dir)
install_asan_symbols(build_dir, inst_dir)
@ -615,7 +665,8 @@ if __name__ == "__main__":
[ld] + extra_ldflags,
ar, ranlib, libtool,
llvm_source_dir, stage2_dir, build_libcxx, osx_cross_compile,
build_type, assertions, python_path, gcc_dir, libcxx_include_dir)
build_type, assertions, python_path, gcc_dir, libcxx_include_dir,
stages == 2)
if stages > 2:
stage3_dir = build_dir + '/stage3'
@ -630,7 +681,8 @@ if __name__ == "__main__":
[ld] + extra_ldflags,
ar, ranlib, libtool,
llvm_source_dir, stage3_dir, build_libcxx, osx_cross_compile,
build_type, assertions, python_path, gcc_dir, libcxx_include_dir)
build_type, assertions, python_path, gcc_dir, libcxx_include_dir,
stages == 3)
package_name = "clang"
if build_clang_tidy:

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

@ -16,6 +16,7 @@
"patches": [
"r318309.patch",
"r320462.patch",
"r327876.patch",
"loosen-msvc-detection.patch",
"fflush-before-unlocking.patch"
]

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

@ -15,6 +15,7 @@
"ml": "ml64.exe",
"patches": [
"loosen-msvc-detection.patch",
"r339636.patch"
"r339636.patch",
"workaround-issue38586.patch"
]
}

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

@ -0,0 +1,39 @@
From 522a892efc2ff22a2fd421b1ef4d9d9739d78b2e Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka@google.com>
Date: Mon, 19 Mar 2018 18:22:35 +0000
Subject: [PATCH] Fix CMake/MSVC when compiler-rt and llvm are built separately
Summary:
For some reason CMake can't find the `append` macro if LLVM is built separately and imported via `LLVM_CONFIG_PATH`.
Patch by Loo Rong Jie
Reviewers: rnk, vitalybuka
Reviewed By: rnk, vitalybuka
Subscribers: dberris, mgorny, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D43458
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@327876 91177308-0d34-0410-b5e6-96231b3b80d8
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 4b953b212..a02ef9532 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -339,7 +339,7 @@ if (CMAKE_LINKER MATCHES "link.exe$")
# it, but CMake doesn't seem to have a way to set linker flags for
# individual static libraries, so we enable the suppression flag for
# the whole compiler-rt project.
- append("/IGNORE:4221" CMAKE_STATIC_LINKER_FLAGS)
+ set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /IGNORE:4221")
endif()
add_subdirectory(include)
--
2.18.0

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

@ -0,0 +1,31 @@
diff --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 86ca2b3ef..f6ddd24eb 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -284,6 +284,26 @@ if(MSVC)
# warning from the MS linker complaining that it can't find the 'vc140.pdb'
# file used by our object library compilations.
list(APPEND SANITIZER_COMMON_CFLAGS /Z7)
+
+# Copied from llvm/cmake/modules/LLVMProcessSources.cmake
+function(llvm_replace_compiler_option var old new)
+ # Replaces a compiler option or switch `old' in `var' by `new'.
+ # If `old' is not in `var', appends `new' to `var'.
+ # Example: llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELEASE "-O3" "-O2")
+ # If the option already is on the variable, don't add it:
+ if( "${${var}}" MATCHES "(^| )${new}($| )" )
+ set(n "")
+ else()
+ set(n "${new}")
+ endif()
+ if( "${${var}}" MATCHES "(^| )${old}($| )" )
+ string( REGEX REPLACE "(^| )${old}($| )" " ${n} " ${var} "${${var}}" )
+ else()
+ set( ${var} "${${var}} ${n}" )
+ endif()
+ set( ${var} "${${var}}" PARENT_SCOPE )
+endfunction(llvm_replace_compiler_option)
+
llvm_replace_compiler_option(CMAKE_CXX_FLAGS "/Z[i7I]" "/Z7")
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_DEBUG "/Z[i7I]" "/Z7")
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z[i7I]" "/Z7")

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

@ -1262,9 +1262,10 @@ def pgo_flags(compiler, build_env, target):
if compiler.type in ('clang-cl', 'clang'):
profdata = os.path.join(topobjdir, 'merged.profdata')
if compiler.type == 'clang-cl':
# 32-bit PGO is currently blocked by bug 1479800
if target.cpu == 'x86_64':
gen_ldflags = ['clang_rt.profile-x86_64.lib']
elif target.cpu == 'x86':
gen_ldflags = ['clang_rt.profile-i386.lib']
else:
gen_ldflags = None
else:

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

@ -4,8 +4,10 @@
"use strict";
const { AddonManager } = require("resource://gre/modules/AddonManager.jsm");
const { BrowserToolboxProcess } =
require("resource://devtools/client/framework/ToolboxProcess.jsm");
const { Cc, Ci } = require("chrome");
const { DebuggerClient } = require("devtools/shared/client/debugger-client");
const { DebuggerServer } = require("devtools/server/main");
@ -87,6 +89,59 @@ function inspectDebugTarget(type, id) {
return () => {};
}
function installTemporaryExtension() {
const fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
fp.init(window, "Select Manifest File or Package (.xpi)", Ci.nsIFilePicker.modeOpen);
fp.open(async res => {
if (res == Ci.nsIFilePicker.returnCancel || !fp.file) {
return;
}
let file = fp.file;
// AddonManager.installTemporaryAddon accepts either
// addon directory or final xpi file.
if (!file.isDirectory() &&
!file.leafName.endsWith(".xpi") && !file.leafName.endsWith(".zip")) {
file = file.parent;
}
try {
await AddonManager.installTemporaryAddon(file);
} catch (e) {
console.error(e);
}
});
return () => {};
}
function reloadTemporaryExtension(actor) {
return async (_, getState) => {
const client = getState().runtime.client;
try {
await client.request({ to: actor, type: "reload" });
} catch (e) {
console.error(e);
}
};
}
function removeTemporaryExtension(id) {
return async () => {
try {
const addon = await AddonManager.getAddonByID(id);
if (addon) {
await addon.uninstall();
}
} catch (e) {
console.error(e);
}
};
}
function requestTabs() {
return async (dispatch, getState) => {
dispatch({ type: REQUEST_TABS_START });
@ -130,6 +185,9 @@ module.exports = {
connectRuntime,
disconnectRuntime,
inspectDebugTarget,
installTemporaryExtension,
reloadTemporaryExtension,
removeTemporaryExtension,
requestTabs,
requestExtensions,
};

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

@ -10,6 +10,8 @@ const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const ExtensionDetail = createFactory(require("./debugtarget/ExtensionDetail"));
const TabDetail = createFactory(require("./debugtarget/TabDetail"));
const TemporaryExtensionAction =
createFactory(require("./debugtarget/TemporaryExtensionAction"));
const Actions = require("../actions/index");
const { DEBUG_TARGETS } = require("../constants");
@ -30,6 +32,23 @@ class DebugTargetItem extends PureComponent {
dispatch(Actions.inspectDebugTarget(target.type, target.id));
}
renderAction() {
const { dispatch, target } = this.props;
return dom.div(
{},
dom.button(
{
onClick: e => this.inspect(),
className: "aboutdebugging-button",
},
"Inspect"
),
target.details.temporarilyInstalled
? TemporaryExtensionAction({ dispatch, target }) : null,
);
}
renderDetail() {
const { target } = this.props;
@ -69,16 +88,6 @@ class DebugTargetItem extends PureComponent {
);
}
renderInspectButton() {
return dom.button(
{
onClick: e => this.inspect(),
className: "aboutdebugging-button",
},
"Inspect"
);
}
render() {
return dom.li(
{
@ -86,7 +95,7 @@ class DebugTargetItem extends PureComponent {
},
this.renderIcon(),
this.renderInfo(),
this.renderInspectButton(),
this.renderAction(),
);
}
}

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

@ -11,6 +11,8 @@ const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const DebugTargetPane = createFactory(require("./DebugTargetPane"));
const RuntimeInfo = createFactory(require("./RuntimeInfo"));
const TemporaryExtensionInstaller =
createFactory(require("./debugtarget/TemporaryExtensionInstaller"));
const Services = require("Services");
@ -36,6 +38,7 @@ class RuntimePage extends PureComponent {
name: Services.appinfo.name,
version: Services.appinfo.version,
}),
TemporaryExtensionInstaller({ dispatch }),
DebugTargetPane({
dispatch,
name: "Temporary Extensions",

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

@ -33,7 +33,7 @@ class ExtensionDetail extends PureComponent {
renderUUID() {
const { target } = this.props;
const { manifestURL, uuid } = target;
const { manifestURL, uuid } = target.details;
const value = [
uuid,
@ -52,7 +52,8 @@ class ExtensionDetail extends PureComponent {
render() {
const { target } = this.props;
const { id, location, uuid } = target;
const { id, details } = target;
const { location, uuid } = details;
return dom.dl(
{

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

@ -19,7 +19,7 @@ class TabDetail extends PureComponent {
}
render() {
return dom.div({ className: "ellipsis-text" }, this.props.target.url);
return dom.div({ className: "ellipsis-text" }, this.props.target.details.url);
}
}

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

@ -0,0 +1,54 @@
/* 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/. */
"use strict";
const { PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const Actions = require("../../actions/index");
/**
* This component provides components that reload/remove temporary extension.
*/
class TemporaryExtensionAction extends PureComponent {
static get propTypes() {
return {
dispatch: PropTypes.func.isRequired,
target: PropTypes.object.isRequired,
};
}
reload() {
const { dispatch, target } = this.props;
dispatch(Actions.reloadTemporaryExtension(target.details.actor));
}
remove() {
const { dispatch, target } = this.props;
dispatch(Actions.removeTemporaryExtension(target.id));
}
render() {
return [
dom.button(
{
className: "aboutdebugging-button",
onClick: e => this.reload()
},
"Reload",
),
dom.button(
{
className: "aboutdebugging-button",
onClick: e => this.remove()
},
"Remove",
),
];
}
}
module.exports = TemporaryExtensionAction;

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

@ -0,0 +1,38 @@
/* 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/. */
"use strict";
const { PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const Actions = require("../../actions/index");
/**
* This component provides an installer for temporary extension.
*/
class TemporaryExtensionInstaller extends PureComponent {
static get propTypes() {
return {
dispatch: PropTypes.func.isRequired,
};
}
install() {
this.props.dispatch(Actions.installTemporaryExtension());
}
render() {
return dom.button(
{
className: "aboutdebugging-button",
onClick: e => this.install()
},
"Load Temporary Add-on…"
);
}
}
module.exports = TemporaryExtensionInstaller;

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

@ -6,4 +6,6 @@ DevToolsModules(
'ExtensionDetail.css',
'ExtensionDetail.js',
'TabDetail.js',
'TemporaryExtensionAction.js',
'TemporaryExtensionInstaller.js',
)

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

@ -70,11 +70,23 @@ function getExtensionFilePath(extension) {
function toExtensionComponentData(extensions) {
return extensions.map(extension => {
const type = DEBUG_TARGETS.EXTENSION;
const { iconURL, id, manifestURL, name } = extension;
const { actor, iconURL, id, manifestURL, name, temporarilyInstalled } = extension;
const icon = iconURL || "chrome://mozapps/skin/extensions/extensionGeneric.svg";
const location = getExtensionFilePath(extension);
const uuid = manifestURL ? /moz-extension:\/\/([^/]*)/.exec(manifestURL)[1] : null;
return { type, id, icon, location, manifestURL, name, uuid };
return {
name,
icon,
id,
type,
details: {
actor,
location,
manifestURL,
temporarilyInstalled,
uuid,
},
};
});
}
@ -87,7 +99,15 @@ function toTabComponentData(tabs) {
: "chrome://devtools/skin/images/globe.svg";
const name = tab.title || tab.url;
const url = tab.url;
return { type, id, icon, name, url };
return {
name,
icon,
id,
type,
details: {
url,
},
};
});
}

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

@ -216,7 +216,12 @@ async function getFileForBinary() {
!await extractFiles()) {
return null;
}
return new FileUtils.File(ADB_BINARY_PATH);
const file = new FileUtils.File(ADB_BINARY_PATH);
if (!file.exists()) {
return null;
}
return file;
}
exports.getFileForBinary = getFileForBinary;

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

@ -101,9 +101,7 @@ add_task(async function testNoAdbJSON() {
await extension.unload();
});
add_task({
skip_if: () => mozinfo.os == "win" // bug 1482008
}, async function testNoTargetBinaries() {
add_task(async function testNoTargetBinaries() {
const extension = ExtensionTestUtils.loadExtension({
manifest: {
version: (extension_version++).toString(),
@ -146,7 +144,7 @@ add_task(async function testExtract() {
await extension.startup();
const adbBinary = await getFileForBinary();
ok(await adbBinary.exists);
ok(await adbBinary.exists());
await extension.unload();
});

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

@ -1275,7 +1275,8 @@ Element::AttachShadowWithoutNameChecks(ShadowRootMode aMode)
void
Element::UnattachShadow()
{
if (!GetShadowRoot()) {
RefPtr<ShadowRoot> shadowRoot = GetShadowRoot();
if (!shadowRoot) {
return;
}
@ -1290,6 +1291,12 @@ Element::UnattachShadow()
// Simply unhook the shadow root from the element.
MOZ_ASSERT(!GetShadowRoot()->HasSlots(), "Won't work when shadow root has slots!");
for (nsIContent* child = shadowRoot->GetFirstChild(); child;
child = child->GetNextSibling()) {
child->UnbindFromTree(true, false);
}
shadowRoot->SetIsComposedDocParticipant(false);
SetShadowRoot(nullptr);
}

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

@ -160,21 +160,21 @@ IndexedDBHelper.prototype = {
stores = txn.objectStore(store_name);
}
txn.oncomplete = function (event) {
txn.oncomplete = function () {
if (DEBUG) debug("Transaction complete. Returning to callback.");
if (successCb) {
successCb(txn.result);
if ("result" in txn) {
successCb(txn.result);
} else {
successCb();
}
}
};
txn.onabort = function (event) {
txn.onabort = function () {
if (DEBUG) debug("Caught error on transaction");
/*
* event.target.error may be null
* if txn was aborted by calling txn.abort()
*/
if (failureCb) {
failureCb(getErrorName(event.target.error));
failureCb(getErrorName(txn.error));
}
};
callback(txn, stores);

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

@ -32,7 +32,6 @@ support-files =
[include:xpcshell-shared.ini]
[test_bad_origin_directory.js]
skip-if = release_or_beta
[test_obsoleteOriginAttributesUpgrade.js]
[test_blob_file_backed.js]
[test_bug1056939.js]

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

@ -687,8 +687,6 @@ interface nsIDOMWindowUtils : nsISupports {
* non-debug builds. Available to all callers in debug builds.
*
* @param aListener listener that receives information about the CC graph
* (see @mozilla.org/cycle-collector-logger;1 for a logger
* component)
*/
void garbageCollect([optional] in nsICycleCollectorListener aListener);
@ -699,8 +697,6 @@ interface nsIDOMWindowUtils : nsISupports {
* non-debug builds. Available to all callers in debug builds.
*
* @param aListener listener that receives information about the CC graph
* (see @mozilla.org/cycle-collector-logger;1 for a logger
* component)
*/
void cycleCollect([optional] in nsICycleCollectorListener aListener);

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

@ -2031,52 +2031,6 @@ EnsureDirectory(nsIFile* aDirectory, bool* aCreated)
return NS_OK;
}
nsresult
EnsureOriginDirectory(nsIFile* aDirectory, bool* aCreated)
{
AssertIsOnIOThread();
nsresult rv;
#ifndef RELEASE_OR_BETA
bool exists;
rv = aDirectory->Exists(&exists);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (!exists) {
nsString leafName;
nsresult rv = aDirectory->GetLeafName(leafName);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (!leafName.EqualsLiteral(kChromeOrigin)) {
nsCString spec;
OriginAttributes attrs;
OriginParser::ResultType result =
OriginParser::ParseOrigin(NS_ConvertUTF16toUTF8(leafName),
spec,
&attrs);
if (NS_WARN_IF(result != OriginParser::ValidOrigin)) {
QM_WARNING("Preventing creation of a new origin directory which is not "
"supported by our origin parser or is obsolete!");
return NS_ERROR_FAILURE;
}
}
}
#endif
rv = EnsureDirectory(aDirectory, aCreated);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
enum FileFlag {
kTruncateFileFlag,
kUpdateFileFlag,
@ -5477,6 +5431,43 @@ QuotaManager::EnsureTemporaryStorageIsInitialized()
return rv;
}
nsresult
QuotaManager::EnsureOriginDirectory(nsIFile* aDirectory,
bool* aCreated)
{
AssertIsOnIOThread();
MOZ_ASSERT(aDirectory);
MOZ_ASSERT(aCreated);
bool exists;
nsresult rv = aDirectory->Exists(&exists);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (!exists) {
nsString leafName;
rv = aDirectory->GetLeafName(leafName);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
if (!leafName.EqualsLiteral(kChromeOrigin) &&
!IsSanitizedOriginValid(NS_ConvertUTF16toUTF8(leafName))) {
QM_WARNING("Preventing creation of a new origin directory which is not "
"supported by our origin parser or is obsolete!");
return NS_ERROR_FAILURE;
}
}
rv = EnsureDirectory(aDirectory, aCreated);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
return NS_OK;
}
void
QuotaManager::OriginClearCompleted(PersistenceType aPersistenceType,
const nsACString& aOrigin)
@ -6035,6 +6026,29 @@ QuotaManager::GetDirectoryLockTable(PersistenceType aPersistenceType)
}
}
bool
QuotaManager::IsSanitizedOriginValid(const nsACString& aSanitizedOrigin)
{
AssertIsOnIOThread();
MOZ_ASSERT(!aSanitizedOrigin.Equals(kChromeOrigin));
bool valid;
if (auto entry = mValidOrigins.LookupForAdd(aSanitizedOrigin)) {
// We already parsed this sanitized origin string.
valid = entry.Data();
} else {
nsCString spec;
OriginAttributes attrs;
OriginParser::ResultType result =
OriginParser::ParseOrigin(aSanitizedOrigin, spec, &attrs);
valid = result == OriginParser::ValidOrigin;
entry.OrInsert([valid]() { return valid; });
}
return valid;
}
/*******************************************************************************
* Local class implementations
******************************************************************************/
@ -7937,7 +7951,7 @@ PersistOp::DoDirectoryWork(QuotaManager* aQuotaManager)
}
bool created;
rv = EnsureOriginDirectory(directory, &created);
rv = aQuotaManager->EnsureOriginDirectory(directory, &created);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}

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

@ -301,6 +301,10 @@ public:
nsresult
EnsureTemporaryStorageIsInitialized();
nsresult
EnsureOriginDirectory(nsIFile* aDirectory,
bool* aCreated);
void
OriginClearCompleted(PersistenceType aPersistenceType,
const nsACString& aOrigin);
@ -522,6 +526,9 @@ private:
DirectoryLockTable&
GetDirectoryLockTable(PersistenceType aPersistenceType);
bool
IsSanitizedOriginValid(const nsACString& aSanitizedOrigin);
static void
ShutdownTimerCallback(nsITimer* aTimer, void* aClosure);
@ -545,10 +552,15 @@ private:
// A timer that gets activated at shutdown to ensure we close all storages.
nsCOMPtr<nsITimer> mShutdownTimer;
// A list of all successfully initialized origins. This list isn't protected
// by any mutex but it is only ever touched on the IO thread.
// A list of all successfully initialized persistent origins. This list isn't
// protected by any mutex but it is only ever touched on the IO thread.
nsTArray<nsCString> mInitializedOrigins;
// A hash table that is used to cache origin parser results for given
// sanitized origin strings. This hash table isn't protected by any mutex but
// it is only ever touched on the IO thread.
nsDataHashtable<nsCStringHashKey, bool> mValidOrigins;
// This array is populated at initialization time and then never modified, so
// it can be iterated on any thread.
AutoTArray<RefPtr<Client>, Client::TYPE_MAX> mClients;

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

@ -518,7 +518,7 @@ var interfaceNamesInGlobalScope =
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "HTMLSelectElement", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "HTMLSlotElement", insecureContext: true, disabled: true},
{name: "HTMLSlotElement", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "HTMLSourceElement", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
@ -872,7 +872,7 @@ var interfaceNamesInGlobalScope =
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "ScopedCredentialInfo", insecureContext: true, disabled: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "ShadowRoot", insecureContext: true, disabled: true},
{name: "ShadowRoot", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "SharedWorker", insecureContext: true},
// IMPORTANT: Do not change this list without review from a DOM peer!

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

@ -63,3 +63,15 @@ non262/extensions/regress-477187.js
non262/regress/regress-452498-052-a.js
non262/extensions/clone-complex-object.js
non262/extensions/clone-object-deep.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js
test262/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js

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

@ -296,6 +296,14 @@ interface nsIXPCComponents_Utils : nsISupports
*/
void forceCC([optional] in nsICycleCollectorListener aListener);
/*
* To be called from JS only. C++ callers should use the
* nsCycleCollector_createLogger() function instead.
*
* Create an instance of the built-in cycle collector logger object.
*/
nsICycleCollectorListener createCCLogger();
/*
* To be called from JS only.
*

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

@ -31,6 +31,7 @@
#include "mozilla/Scheduler.h"
#include "nsZipArchive.h"
#include "nsWindowMemoryReporter.h"
#include "nsICycleCollectorListener.h"
#include "nsIException.h"
#include "nsIScriptError.h"
#include "nsISimpleEnumerator.h"
@ -2317,6 +2318,16 @@ nsXPCComponents_Utils::ForceCC(nsICycleCollectorListener* listener)
return NS_OK;
}
NS_IMETHODIMP
nsXPCComponents_Utils::CreateCCLogger(nsICycleCollectorListener** aListener)
{
NS_ENSURE_ARG_POINTER(aListener);
nsCOMPtr<nsICycleCollectorListener> logger =
nsCycleCollector_createLogger();
logger.forget(aListener);
return NS_OK;
}
NS_IMETHODIMP
nsXPCComponents_Utils::FinishCC()
{

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

@ -32,6 +32,7 @@
#include "nsDOMMutationObserver.h"
#include "nsICycleCollectorListener.h"
#include "nsCycleCollector.h"
#include "nsIObjectInputStream.h"
#include "nsIObjectOutputStream.h"
#include "nsScriptSecurityManager.h"
@ -1111,12 +1112,8 @@ DumpJSStack()
MOZ_EXPORT void
DumpCompleteHeap()
{
nsCOMPtr<nsICycleCollectorListener> listener =
do_CreateInstance("@mozilla.org/cycle-collector-logger;1");
if (!listener) {
NS_WARNING("Failed to create CC logger");
return;
}
nsCOMPtr<nsICycleCollectorListener> listener = nsCycleCollector_createLogger();
MOZ_ASSERT(listener);
nsCOMPtr<nsICycleCollectorListener> alltracesListener;
listener->AllTraces(getter_AddRefs(alltracesListener));

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

@ -12,12 +12,6 @@
# SUBDIRECTORY: Reftests for paginated flex containers
include pagination/reftest.list
# XXXdholbert These tests should move to w3c-css/submitted once we've closed
# out bug 1207698 and updated these tests' expectations & alignment keyword
# usage accordingly:
== flexbox-align-content-horizrev-001.xhtml flexbox-align-content-horizrev-001-ref.xhtml
== flexbox-align-content-vertrev-001.xhtml flexbox-align-content-vertrev-001-ref.xhtml
# Tests for cross-axis alignment (align-self / align-items properties)
fails == flexbox-align-self-baseline-horiz-2.xhtml flexbox-align-self-baseline-horiz-2-ref.xhtml # bug 793456, and possibly others
# This one fails on windows R (but not Ru, strangely) and GTK.

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

@ -144,13 +144,13 @@
<div class="a"/>
</div>
<div class="flexbox">
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox">
<div class="c"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
@ -158,13 +158,13 @@
<div class="a" style="margin-top: 190px"/>
</div>
<div class="flexbox">
<div class="b" style="margin-top: 160px"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="a" style="margin-top: 160px"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox">
<div class="c" style="margin-top: 120px"/>
<div class="a" style="margin-top: 120px"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="c"/>
</div>
</body>
</html>

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

@ -149,28 +149,28 @@
</div>
<!-- start -->
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>

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

@ -150,28 +150,28 @@
</div>
<!-- start -->
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>

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

@ -138,5 +138,33 @@
<div class="b" style="margin-top: 30px"><div class="fixedSizeChild"/></div>
<div class="a" style="margin-top: 30px"/>
</div>
<!-- start -->
<div class="flexbox">
<div class="a"/>
</div>
<div class="flexbox">
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
</div>
<div class="flexbox">
<div class="c"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
</div>
<!-- end -->
<div class="flexbox">
<div class="a" style="margin-top: 190px"/>
</div>
<div class="flexbox">
<div class="b" style="margin-top: 160px"><div class="fixedSizeChild"/></div>
<div class="a"/>
</div>
<div class="flexbox">
<div class="c" style="margin-top: 120px"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
</div>
</body>
</html>

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

@ -10,7 +10,7 @@
<title>CSS Test: Testing 'align-content' in a row wrap-reverse flex container</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
<link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#align-content-property"/>
<link rel="match" href="flexbox-align-content-horizrev-001-ref.xhtml"/>
<link rel="match" href="flexbox-align-content-horiz-002-ref.xhtml"/>
<style>
div.flexbox {
width: 20px; /* Skinny, to force us to wrap */
@ -147,5 +147,33 @@
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- start -->
<div class="flexbox" style="align-content: start">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
<div class="flexbox" style="align-content: end">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
</body>
</html>

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

@ -147,13 +147,13 @@
<div class="a"/>
</div>
<div class="flexbox">
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox">
<div class="c"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
@ -161,13 +161,13 @@
<div class="a" style="margin-left: 190px"/>
</div>
<div class="flexbox">
<div class="b" style="margin-left: 160px"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="a" style="margin-left: 160px"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox">
<div class="c" style="margin-left: 120px"/>
<div class="a" style="margin-left: 120px"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="a"/>
<div class="c"/>
</div>
</body>
</html>

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

@ -149,28 +149,28 @@
</div>
<!-- start -->
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>

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

@ -150,28 +150,28 @@
</div>
<!-- start -->
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: start; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: end; flex-wrap: wrap-reverse">
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>

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

@ -141,5 +141,33 @@
<div class="b" style="margin-right: 30px"><div class="fixedSizeChild"/></div>
<div class="c" style="margin-right: 30px"/>
</div>
<!-- start -->
<div class="flexbox">
<div class="a" style="margin-right: 190px"/>
</div>
<div class="flexbox">
<div class="a" style="margin-right: 160px"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox">
<div class="a" style="margin-right: 120px"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
<div class="flexbox">
<div class="a"/>
</div>
<div class="flexbox">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
</body>
</html>

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

@ -10,7 +10,7 @@
<title>CSS Test: Testing 'align-content' in a column wrap-reverse flex container</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
<link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#align-content-property"/>
<link rel="match" href="flexbox-align-content-vertrev-001-ref.xhtml"/>
<link rel="match" href="flexbox-align-content-vert-002-ref.xhtml"/>
<style>
div.flexbox {
width: 200px;
@ -147,5 +147,33 @@
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- start -->
<div class="flexbox" style="align-content: start">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: start">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
<!-- end -->
<div class="flexbox" style="align-content: end">
<div class="a"/>
</div>
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
</div>
<div class="flexbox" style="align-content: end">
<div class="a"/>
<div class="b"><div class="fixedSizeChild"/></div>
<div class="c"/>
</div>
</body>
</html>

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

@ -9,8 +9,10 @@
# Tests for alignment of flex lines (align-content property)
== flexbox-align-content-horiz-001a.xhtml flexbox-align-content-horiz-001-ref.xhtml
== flexbox-align-content-horiz-001b.xhtml flexbox-align-content-horiz-001-ref.xhtml
== flexbox-align-content-horiz-002.xhtml flexbox-align-content-horiz-002-ref.xhtml
== flexbox-align-content-vert-001a.xhtml flexbox-align-content-vert-001-ref.xhtml
== flexbox-align-content-vert-001b.xhtml flexbox-align-content-vert-001-ref.xhtml
== flexbox-align-content-vert-002.xhtml flexbox-align-content-vert-002-ref.xhtml
== flexbox-align-content-wmvert-001.xhtml flexbox-align-content-wmvert-001-ref.xhtml
# Tests for cross-axis alignment (align-self / align-items properties)

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

@ -54,6 +54,7 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.graphics.BitmapFactory;
@ -2240,8 +2241,9 @@ public abstract class GeckoApp extends GeckoActivity
// the res/fonts directory: we no longer need to copy our
// bundled fonts out of the APK in order to use them.
// See https://bugzilla.mozilla.org/show_bug.cgi?id=878674.
File dir = new File("res/fonts");
if (dir.exists() && dir.isDirectory()) {
final File dataDir = new File(context.getApplicationInfo().dataDir);
final File dir = new File(dataDir, "res/fonts");
if (dir.exists() && dir.isDirectory() && dir.listFiles() != null) {
for (File file : dir.listFiles()) {
if (file.isFile() && file.getName().endsWith(".ttf")) {
file.delete();

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

@ -342,7 +342,12 @@ public class GeckoView extends FrameLayout {
if (!mSession.isOpen()) {
mSession.open(mRuntime);
}
mRuntime.orientationChanged();
// Temporary solution until we find out why mRuntime can end up as null here. It means we
// might miss an orientation change if we were background OOM-killed, but it's better than
// crashing. See bug 1484001.
if (mRuntime != null) {
mRuntime.orientationChanged();
}
super.onAttachedToWindow();
}

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

@ -1379,13 +1379,8 @@ pref("dom.ua_widget.enabled", false);
pref("dom.ua_widget.enabled", false);
#endif
#ifdef NIGHTLY_BUILD
pref("dom.webcomponents.shadowdom.enabled", true);
pref("dom.webcomponents.customelements.enabled", true);
#else
pref("dom.webcomponents.shadowdom.enabled", false);
pref("dom.webcomponents.customelements.enabled", false);
#endif
pref("javascript.enabled", true);
pref("javascript.options.strict", false);

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

@ -24,7 +24,6 @@ bitflags = "1.0"
matches = "0.1"
cssparser = "0.24.0"
log = "0.4"
fnv = "1.0"
fxhash = "0.2"
phf = "0.7.18"
precomputed-hash = "0.1"

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

@ -5,9 +5,7 @@
//! Counting and non-counting Bloom filters tuned for use as ancestor filters
//! for selector matching.
use fnv::FnvHasher;
use std::fmt::{self, Debug};
use std::hash::{Hash, Hasher};
// The top 8 bits of the 32-bit hash value are not used by the bloom filter.
// Consumers may rely on this to pack hashes more efficiently.
@ -108,43 +106,27 @@ where
unreachable!()
}
/// Inserts an item with a particular hash into the bloom filter.
#[inline]
pub fn insert_hash(&mut self, hash: u32) {
self.storage.adjust_first_slot(hash, true);
self.storage.adjust_second_slot(hash, true);
}
/// Inserts an item into the bloom filter.
#[inline]
pub fn insert<T: Hash>(&mut self, elem: &T) {
self.insert_hash(hash(elem))
}
/// Removes an item with a particular hash from the bloom filter.
#[inline]
pub fn remove_hash(&mut self, hash: u32) {
self.storage.adjust_first_slot(hash, false);
self.storage.adjust_second_slot(hash, false);
}
/// Removes an item from the bloom filter.
#[inline]
pub fn remove<T: Hash>(&mut self, elem: &T) {
self.remove_hash(hash(elem))
}
/// Check whether the filter might contain an item with the given hash.
/// This can sometimes return true even if the item is not in the filter,
/// but will never return false for items that are actually in the filter.
#[inline]
pub fn might_contain_hash(&self, hash: u32) -> bool {
!self.storage.first_slot_is_empty(hash) && !self.storage.second_slot_is_empty(hash)
}
/// Check whether the filter might contain an item. This can
/// sometimes return true even if the item is not in the filter,
/// but will never return false for items that are actually in the
/// filter.
#[inline]
pub fn might_contain<T: Hash>(&self, elem: &T) -> bool {
self.might_contain_hash(hash(elem))
}
}
impl<S> Debug for CountingBloomFilter<S>
@ -296,16 +278,6 @@ impl Clone for BloomStorageBool {
}
}
fn hash<T: Hash>(elem: &T) -> u32 {
// We generally use FxHasher in Stylo because it's faster than FnvHasher,
// but the increased collision rate has outsized effect on the bloom
// filter, so we use FnvHasher instead here.
let mut hasher = FnvHasher::default();
elem.hash(&mut hasher);
let hash: u64 = hasher.finish();
(hash >> 32) as u32 ^ (hash as u32)
}
#[inline]
fn hash1(hash: u32) -> u32 {
hash & KEY_MASK
@ -318,8 +290,18 @@ fn hash2(hash: u32) -> u32 {
#[test]
fn create_and_insert_some_stuff() {
use fxhash::FxHasher;
use std::hash::{Hash, Hasher};
use std::mem::transmute;
fn hash_as_str(i: usize) -> u32 {
let mut hasher = FxHasher::default();
let s = i.to_string();
s.hash(&mut hasher);
let hash: u64 = hasher.finish();
(hash >> 32) as u32 ^ (hash as u32)
}
let mut bf = BloomFilter::new();
// Statically assert that ARRAY_SIZE is a multiple of 8, which
@ -329,33 +311,34 @@ fn create_and_insert_some_stuff() {
}
for i in 0_usize..1000 {
bf.insert(&i);
bf.insert_hash(hash_as_str(i));
}
for i in 0_usize..1000 {
assert!(bf.might_contain(&i));
assert!(bf.might_contain_hash(hash_as_str(i)));
}
let false_positives = (1001_usize..2000).filter(|i| bf.might_contain(i)).count();
let false_positives =
(1001_usize..2000).filter(|i| bf.might_contain_hash(hash_as_str(*i))).count();
assert!(false_positives < 160, "{} is not < 160", false_positives); // 16%.
assert!(false_positives < 190, "{} is not < 190", false_positives); // 19%.
for i in 0_usize..100 {
bf.remove(&i);
bf.remove_hash(hash_as_str(i));
}
for i in 100_usize..1000 {
assert!(bf.might_contain(&i));
assert!(bf.might_contain_hash(hash_as_str(i)));
}
let false_positives = (0_usize..100).filter(|i| bf.might_contain(i)).count();
let false_positives = (0_usize..100).filter(|i| bf.might_contain_hash(hash_as_str(*i))).count();
assert!(false_positives < 20, "{} is not < 20", false_positives); // 20%.
bf.clear();
for i in 0_usize..2000 {
assert!(!bf.might_contain(&i));
assert!(!bf.might_contain_hash(hash_as_str(i)));
}
}

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

@ -9,7 +9,6 @@
extern crate bitflags;
#[macro_use]
extern crate cssparser;
extern crate fnv;
extern crate fxhash;
#[macro_use]
extern crate log;

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

@ -118,7 +118,7 @@ user_pref("dom.successive_dialog_time_limit", 0);
user_pref("dom.use_xbl_scopes_for_remote_xul", true);
user_pref("dom.w3c_touch_events.enabled", 1);
user_pref("dom.webcomponents.customelements.enabled", true);
user_pref("dom.webcomponents.shadowdom.enabled", false);
user_pref("dom.webcomponents.shadowdom.enabled", true);
user_pref("extensions.autoDisableScopes", 0);
user_pref("extensions.blocklist.detailsURL", "http://{server}/extensions-dummy/blocklistDetailsURL");
user_pref("extensions.blocklist.itemURL", "http://{server}/extensions-dummy/blocklistItemURL");

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

@ -1,4 +1,6 @@
[all-hosts.html]
[CSS Shadow Parts - All Hosts]
[::part with host selector styles in first host]
expected: FAIL
[::part with host selector styles in second host]
expected: FAIL

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

@ -1,4 +1,4 @@
[complex-matching.html]
[CSS Shadow Parts - Complex Matching]
[Complex selector for host works]
expected: FAIL

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

@ -1,4 +1,4 @@
[inner-host.html]
[CSS Shadow Parts - Inner Host]
[Part in outer host is styled by document style sheet]
expected: FAIL

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

@ -1,4 +1,4 @@
[invalidation-change-part-name.html]
[CSS Shadow Parts - Invalidation Change Part Name]
[Part in selected host changed color]
expected: FAIL

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

@ -1,4 +1,4 @@
[invalidation-complex-selector.html]
[CSS Shadow Parts - Invalidation Complex Selector]
[Part in selected host changed color]
expected: FAIL

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

@ -1,4 +1,4 @@
[simple.html]
[CSS Shadow Parts - Simple]
[Part in selected host is styled]
expected: FAIL

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

@ -1,5 +0,0 @@
[transform-origin-in-shadow.html]
expected: ERROR
['transform-origin' on <svg> being direct descendant of shadow root]
expected: FAIL

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

@ -1,8 +1,15 @@
[getComputedStyle-detached-subtree.html]
expected: ERROR
[getComputedStyle returns no style for detached element]
expected: FAIL
[getComputedStyle returns no style for element in non-rendered iframe (display: none)]
expected: FAIL
[getComputedStyle returns no style for element outside the flat tree]
expected: FAIL
[getComputedStyle returns no style for descendant outside the flat tree]
expected: FAIL
[getComputedStyle returns no style for shadow tree outside of flattened tree]
expected: FAIL

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

@ -137,63 +137,6 @@
[Document interface: xmlDoc must inherit property "origin" with the proper type]
expected: FAIL
[ShadowRoot interface: existence and properties of interface object]
expected: FAIL
[ShadowRoot interface object length]
expected: FAIL
[ShadowRoot interface object name]
expected: FAIL
[ShadowRoot interface: existence and properties of interface prototype object]
expected: FAIL
[ShadowRoot interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[ShadowRoot interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[ShadowRoot interface: attribute mode]
expected: FAIL
[ShadowRoot interface: attribute host]
expected: FAIL
[Element interface: attribute slot]
expected: FAIL
[Element interface: operation attachShadow(ShadowRootInit)]
expected: FAIL
[Element interface: attribute shadowRoot]
expected: FAIL
[Element interface: attribute assignedSlot]
expected: FAIL
[Element interface: element must inherit property "slot" with the proper type]
expected: FAIL
[Element interface: element must inherit property "attachShadow(ShadowRootInit)" with the proper type]
expected: FAIL
[Element interface: calling attachShadow(ShadowRootInit) on element with too few arguments must throw TypeError]
expected: FAIL
[Element interface: element must inherit property "shadowRoot" with the proper type]
expected: FAIL
[Element interface: element must inherit property "assignedSlot" with the proper type]
expected: FAIL
[Text interface: attribute assignedSlot]
expected: FAIL
[Text interface: document.createTextNode("abc") must inherit property "assignedSlot" with the proper type]
expected: FAIL
[AbstractRange interface: existence and properties of interface object]
expected: FAIL
@ -276,63 +219,6 @@
[Document interface: xmlDoc must inherit property "origin" with the proper type]
expected: FAIL
[ShadowRoot interface: existence and properties of interface object]
expected: FAIL
[ShadowRoot interface object length]
expected: FAIL
[ShadowRoot interface object name]
expected: FAIL
[ShadowRoot interface: existence and properties of interface prototype object]
expected: FAIL
[ShadowRoot interface: existence and properties of interface prototype object's "constructor" property]
expected: FAIL
[ShadowRoot interface: existence and properties of interface prototype object's @@unscopables property]
expected: FAIL
[ShadowRoot interface: attribute mode]
expected: FAIL
[ShadowRoot interface: attribute host]
expected: FAIL
[Element interface: attribute slot]
expected: FAIL
[Element interface: operation attachShadow(ShadowRootInit)]
expected: FAIL
[Element interface: attribute shadowRoot]
expected: FAIL
[Element interface: attribute assignedSlot]
expected: FAIL
[Element interface: element must inherit property "slot" with the proper type]
expected: FAIL
[Element interface: element must inherit property "attachShadow(ShadowRootInit)" with the proper type]
expected: FAIL
[Element interface: calling attachShadow(ShadowRootInit) on element with too few arguments must throw TypeError]
expected: FAIL
[Element interface: element must inherit property "shadowRoot" with the proper type]
expected: FAIL
[Element interface: element must inherit property "assignedSlot" with the proper type]
expected: FAIL
[Text interface: attribute assignedSlot]
expected: FAIL
[Text interface: document.createTextNode("abc") must inherit property "assignedSlot" with the proper type]
expected: FAIL
[AbstractRange interface: existence and properties of interface object]
expected: FAIL

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

@ -1,4 +0,0 @@
[rootNode.html]
[getRootNode() must return context object's shadow-including root if options's composed is true, and context object's root otherwise]
expected: FAIL

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

@ -8,9 +8,6 @@
[Element interface: document.createElementNS(null, "test") must inherit property "onfullscreenerror" with the proper type]
expected: FAIL
[ShadowRoot interface: attribute fullscreenElement]
expected: FAIL
[Element interface: attribute onfullscreenerror]
expected: FAIL

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

@ -2,9 +2,6 @@
[Document interface: operation exitFullscreen()]
expected: FAIL
[ShadowRoot interface: attribute fullscreenElement]
expected: FAIL
[Element interface: operation requestFullscreen()]
expected: FAIL

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

@ -1,7 +0,0 @@
[contentEditable-slotted-inherit.html]
[Slotted child of contenteditable host should be editable - slot direct child of shadow root]
expected: FAIL
[Slotted child of contenteditable host should be editable - slot wrapped in shadow tree ancestor]
expected: FAIL

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

@ -1,7 +0,0 @@
[link-rel-attribute.html]
[Untitled]
expected: FAIL
[Removing stylesheet from link rel attribute should remove the stylesheet for shadow DOM]
expected: FAIL

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

@ -1,4 +0,0 @@
[interfaces.window.html]
[ShadowRoot interface: attribute pointerLockElement]
expected: FAIL

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

@ -219,8 +219,13 @@
"preprocess": "localize"
}
}
}
},
"hidden": {
"type": "boolean",
"optional": true,
"default": false
}
},
"additionalProperties": { "$ref": "UnrecognizedProperty" }

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

@ -8,8 +8,6 @@
@import url("chrome://global/content/autocomplete.css");
@import url("chrome://global/skin/autocomplete.css");
@import url("resource://formautofill/autocomplete-item-shared.css");
@import url("resource://formautofill/autocomplete-item.css");
@import url("chrome://global/skin/dialog.css");
@import url("chrome://global/skin/dropmarker.css");
@import url("chrome://global/skin/groupbox.css");

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

@ -116,7 +116,7 @@ const PROP_JSON_FIELDS = ["id", "syncGUID", "version", "type",
"seen", "dependencies", "hasEmbeddedWebExtension",
"userPermissions", "icons", "iconURL", "icon64URL",
"blocklistState", "blocklistURL", "startupData",
"previewImage"];
"previewImage", "hidden"];
const LEGACY_TYPES = new Set([
"extension",
@ -288,6 +288,7 @@ class AddonInternal {
this.seen = true;
this.skinnable = false;
this.startupData = null;
this._hidden = false;
this.inDatabase = false;
@ -416,7 +417,12 @@ class AddonInternal {
}
get hidden() {
return this.location.isSystem;
return this.location.isSystem ||
(this._hidden && this.signedState == AddonManager.SIGNEDSTATE_PRIVILEGED);
}
set hidden(val) {
this._hidden = val;
}
get disabled() {
@ -577,10 +583,10 @@ class AddonInternal {
}
if (this.inDatabase) {
// hidden and system add-ons should not be user disabled,
// as there is no UI to re-enable them.
if (this.hidden) {
throw new Error(`Cannot disable hidden add-on ${this.id}`);
// System add-ons should not be user disabled, as there is no UI to
// re-enable them.
if (this.location.isSystem) {
throw new Error(`Cannot disable system add-on ${this.id}`);
}
await XPIDatabase.updateAddonDisabledState(this, val);
} else {

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

@ -466,6 +466,7 @@ async function loadManifestFromWebManifest(aUri, aPackage) {
addon.aboutURL = null;
addon.dependencies = Object.freeze(Array.from(extension.dependencies));
addon.startupData = extension.startupData;
addon.hidden = manifest.hidden;
if (isTheme(addon.type) && await aPackage.hasResource("preview.png")) {
addon.previewImage = "preview.png";
@ -812,6 +813,9 @@ var loadManifest = async function(aPackage, aLocation, aOldAddon) {
let {signedState, cert} = await aPackage.verifySignedState(addon);
addon.signedState = signedState;
if (signedState != AddonManager.SIGNEDSTATE_PRIVILEGED) {
addon.hidden = false;
}
if (isWebExtension && !addon.id) {
if (cert) {

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

@ -0,0 +1,51 @@
add_task(async function test_hidden() {
createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "2");
AddonTestUtils.usePrivilegedSignatures = id => id.startsWith("privileged");
await promiseStartupManager();
let xpi1 = createTempWebExtensionFile({
manifest: {
applications: {
gecko: {
id: "privileged@tests.mozilla.org",
},
},
name: "Hidden Extension",
hidden: true,
},
});
let xpi2 = createTempWebExtensionFile({
manifest: {
applications: {
gecko: {
id: "unprivileged@tests.mozilla.org",
},
},
name: "Non-Hidden Extension",
hidden: true,
},
});
await promiseInstallAllFiles([xpi1, xpi2]);
let [addon1, addon2] = await promiseAddonsByIDs(["privileged@tests.mozilla.org",
"unprivileged@tests.mozilla.org"]);
ok(addon1.hidden, "Privileged extension should be hidden");
ok(!addon2.hidden, "Unprivileged extension should not be hidden");
await promiseRestartManager();
([addon1, addon2] = await promiseAddonsByIDs(["privileged@tests.mozilla.org",
"unprivileged@tests.mozilla.org"]));
ok(addon1.hidden, "Privileged extension should be hidden");
ok(!addon2.hidden, "Unprivileged extension should not be hidden");
await promiseShutdownManager();
});

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

@ -93,7 +93,7 @@ add_task(async function() {
await addon.disable();
do_throw("Expected addon.userDisabled on a hidden add-on to throw!");
} catch (e) {
Assert.equal(e.message, `Cannot disable hidden add-on ${SYSTEM_ID}`);
Assert.equal(e.message, `Cannot disable system add-on ${SYSTEM_ID}`);
}
Assert.notEqual(addon, null);

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

@ -134,6 +134,7 @@ tags = blocklist
[test_gmpProvider.js]
skip-if = appname != "firefox"
[test_harness.js]
[test_hidden.js]
[test_install.js]
[test_install_icons.js]
# Bug 676992: test consistently hangs on Android

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

@ -2050,18 +2050,11 @@ private:
NS_IMPL_ISUPPORTS(nsCycleCollectorLogger, nsICycleCollectorListener)
nsresult
nsCycleCollectorLoggerConstructor(nsISupports* aOuter,
const nsIID& aIID,
void** aInstancePtr)
already_AddRefed<nsICycleCollectorListener>
nsCycleCollector_createLogger()
{
if (NS_WARN_IF(aOuter)) {
return NS_ERROR_NO_AGGREGATION;
}
nsISupports* logger = new nsCycleCollectorLogger();
return logger->QueryInterface(aIID, aInstancePtr);
nsCOMPtr<nsICycleCollectorListener> logger = new nsCycleCollectorLogger();
return logger.forget();
}
static bool

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

@ -46,6 +46,7 @@ bool nsCycleCollector_doDeferredDeletion();
bool nsCycleCollector_doDeferredDeletionWithBudget(js::SliceBudget& aBudget);
already_AddRefed<nsICycleCollectorLogSink> nsCycleCollector_createLogSink();
already_AddRefed<nsICycleCollectorListener> nsCycleCollector_createLogger();
void nsCycleCollector_collect(nsICycleCollectorListener* aManualListener);
@ -66,13 +67,4 @@ void nsCycleCollector_forgetJSContext();
void nsCycleCollector_registerNonPrimaryContext(mozilla::CycleCollectedJSContext* aCx);
void nsCycleCollector_forgetNonPrimaryContext();
#define NS_CYCLE_COLLECTOR_LOGGER_CID \
{ 0x58be81b4, 0x39d2, 0x437c, \
{ 0x94, 0xea, 0xae, 0xde, 0x2c, 0x62, 0x08, 0xd3 } }
extern nsresult
nsCycleCollectorLoggerConstructor(nsISupports* aOuter,
const nsIID& aIID,
void** aInstancePtr);
#endif // nsCycleCollector_h__

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

@ -16,7 +16,7 @@ interface nsIFile;
/**
* A set of interfaces for recording the cycle collector's work. An instance
* of @mozilla.org/cycle-collector-logger;1 can be configured to enable various
* of nsICycleCollectorListener can be configured to enable various
* options, then passed to the cycle collector when it runs.
* Note that additional logging options are available by setting environment
* variables, as described at the top of nsCycleCollector.cpp.
@ -24,7 +24,7 @@ interface nsIFile;
/**
* nsICycleCollectorHandler is the interface JS code should implement to
* receive the results logged by a @mozilla.org/cycle-collector-logger;1
* receive the results logged by an nsICycleCollectorListener
* instance. Pass an instance of this to the logger's 'processNext' method
* after the collection has run. This will describe the objects the cycle
* collector visited, the edges it found, and the conclusions it reached
@ -98,8 +98,10 @@ interface nsICycleCollectorLogSink : nsISupports
*
* To analyze cycle collection data in JS:
*
* - Create an instance of @mozilla.org/cycle-collector-logger;1, which
* implements this interface.
* - Create an instance of nsICycleCollectorListener, which implements this
* interface. In C++, this can be done by calling
* nsCycleCollector_createLogger(). In JS, this can be done by calling
* Components.utils.createCCLogger().
*
* - Set its |disableLog| property to true. This prevents the logger from
* printing messages about each method call to a temporary log file.

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

@ -384,8 +384,7 @@ nsMemoryInfoDumper::DumpGCAndCCLogsToFile(const nsAString& aIdentifier,
}
}
nsCOMPtr<nsICycleCollectorListener> logger =
do_CreateInstance("@mozilla.org/cycle-collector-logger;1");
nsCOMPtr<nsICycleCollectorListener> logger = nsCycleCollector_createLogger();
if (aDumpAllTraces) {
nsCOMPtr<nsICycleCollectorListener> allTracesLogger;
@ -412,8 +411,7 @@ NS_IMETHODIMP
nsMemoryInfoDumper::DumpGCAndCCLogsToSink(bool aDumpAllTraces,
nsICycleCollectorLogSink* aSink)
{
nsCOMPtr<nsICycleCollectorListener> logger =
do_CreateInstance("@mozilla.org/cycle-collector-logger;1");
nsCOMPtr<nsICycleCollectorListener> logger = nsCycleCollector_createLogger();
if (aDumpAllTraces) {
nsCOMPtr<nsICycleCollectorListener> allTracesLogger;

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

@ -72,5 +72,4 @@
COMPONENT_M(MEMORY_REPORTER_MANAGER, nsMemoryReporterManagerConstructor, Module::ALLOW_IN_GPU_PROCESS)
COMPONENT(MEMORY_INFO_DUMPER, nsMemoryInfoDumperConstructor)
COMPONENT(IOUTIL, nsIOUtilConstructor)
COMPONENT(CYCLE_COLLECTOR_LOGGER, nsCycleCollectorLoggerConstructor)
COMPONENT(MESSAGE_LOOP, nsMessageLoopConstructor)

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

@ -76,11 +76,6 @@
*/
#define NS_MEMORY_INFO_DUMPER_CONTRACTID "@mozilla.org/memory-info-dumper;1"
/**
* Cycle collector logger contract id
*/
#define NS_CYCLE_COLLECTOR_LOGGER_CONTRACTID "@mozilla.org/cycle-collector-logger;1"
/**
* nsMessageLoop contract id
*/