Merge m-c to autoland, a=merge

MozReview-Commit-ID: KfZgcCxrZcg
This commit is contained in:
Wes Kocher 2017-08-14 17:59:46 -07:00
commit 2458d6b297
66 changed files with 1223 additions and 568 deletions

View File

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
<blocklist lastupdate="1484867614757" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<blocklist lastupdate="1483471392954" xmlns="http://www.mozilla.org/2006/addons-blocklist">
<emItems>
<emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}">
<prefs/>
@ -941,10 +941,6 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i453" id="/^brasilescape.*\@facebook\.com$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i485" id="/^brasilescape.*\@facebook\.com$//">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -1753,6 +1749,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="5df16afc-c804-43c9-9de5-f1835403e5fb" id="@H99KV4DO-UCCF-9PFO-9ZLK-8RRP4FVOKD9O">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i764" id="prositez@prz.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -1817,6 +1817,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="0a47a2f7-f07c-489b-bd39-88122a2dfe6a" id="@DA3566E2-F709-11E5-8E87-A604BC8E7F8B">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
<emItem blockID="i98" id="youtubeeing@youtuberie.com">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
@ -2095,6 +2099,10 @@
<prefs/>
<versionRange minVersion="0" maxVersion="1.3.9" severity="3"/>
</emItem>
<emItem blockID="i453" id="/^brasilescape.*\@facebook\.com$/">
<prefs/>
<versionRange minVersion="0" maxVersion="*" severity="3"/>
</emItem>
</emItems>
<pluginItems>
<pluginItem blockID="p416">
@ -4122,6 +4130,9 @@
<certItem issuerName="MIGQMQswCQYDVQQGEwJHUjFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxOzA5BgNVBAMTMkFyaXN0b3RsZSBVbml2ZXJzaXR5IG9mIFRoZXNzYWxvbmlraSBDZW50cmFsIENBIFI0">
<serialNumber>EqthLKdUgwI=</serialNumber>
</certItem>
<certItem issuerName="MIHKMQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA2IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHNQ==">
<serialNumber>Xmo3AIW2VHeeJoR0o09RGQ==</serialNumber>
</certItem>
<certItem issuerName="MF8xCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRQwEgYDVQQLEwtQYXJ0bmVycyBDQTEfMB0GA1UEAxMWR2xvYmFsU2lnbiBQYXJ0bmVycyBDQQ==">
<serialNumber>BAAAAAABCFiEp9s=</serialNumber>
</certItem>
@ -4371,6 +4382,9 @@
<certItem issuerName="MFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxTaWduIFJvb3QgQ0E=">
<serialNumber>BAAAAAABFUtaxac=</serialNumber>
</certItem>
<certItem issuerName="MEUxCzAJBgNVBAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzI=">
<serialNumber>SeEzbpTltqUtqW7UiuJ2</serialNumber>
</certItem>
<certItem issuerName="MGMxCzAJBgNVBAYTAkZSMRMwEQYDVQQKEwpDZXJ0aW5vbWlzMRcwFQYDVQQLEw4wMDAyIDQzMzk5ODkwMzEmMCQGA1UEAwwdQ2VydGlub21pcyAtIEF1dG9yaXTDqSBSYWNpbmU=">
<serialNumber>Eg==</serialNumber>
</certItem>
@ -4575,6 +4589,9 @@
<certItem issuerName="MFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxTaWduIFJvb3QgQ0E=">
<serialNumber>BAAAAAABL07hSVI=</serialNumber>
</certItem>
<certItem issuerName="MIGFMQswCQYDVQQGEwJVUzEgMB4GA1UECgwXV2VsbHMgRmFyZ28gV2VsbHNTZWN1cmUxHDAaBgNVBAsME1dlbGxzIEZhcmdvIEJhbmsgTkExNjA0BgNVBAMMLVdlbGxzU2VjdXJlIFB1YmxpYyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eQ==">
<serialNumber>ATk=</serialNumber>
</certItem>
<certItem issuerName="MIGVMQswCQYDVQQGEwJHUjFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTE=">
<serialNumber>GN2Hrh9LtnA=</serialNumber>
</certItem>
@ -4683,6 +4700,9 @@
<certItem issuerName="MEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDM=">
<serialNumber>BwImeaRkSZQLYwFREwKo3R1Jn+8=</serialNumber>
</certItem>
<certItem issuerName="MIG9MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5">
<serialNumber>QOu0a5Z9rCkw6Nk7Rg1/AQ==</serialNumber>
</certItem>
<certItem issuerName="MFoxCzAJBgNVBAYTAklFMRIwEAYDVQQKEwlCYWx0aW1vcmUxEzARBgNVBAsTCkN5YmVyVHJ1c3QxIjAgBgNVBAMTGUJhbHRpbW9yZSBDeWJlclRydXN0IFJvb3Q=">
<serialNumber>Bydvrw==</serialNumber>
</certItem>
@ -4797,6 +4817,9 @@
<certItem issuerName="MFwxCzAJBgNVBAYTAkJFMRUwEwYDVQQLEwxUcnVzdGVkIFJvb3QxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExGzAZBgNVBAMTElRydXN0ZWQgUm9vdCBDQSBHMg==">
<serialNumber>LAVIFm0MWZYH+Sv8Vf+IqkM=</serialNumber>
</certItem>
<certItem issuerName="MIGFMQswCQYDVQQGEwJVUzEgMB4GA1UECgwXV2VsbHMgRmFyZ28gV2VsbHNTZWN1cmUxHDAaBgNVBAsME1dlbGxzIEZhcmdvIEJhbmsgTkExNjA0BgNVBAMMLVdlbGxzU2VjdXJlIFB1YmxpYyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eQ==">
<serialNumber>ANU=</serialNumber>
</certItem>
<certItem issuerName="MIGVMQswCQYDVQQGEwJHUjFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTE=">
<serialNumber>GN2Hrh9LtnM=</serialNumber>
</certItem>

View File

@ -5232,7 +5232,20 @@ nsBrowserAccess.prototype = {
return browser;
},
createContentWindow(aURI, aOpener, aWhere, aFlags) {
return this.getContentWindowOrOpenURI(null, aOpener, aWhere, aFlags);
},
openURI(aURI, aOpener, aWhere, aFlags, aTriggeringPrincipal) {
if (!aURI) {
Cu.reportError("openURI should only be called with a valid URI");
throw Cr.NS_ERROR_FAILURE;
}
return this.getContentWindowOrOpenURI(aURI, aOpener, aWhere, aFlags,
aTriggeringPrincipal);
},
getContentWindowOrOpenURI(aURI, aOpener, aWhere, aFlags, aTriggeringPrincipal) {
// This function should only ever be called if we're opening a URI
// from a non-remote browser window (via nsContentTreeOwner).
if (aOpener && Cu.isCrossProcessWrapper(aOpener)) {

View File

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 417 B

View File

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 417 B

View File

@ -334,7 +334,7 @@ inline const Stmt *IgnoreTrivials(const Stmt *s) {
}
inline const Expr *IgnoreTrivials(const Expr *e) {
return cast<Expr>(IgnoreTrivials(static_cast<const Stmt *>(e)));
return cast_or_null<Expr>(IgnoreTrivials(static_cast<const Stmt *>(e)));
}
const FieldDecl *getBaseRefCntMember(QualType T);

View File

@ -22,7 +22,7 @@ interface nsIOpenURIInFrameParams : nsISupports
readonly attribute jsval openerOriginAttributes;
};
[scriptable, uuid(9d17f3dd-672b-451e-afd2-b1115df780d5)]
[scriptable, uuid(2a9bb880-5d73-40f3-8152-c60c8d137a14)]
/**
* The C++ source has access to the browser script source through
@ -34,7 +34,7 @@ interface nsIOpenURIInFrameParams : nsISupports
interface nsIBrowserDOMWindow : nsISupports
{
/**
* Values for openURI's aWhere parameter.
* Values for createContentWindow's and openURI's aWhere parameter.
*/
/**
* Do whatever the default is based on application state, user preferences,
@ -64,7 +64,8 @@ interface nsIBrowserDOMWindow : nsISupports
const short OPEN_SWITCHTAB = 4;
/**
* Values for openURI's aFlags parameter. This is a bitflags field.
* Values for createContentWindow's and openURI's aFlags parameter.
* This is a bitflags field.
*
* The 0x1 bit decides the behavior of OPEN_DEFAULTWINDOW, and the 0x4 bit
* controls whether or not to set the window.opener property on the newly
@ -75,31 +76,48 @@ interface nsIBrowserDOMWindow : nsISupports
* the same way internally.
*/
/**
* internal open new window
* Internal open new window.
*/
const long OPEN_NEW = 0x0;
/**
* external link (load request from another application, xremote, etc).
* External link (load request from another application, xremote, etc).
*/
const long OPEN_EXTERNAL = 0x1;
/**
* Don't set the window.opener property on the window which is being opened
* Don't set the window.opener property on the window which is being opened.
*/
const long OPEN_NO_OPENER = 0x4;
/**
* Load a URI
* Create the content window for the given URI.
* @param aURI the URI to open. null is allowed. If null is passed in, no
* load will be done, though the window the load would have
* happened in will be returned.
* @param aURI the URI to be opened in the window (can be null).
* @param aWhere see possible values described above.
* @param aOpener window requesting the creation (can be null).
* @param aFlags flags which control the behavior of the load. The
* OPEN_EXTERNAL/OPEN_NEW flag is only used when
* aWhere == OPEN_DEFAULTWINDOW.
* @param aTriggeringPrincipal the principal that would trigger the potential
* load of aURI.
* @return the window into which the URI would have been opened.
*/
mozIDOMWindowProxy
createContentWindow(in nsIURI aURI, in mozIDOMWindowProxy aOpener,
in short aWhere, in long aFlags,
in nsIPrincipal aTriggeringPrincipal);
/**
* Load a URI.
* @param aURI the URI to open. null is not allowed. To create the window
* without loading the URI, use createContentWindow instead.
* @param aWhere see possible values described above.
* @param aOpener window requesting the open (can be null).
* @param aFlags flags which control the behavior of the load. The
* OPEN_EXTERNAL/OPEN_NEW flag is only used when
* aWhere == OPEN_DEFAULTWINDOW.
* @param aTriggeringPrincipal the principal that triggered the load of aURI
* @param aTriggeringPrincipal the principal that triggered the load of aURI.
* @return the window into which the URI was opened.
*/
mozIDOMWindowProxy

View File

@ -239,10 +239,6 @@ typedef struct NPObjectMemberPrivate {
NPP npp;
} NPObjectMemberPrivate;
static bool
NPObjectMember_GetProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
JS::MutableHandleValue vp);
static void
NPObjectMember_Finalize(JSFreeOp *fop, JSObject *obj);
@ -256,7 +252,7 @@ static bool
NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, JS::Value *vp);
static const JSClassOps sNPObjectMemberClassOps = {
nullptr, nullptr, NPObjectMember_GetProperty, nullptr,
nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr,
NPObjectMember_Finalize, NPObjectMember_Call,
nullptr, nullptr, NPObjectMember_Trace
@ -2057,7 +2053,7 @@ CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj,
// during initialization.
memset(memberPrivate, 0, sizeof(NPObjectMemberPrivate));
JSObject *memobj = ::JS_NewObject(cx, &sNPObjectMemberClass);
JS::Rooted<JSObject*> memobj(cx, ::JS_NewObject(cx, &sNPObjectMemberClass));
if (!memobj) {
free(memberPrivate);
return false;
@ -2099,28 +2095,19 @@ CreateNPObjectMember(NPP npp, JSContext *cx, JSObject *obj, NPObject* npobj,
memberPrivate->methodName = id;
memberPrivate->npp = npp;
return true;
}
// Finally, define the Symbol.toPrimitive property on |memobj|.
static bool
NPObjectMember_GetProperty(JSContext *cx, JS::HandleObject obj, JS::HandleId id,
JS::MutableHandleValue vp)
{
AUTO_PROFILER_LABEL("NPObjectMember_GetProperty", OTHER);
JS::Rooted<jsid> toPrimitiveId(cx);
toPrimitiveId = SYMBOL_TO_JSID(JS::GetWellKnownSymbol(cx, JS::SymbolCode::toPrimitive));
if (JSID_IS_SYMBOL(id)) {
JS::RootedSymbol sym(cx, JSID_TO_SYMBOL(id));
if (JS::GetSymbolCode(sym) == JS::SymbolCode::toPrimitive) {
JS::RootedObject obj(cx, JS_GetFunctionObject(
JS_NewFunction(
cx, NPObjectMember_toPrimitive, 1, 0,
"Symbol.toPrimitive")));
if (!obj)
return false;
vp.setObject(*obj);
return true;
}
}
JSFunction* fun = JS_NewFunction(cx, NPObjectMember_toPrimitive, 1, 0,
"Symbol.toPrimitive");
if (!fun)
return false;
JS::Rooted<JSObject*> funObj(cx, JS_GetFunctionObject(fun));
if (!JS_DefinePropertyById(cx, memobj, toPrimitiveId, funObj, 0))
return false;
return true;
}

View File

@ -0,0 +1,169 @@
# HG changeset patch
# User Mats Palmgren <mats@mozilla.com>
# Parent f3483af8ecf997453064201c49c48a682c7f3c29
Bug 1377257 part 1 - Add cairo_scaled_font_get_hint_metrics to avoid malloc/free that is required to use cairo_scaled_font_get_font_options. r=jfkthame
diff --git a/gfx/cairo/add-cairo_scaled_font_get_hint_metrics b/gfx/cairo/add-cairo_scaled_font_get_hint_metrics
new file mode 100644
--- /dev/null
+++ b/gfx/cairo/add-cairo_scaled_font_get_hint_metrics
@@ -0,0 +1,82 @@
+# HG changeset patch
+# User Mats Palmgren <mats@mozilla.com>
+# Parent f3483af8ecf997453064201c49c48a682c7f3c29
+Bug 1377257 part 1 - Add cairo_scaled_font_get_hint_metrics to avoid malloc/free that is required to use cairo_scaled_font_get_font_options. r=jfkthame
+
+diff --git a/gfx/cairo/cairo/src/cairo-rename.h b/gfx/cairo/cairo/src/cairo-rename.h
+--- a/gfx/cairo/cairo/src/cairo-rename.h
++++ b/gfx/cairo/cairo/src/cairo-rename.h
+@@ -262,16 +262,17 @@
+ #define cairo_scale _moz_cairo_scale
+ #define cairo_scaled_font_create _moz_cairo_scaled_font_create
+ #define cairo_scaled_font_destroy _moz_cairo_scaled_font_destroy
+ #define cairo_scaled_font_extents _moz_cairo_scaled_font_extents
+ #define cairo_scaled_font_get_ctm _moz_cairo_scaled_font_get_ctm
+ #define cairo_scaled_font_get_font_face _moz_cairo_scaled_font_get_font_face
+ #define cairo_scaled_font_get_font_matrix _moz_cairo_scaled_font_get_font_matrix
+ #define cairo_scaled_font_get_font_options _moz_cairo_scaled_font_get_font_options
++#define cairo_scaled_font_get_hint_metrics _moz_cairo_scaled_font_get_hint_metrics
+ #define cairo_scaled_font_get_reference_count _moz_cairo_scaled_font_get_reference_count
+ #define cairo_scaled_font_get_scale_matrix _moz_cairo_scaled_font_get_scale_matrix
+ #define cairo_scaled_font_get_type _moz_cairo_scaled_font_get_type
+ #define cairo_scaled_font_get_user_data _moz_cairo_scaled_font_get_user_data
+ #define cairo_scaled_font_glyph_extents _moz_cairo_scaled_font_glyph_extents
+ #define cairo_scaled_font_reference _moz_cairo_scaled_font_reference
+ #define cairo_scaled_font_set_user_data _moz_cairo_scaled_font_set_user_data
+ #define cairo_scaled_font_status _moz_cairo_scaled_font_status
+diff --git a/gfx/cairo/cairo/src/cairo-scaled-font.c b/gfx/cairo/cairo/src/cairo-scaled-font.c
+--- a/gfx/cairo/cairo/src/cairo-scaled-font.c
++++ b/gfx/cairo/cairo/src/cairo-scaled-font.c
+@@ -2983,8 +2983,28 @@ cairo_scaled_font_get_font_options (cair
+ if (scaled_font->status) {
+ _cairo_font_options_init_default (options);
+ return;
+ }
+
+ _cairo_font_options_init_copy (options, &scaled_font->options);
+ }
+ slim_hidden_def (cairo_scaled_font_get_font_options);
++
++/**
++ * cairo_scaled_font_get_hint_metrics:
++ * @scaled_font: a #cairo_scaled_font_t
++ *
++ * Mozilla extension since the required malloc/free to use
++ * cairo_scaled_font_get_font_options() above is too slow.
++ **/
++cairo_public cairo_hint_metrics_t
++cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font)
++{
++ cairo_font_options_t options;
++ if (scaled_font->status) {
++ _cairo_font_options_init_default (&options);
++ } else {
++ _cairo_font_options_init_copy (&options, &scaled_font->options);
++ }
++ return options.hint_metrics;
++}
++slim_hidden_def (cairo_scaled_font_get_hint_metrics);
+diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h
+--- a/gfx/cairo/cairo/src/cairo.h
++++ b/gfx/cairo/cairo/src/cairo.h
+@@ -1493,16 +1493,21 @@ cairo_scaled_font_get_ctm (cairo_scaled_
+ cairo_public void
+ cairo_scaled_font_get_scale_matrix (cairo_scaled_font_t *scaled_font,
+ cairo_matrix_t *scale_matrix);
+
+ cairo_public void
+ cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font,
+ cairo_font_options_t *options);
+
++/* mozilla extension, see https://bugzilla.mozilla.org/show_bug.cgi?id=1377257 */
++cairo_public cairo_hint_metrics_t
++cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font);
++
++
+
+ /* Toy fonts */
+
+ cairo_public cairo_font_face_t *
+ cairo_toy_font_face_create (const char *family,
+ cairo_font_slant_t slant,
+ cairo_font_weight_t weight);
+
diff --git a/gfx/cairo/cairo/src/cairo-rename.h b/gfx/cairo/cairo/src/cairo-rename.h
--- a/gfx/cairo/cairo/src/cairo-rename.h
+++ b/gfx/cairo/cairo/src/cairo-rename.h
@@ -262,16 +262,17 @@
#define cairo_scale _moz_cairo_scale
#define cairo_scaled_font_create _moz_cairo_scaled_font_create
#define cairo_scaled_font_destroy _moz_cairo_scaled_font_destroy
#define cairo_scaled_font_extents _moz_cairo_scaled_font_extents
#define cairo_scaled_font_get_ctm _moz_cairo_scaled_font_get_ctm
#define cairo_scaled_font_get_font_face _moz_cairo_scaled_font_get_font_face
#define cairo_scaled_font_get_font_matrix _moz_cairo_scaled_font_get_font_matrix
#define cairo_scaled_font_get_font_options _moz_cairo_scaled_font_get_font_options
+#define cairo_scaled_font_get_hint_metrics _moz_cairo_scaled_font_get_hint_metrics
#define cairo_scaled_font_get_reference_count _moz_cairo_scaled_font_get_reference_count
#define cairo_scaled_font_get_scale_matrix _moz_cairo_scaled_font_get_scale_matrix
#define cairo_scaled_font_get_type _moz_cairo_scaled_font_get_type
#define cairo_scaled_font_get_user_data _moz_cairo_scaled_font_get_user_data
#define cairo_scaled_font_glyph_extents _moz_cairo_scaled_font_glyph_extents
#define cairo_scaled_font_reference _moz_cairo_scaled_font_reference
#define cairo_scaled_font_set_user_data _moz_cairo_scaled_font_set_user_data
#define cairo_scaled_font_status _moz_cairo_scaled_font_status
diff --git a/gfx/cairo/cairo/src/cairo-scaled-font.c b/gfx/cairo/cairo/src/cairo-scaled-font.c
--- a/gfx/cairo/cairo/src/cairo-scaled-font.c
+++ b/gfx/cairo/cairo/src/cairo-scaled-font.c
@@ -2983,8 +2983,28 @@ cairo_scaled_font_get_font_options (cair
if (scaled_font->status) {
_cairo_font_options_init_default (options);
return;
}
_cairo_font_options_init_copy (options, &scaled_font->options);
}
slim_hidden_def (cairo_scaled_font_get_font_options);
+
+/**
+ * cairo_scaled_font_get_hint_metrics:
+ * @scaled_font: a #cairo_scaled_font_t
+ *
+ * Mozilla extension since the required malloc/free to use
+ * cairo_scaled_font_get_font_options() above is too slow.
+ **/
+cairo_public cairo_hint_metrics_t
+cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font)
+{
+ cairo_font_options_t options;
+ if (scaled_font->status) {
+ _cairo_font_options_init_default (&options);
+ } else {
+ _cairo_font_options_init_copy (&options, &scaled_font->options);
+ }
+ return options.hint_metrics;
+}
+slim_hidden_def (cairo_scaled_font_get_hint_metrics);
diff --git a/gfx/cairo/cairo/src/cairo.h b/gfx/cairo/cairo/src/cairo.h
--- a/gfx/cairo/cairo/src/cairo.h
+++ b/gfx/cairo/cairo/src/cairo.h
@@ -1493,16 +1493,19 @@ cairo_scaled_font_get_ctm (cairo_scaled_
cairo_public void
cairo_scaled_font_get_scale_matrix (cairo_scaled_font_t *scaled_font,
cairo_matrix_t *scale_matrix);
cairo_public void
cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font,
cairo_font_options_t *options);
+cairo_public cairo_hint_metrics_t
+cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font);
+
/* Toy fonts */
cairo_public cairo_font_face_t *
cairo_toy_font_face_create (const char *family,
cairo_font_slant_t slant,
cairo_font_weight_t weight);

View File

@ -267,6 +267,7 @@
#define cairo_scaled_font_get_font_face _moz_cairo_scaled_font_get_font_face
#define cairo_scaled_font_get_font_matrix _moz_cairo_scaled_font_get_font_matrix
#define cairo_scaled_font_get_font_options _moz_cairo_scaled_font_get_font_options
#define cairo_scaled_font_get_hint_metrics _moz_cairo_scaled_font_get_hint_metrics
#define cairo_scaled_font_get_reference_count _moz_cairo_scaled_font_get_reference_count
#define cairo_scaled_font_get_scale_matrix _moz_cairo_scaled_font_get_scale_matrix
#define cairo_scaled_font_get_type _moz_cairo_scaled_font_get_type

View File

@ -2988,3 +2988,23 @@ cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font,
_cairo_font_options_init_copy (options, &scaled_font->options);
}
slim_hidden_def (cairo_scaled_font_get_font_options);
/**
* cairo_scaled_font_get_hint_metrics:
* @scaled_font: a #cairo_scaled_font_t
*
* Mozilla extension since the required malloc/free to use
* cairo_scaled_font_get_font_options() above is too slow.
**/
cairo_public cairo_hint_metrics_t
cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font)
{
cairo_font_options_t options;
if (scaled_font->status) {
_cairo_font_options_init_default (&options);
} else {
_cairo_font_options_init_copy (&options, &scaled_font->options);
}
return options.hint_metrics;
}
slim_hidden_def (cairo_scaled_font_get_hint_metrics);

View File

@ -1498,6 +1498,10 @@ cairo_public void
cairo_scaled_font_get_font_options (cairo_scaled_font_t *scaled_font,
cairo_font_options_t *options);
/* mozilla extension, see https://bugzilla.mozilla.org/show_bug.cgi?id=1377257 */
cairo_public cairo_hint_metrics_t
cairo_scaled_font_get_hint_metrics (cairo_scaled_font_t *scaled_font);
/* Toy fonts */

View File

@ -2473,6 +2473,7 @@ slim_hidden_proto (cairo_scaled_font_get_ctm);
slim_hidden_proto (cairo_scaled_font_get_font_face);
slim_hidden_proto (cairo_scaled_font_get_font_matrix);
slim_hidden_proto (cairo_scaled_font_get_font_options);
slim_hidden_proto (cairo_scaled_font_get_hint_metrics);
slim_hidden_proto (cairo_scaled_font_glyph_extents);
slim_hidden_proto_no_warn (cairo_scaled_font_reference);
slim_hidden_proto (cairo_scaled_font_status);

View File

@ -278,6 +278,7 @@ AsyncImagePipelineManager::ApplyAsyncImages()
&opacity,
pipeline->mScTransform.IsIdentity() ? nullptr : &pipeline->mScTransform,
wr::TransformStyle::Flat,
nullptr,
pipeline->mMixBlendMode,
nsTArray<wr::WrFilterOp>());

View File

@ -33,6 +33,7 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
mBuilder->PushStackingContext(scBounds, 0, &opacity,
mTransform.IsIdentity() ? nullptr : &mTransform,
wr::TransformStyle::Flat,
nullptr,
wr::ToMixBlendMode(layer->GetMixBlendMode()),
aFilters);
mOrigin = aLayer->Bounds().TopLeft();
@ -57,6 +58,7 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
aOpacityPtr,
aTransformPtr,
wr::TransformStyle::Flat,
nullptr,
wr::ToMixBlendMode(aLayer->GetLayer()->GetMixBlendMode()),
aFilters);
mOrigin = aLayer->Bounds().TopLeft();
@ -71,19 +73,28 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
uint64_t aAnimationsId,
float* aOpacityPtr,
gfx::Matrix4x4* aTransformPtr,
gfx::Matrix4x4* aPerspectivePtr,
const nsTArray<wr::WrFilterOp>& aFilters,
const gfx::CompositionOp& aMixBlendMode)
: mBuilder(&aBuilder)
{
nsRect itemBounds = aDisplayList->GetClippedBoundsWithRespectToASR(aDisplayListBuilder, aItem->GetActiveScrolledRoot());
nsRect childrenVisible = aItem->GetVisibleRectForChildren();
nsRect visibleRect = itemBounds.Intersect(childrenVisible);
nsRect visibleRect;
bool is2d = aTransformPtr && aTransformPtr->Is2D() && !aPerspectivePtr;
if (is2d) {
nsRect itemBounds = aDisplayList->GetClippedBoundsWithRespectToASR(aDisplayListBuilder, aItem->GetActiveScrolledRoot());
nsRect childrenVisible = aItem->GetVisibleRectForChildren();
visibleRect = itemBounds.Intersect(childrenVisible);
} else {
visibleRect = aDisplayList->GetBounds(aDisplayListBuilder);
// The position of bounds are calculated by transform and perspective matrix in 3d case. reset it to (0, 0)
visibleRect.MoveTo(0, 0);
}
float appUnitsPerDevPixel = aItem->Frame()->PresContext()->AppUnitsPerDevPixel();
LayerRect bounds = ViewAs<LayerPixel>(LayoutDeviceRect::FromAppUnits(visibleRect, appUnitsPerDevPixel),
PixelCastJustification::WebRenderHasUnitResolution);
// WR will only apply the 'translate' of the transform, so we need to do the scale/rotation manually.
if (aBoundTransform && !aBoundTransform->IsIdentity()) {
if (aBoundTransform && !aBoundTransform->IsIdentity() && is2d) {
bounds.MoveTo(aBoundTransform->TransformPoint(bounds.TopLeft()));
}
@ -96,7 +107,8 @@ StackingContextHelper::StackingContextHelper(const StackingContextHelper& aParen
aAnimationsId,
aOpacityPtr,
aTransformPtr,
wr::TransformStyle::Flat,
is2d ? wr::TransformStyle::Flat : wr::TransformStyle::Preserve3D,
aPerspectivePtr,
wr::ToMixBlendMode(aMixBlendMode),
aFilters);

View File

@ -56,6 +56,7 @@ public:
uint64_t aAnimationsId,
float* aOpacityPtr,
gfx::Matrix4x4* aTransformPtr,
gfx::Matrix4x4* aPerspectivePtr = nullptr,
const nsTArray<wr::WrFilterOp>& aFilters = nsTArray<wr::WrFilterOp>(),
const gfx::CompositionOp& aMixBlendMode = gfx::CompositionOp::OP_OVER);
// This version of the constructor should only be used at the root level

View File

@ -842,11 +842,8 @@ gfxFont::GetRoundOffsetsToPixels(DrawTarget* aDrawTarget)
}
// Sometimes hint metrics gets set for us, most notably for printing.
cairo_font_options_t *font_options = cairo_font_options_create();
cairo_scaled_font_get_font_options(scaled_font, font_options);
cairo_hint_metrics_t hint_metrics =
cairo_font_options_get_hint_metrics(font_options);
cairo_font_options_destroy(font_options);
cairo_scaled_font_get_hint_metrics(scaled_font);
switch (hint_metrics) {
case CAIRO_HINT_METRICS_OFF:

View File

@ -642,6 +642,7 @@ DisplayListBuilder::PushStackingContext(const wr::LayoutRect& aBounds,
const float* aOpacity,
const gfx::Matrix4x4* aTransform,
wr::TransformStyle aTransformStyle,
const gfx::Matrix4x4* aPerspective,
const wr::MixBlendMode& aMixBlendMode,
const nsTArray<wr::WrFilterOp>& aFilters)
{
@ -650,11 +651,16 @@ DisplayListBuilder::PushStackingContext(const wr::LayoutRect& aBounds,
matrix = ToLayoutTransform(*aTransform);
}
const wr::LayoutTransform* maybeTransform = aTransform ? &matrix : nullptr;
wr::LayoutTransform perspective;
if (aPerspective) {
perspective = ToLayoutTransform(*aPerspective);
}
const wr::LayoutTransform* maybePerspective = aPerspective ? &perspective : nullptr;
WRDL_LOG("PushStackingContext b=%s t=%s\n", Stringify(aBounds).c_str(),
aTransform ? Stringify(*aTransform).c_str() : "none");
wr_dp_push_stacking_context(mWrState, aBounds, aAnimationId, aOpacity,
maybeTransform, aTransformStyle, aMixBlendMode,
aFilters.Elements(), aFilters.Length());
maybeTransform, aTransformStyle, maybePerspective,
aMixBlendMode, aFilters.Elements(), aFilters.Length());
}
void

View File

@ -173,6 +173,7 @@ public:
const float* aOpacity,
const gfx::Matrix4x4* aTransform,
wr::TransformStyle aTransformStyle,
const gfx::Matrix4x4* aPerspective,
const wr::MixBlendMode& aMixBlendMode,
const nsTArray<wr::WrFilterOp>& aFilters);
void PopStackingContext();

View File

@ -998,6 +998,7 @@ pub extern "C" fn wr_dp_push_stacking_context(state: &mut WrState,
opacity: *const f32,
transform: *const LayoutTransform,
transform_style: TransformStyle,
perspective: *const LayoutTransform,
mix_blend_mode: MixBlendMode,
filters: *const WrFilterOp,
filter_count: usize) {
@ -1038,13 +1039,18 @@ pub extern "C" fn wr_dp_push_stacking_context(state: &mut WrState,
_ => Some(PropertyBinding::Binding(PropertyBindingKey::new(animation_id))),
};
let perspective_ref = unsafe { perspective.as_ref() };
let perspective = match perspective_ref {
Some(perspective) => Some(perspective.clone()),
None => None,
};
state.frame_builder
.dl_builder
.push_stacking_context(webrender_api::ScrollPolicy::Scrollable,
bounds,
transform_binding,
transform_style,
None,
perspective,
mix_blend_mode,
filters);
}

View File

@ -943,6 +943,7 @@ void wr_dp_push_stacking_context(WrState *aState,
const float *aOpacity,
const LayoutTransform *aTransform,
TransformStyle aTransformStyle,
const LayoutTransform *aPerspective,
MixBlendMode aMixBlendMode,
const WrFilterOp *aFilters,
size_t aFilterCount)

View File

@ -49,13 +49,11 @@ JS_Assert(const char* s, const char* file, int ln);
#else
namespace js {
namespace oom {
/*
* To make testing OOM in certain helper threads more effective,
* allow restricting the OOM testing to a certain helper thread
* type. This allows us to fail e.g. in off-thread script parsing
* without causing an OOM in the active thread first.
* Thread types are used to tag threads for certain kinds of testing (see
* below), and also used to characterize threads in the thread scheduler (see
* js/src/vm/HelperThreads.cpp).
*/
enum ThreadType {
THREAD_TYPE_NONE = 0, // 0
@ -71,9 +69,16 @@ enum ThreadType {
THREAD_TYPE_MAX // Used to check shell function arguments
};
namespace oom {
/*
* Getter/Setter functions to encapsulate mozilla::ThreadLocal,
* implementation is in jsutil.cpp.
* Theads are tagged only in certain debug contexts. Notably, to make testing
* OOM in certain helper threads more effective, we allow restricting the OOM
* testing to a certain helper thread type. This allows us to fail e.g. in
* off-thread script parsing without causing an OOM in the active thread first.
*
* Getter/Setter functions to encapsulate mozilla::ThreadLocal, implementation
* is in jsutil.cpp.
*/
# if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
extern bool InitThreadType(void);

View File

@ -1369,7 +1369,7 @@ static bool
OOMThreadTypes(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
args.rval().setInt32(js::oom::THREAD_TYPE_MAX);
args.rval().setInt32(js::THREAD_TYPE_MAX);
return true;
}
@ -1402,11 +1402,11 @@ SetupOOMFailure(JSContext* cx, bool failAlways, unsigned argc, Value* vp)
return false;
}
uint32_t targetThread = js::oom::THREAD_TYPE_COOPERATING;
uint32_t targetThread = js::THREAD_TYPE_COOPERATING;
if (args.length() > 1 && !ToUint32(cx, args[1], &targetThread))
return false;
if (targetThread == js::oom::THREAD_TYPE_NONE || targetThread >= js::oom::THREAD_TYPE_MAX) {
if (targetThread == js::THREAD_TYPE_NONE || targetThread >= js::THREAD_TYPE_MAX) {
JS_ReportErrorASCII(cx, "Invalid thread type specified");
return false;
}
@ -1486,13 +1486,13 @@ OOMTest(JSContext* cx, unsigned argc, Value* vp)
bool verbose = EnvVarIsDefined("OOM_VERBOSE");
unsigned threadStart = oom::THREAD_TYPE_COOPERATING;
unsigned threadEnd = oom::THREAD_TYPE_MAX;
unsigned threadStart = THREAD_TYPE_COOPERATING;
unsigned threadEnd = THREAD_TYPE_MAX;
// Test a single thread type if specified by the OOM_THREAD environment variable.
int threadOption = 0;
if (EnvVarAsInt("OOM_THREAD", &threadOption)) {
if (threadOption < oom::THREAD_TYPE_COOPERATING || threadOption > oom::THREAD_TYPE_MAX) {
if (threadOption < THREAD_TYPE_COOPERATING || threadOption > THREAD_TYPE_MAX) {
JS_ReportErrorASCII(cx, "OOM_THREAD value out of range.");
return false;
}

View File

@ -381,7 +381,7 @@ BEGIN_TEST(testHashMapLookupWithDefaultOOM)
{
uint32_t timeToFail;
for (timeToFail = 1; timeToFail < 1000; timeToFail++) {
js::oom::SimulateOOMAfter(timeToFail, js::oom::THREAD_TYPE_COOPERATING, false);
js::oom::SimulateOOMAfter(timeToFail, js::THREAD_TYPE_COOPERATING, false);
LookupWithDefaultUntilResize();
}

View File

@ -36,7 +36,7 @@ const uint32_t maxAllocsPerTest = 100;
testName = name; \
printf("Test %s: started\n", testName); \
for (oomAfter = 1; oomAfter < maxAllocsPerTest; ++oomAfter) { \
js::oom::SimulateOOMAfter(oomAfter, js::oom::THREAD_TYPE_COOPERATING, true)
js::oom::SimulateOOMAfter(oomAfter, js::THREAD_TYPE_COOPERATING, true)
#define OOM_TEST_FINISHED \
{ \

View File

@ -62,7 +62,7 @@ GetThreadType(void) {
void
SimulateOOMAfter(uint64_t allocations, uint32_t thread, bool always) {
MOZ_ASSERT(counter + allocations > counter);
MOZ_ASSERT(thread > js::oom::THREAD_TYPE_NONE && thread < js::oom::THREAD_TYPE_MAX);
MOZ_ASSERT(thread > js::THREAD_TYPE_NONE && thread < js::THREAD_TYPE_MAX);
targetThread = thread;
maxAllocations = counter + allocations;
failAlways = always;

View File

@ -373,7 +373,7 @@ UNIFIED_SOURCES += [
'wasm/WasmCompartment.cpp',
'wasm/WasmCompile.cpp',
'wasm/WasmDebug.cpp',
'wasm/WasmFrameIterator.cpp',
'wasm/WasmFrameIter.cpp',
'wasm/WasmGenerator.cpp',
'wasm/WasmInstance.cpp',
'wasm/WasmIonCompile.cpp',

View File

@ -16,6 +16,7 @@
#include "frontend/BytecodeCompiler.h"
#include "gc/GCInternals.h"
#include "jit/IonBuilder.h"
#include "js/Utility.h"
#include "threading/CpuCount.h"
#include "vm/Debugger.h"
#include "vm/ErrorReporting.h"
@ -963,21 +964,56 @@ GlobalHelperThreadState::waitForAllThreads()
wait(lock, CONSUMER);
}
// A task can be a "master" task, ie, it will block waiting for other worker
// threads that perform work on its behalf. If so it must not take the last
// available thread; there must always be at least one worker thread able to do
// the actual work. (Or the system may deadlock.)
//
// If a task is a master task it *must* pass isMaster=true here, or perform a
// similar calculation to avoid deadlock from starvation.
//
// isMaster should only be true if the thread calling checkTaskThreadLimit() is
// a helper thread.
//
// NOTE: Calling checkTaskThreadLimit() from a helper thread in the dynamic
// region after currentTask.emplace() and before currentTask.reset() may cause
// it to return a different result than if it is called outside that dynamic
// region, as the predicate inspects the values of the threads' currentTask
// members.
template <typename T>
bool
GlobalHelperThreadState::checkTaskThreadLimit(size_t maxThreads) const
GlobalHelperThreadState::checkTaskThreadLimit(size_t maxThreads, bool isMaster) const
{
if (maxThreads >= threadCount)
MOZ_ASSERT(maxThreads > 0);
if (!isMaster && maxThreads >= threadCount)
return true;
size_t count = 0;
size_t idle = 0;
for (auto& thread : *threads) {
if (thread.currentTask.isSome() && thread.currentTask->is<T>())
count++;
if (thread.currentTask.isSome()) {
if (thread.currentTask->is<T>())
count++;
} else {
idle++;
}
if (count >= maxThreads)
return false;
}
// It is possible for the number of idle threads to be zero here, because
// checkTaskThreadLimit() can be called from non-helper threads. Notably,
// the compression task scheduler invokes it, and runs off a helper thread.
if (idle == 0)
return false;
// A master thread that's the last available thread must not be allowed to
// run.
if (isMaster && idle == 1)
return false;
return true;
}
@ -992,7 +1028,7 @@ struct MOZ_RAII AutoSetContextRuntime
};
static inline bool
IsHelperThreadSimulatingOOM(js::oom::ThreadType threadType)
IsHelperThreadSimulatingOOM(js::ThreadType threadType)
{
#if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
return js::oom::targetThread == threadType;
@ -1004,7 +1040,7 @@ IsHelperThreadSimulatingOOM(js::oom::ThreadType threadType)
size_t
GlobalHelperThreadState::maxIonCompilationThreads() const
{
if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_ION))
if (IsHelperThreadSimulatingOOM(js::THREAD_TYPE_ION))
return 1;
return threadCount;
}
@ -1018,7 +1054,7 @@ GlobalHelperThreadState::maxUnpausedIonCompilationThreads() const
size_t
GlobalHelperThreadState::maxWasmCompilationThreads() const
{
if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_WASM))
if (IsHelperThreadSimulatingOOM(js::THREAD_TYPE_WASM))
return 1;
return cpuCount;
}
@ -1026,7 +1062,7 @@ GlobalHelperThreadState::maxWasmCompilationThreads() const
size_t
GlobalHelperThreadState::maxParseThreads() const
{
if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_PARSE))
if (IsHelperThreadSimulatingOOM(js::THREAD_TYPE_PARSE))
return 1;
// Don't allow simultaneous off thread parses, to reduce contention on the
@ -1039,7 +1075,7 @@ GlobalHelperThreadState::maxParseThreads() const
size_t
GlobalHelperThreadState::maxCompressionThreads() const
{
if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_COMPRESS))
if (IsHelperThreadSimulatingOOM(js::THREAD_TYPE_COMPRESS))
return 1;
// Compression is triggered on major GCs to compress ScriptSources. It is
@ -1050,7 +1086,7 @@ GlobalHelperThreadState::maxCompressionThreads() const
size_t
GlobalHelperThreadState::maxGCHelperThreads() const
{
if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_GCHELPER))
if (IsHelperThreadSimulatingOOM(js::THREAD_TYPE_GCHELPER))
return 1;
return threadCount;
}
@ -1058,7 +1094,7 @@ GlobalHelperThreadState::maxGCHelperThreads() const
size_t
GlobalHelperThreadState::maxGCParallelThreads() const
{
if (IsHelperThreadSimulatingOOM(js::oom::THREAD_TYPE_GCPARALLEL))
if (IsHelperThreadSimulatingOOM(js::THREAD_TYPE_GCPARALLEL))
return 1;
return threadCount;
}
@ -1213,7 +1249,12 @@ GlobalHelperThreadState::pendingIonCompileHasSufficientPriority(
bool
GlobalHelperThreadState::canStartParseTask(const AutoLockHelperThreadState& lock)
{
return !parseWorklist(lock).empty() && checkTaskThreadLimit<ParseTask*>(maxParseThreads());
// Parse tasks that end up compiling asm.js in turn may use Wasm compilation
// threads to generate machine code. We have no way (at present) to know
// ahead of time whether a parse task is going to parse asm.js content or
// not, so we just assume that all parse tasks are master tasks.
return !parseWorklist(lock).empty() &&
checkTaskThreadLimit<ParseTask*>(maxParseThreads(), /*isMaster=*/true);
}
bool
@ -2142,53 +2183,74 @@ HelperThread::threadLoop()
while (true) {
MOZ_ASSERT(idle());
// Block until a task is available. Save the value of whether we are
// going to do an Ion compile, in case the value returned by the method
// changes.
bool ionCompile = false;
js::ThreadType task;
while (true) {
if (terminate)
return;
if ((ionCompile = HelperThreadState().pendingIonCompileHasSufficientPriority(lock)) ||
HelperThreadState().canStartWasmCompile(lock) ||
HelperThreadState().canStartPromiseTask(lock) ||
HelperThreadState().canStartParseTask(lock) ||
HelperThreadState().canStartCompressionTask(lock) ||
HelperThreadState().canStartGCHelperTask(lock) ||
HelperThreadState().canStartGCParallelTask(lock) ||
HelperThreadState().canStartIonFreeTask(lock))
{
// Select the task type to run. Task priority is determined
// exclusively here.
//
// The selectors may depend on the HelperThreadState not changing
// between task selection and task execution, in particular, on new
// tasks not being added (because of the lifo structure of the work
// lists). Unlocking the HelperThreadState between task selection
// and execution is not well-defined.
if (HelperThreadState().canStartGCParallelTask(lock))
task = js::THREAD_TYPE_GCPARALLEL;
else if (HelperThreadState().canStartGCHelperTask(lock))
task = js::THREAD_TYPE_GCHELPER;
else if (HelperThreadState().pendingIonCompileHasSufficientPriority(lock))
task = js::THREAD_TYPE_ION;
else if (HelperThreadState().canStartWasmCompile(lock))
task = js::THREAD_TYPE_WASM;
else if (HelperThreadState().canStartPromiseTask(lock))
task = js::THREAD_TYPE_PROMISE_TASK;
else if (HelperThreadState().canStartParseTask(lock))
task = js::THREAD_TYPE_PARSE;
else if (HelperThreadState().canStartCompressionTask(lock))
task = js::THREAD_TYPE_COMPRESS;
else if (HelperThreadState().canStartIonFreeTask(lock))
task = js::THREAD_TYPE_ION_FREE;
else
task = js::THREAD_TYPE_NONE;
if (task != js::THREAD_TYPE_NONE)
break;
}
HelperThreadState().wait(lock, GlobalHelperThreadState::PRODUCER);
}
if (HelperThreadState().canStartGCParallelTask(lock)) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_GCPARALLEL);
js::oom::SetThreadType(task);
switch (task) {
case js::THREAD_TYPE_GCPARALLEL:
handleGCParallelWorkload(lock);
} else if (HelperThreadState().canStartGCHelperTask(lock)) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_GCHELPER);
break;
case js::THREAD_TYPE_GCHELPER:
handleGCHelperWorkload(lock);
} else if (ionCompile) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_ION);
break;
case js::THREAD_TYPE_ION:
handleIonWorkload(lock);
} else if (HelperThreadState().canStartWasmCompile(lock)) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_WASM);
break;
case js::THREAD_TYPE_WASM:
handleWasmWorkload(lock);
} else if (HelperThreadState().canStartPromiseTask(lock)) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_PROMISE_TASK);
break;
case js::THREAD_TYPE_PROMISE_TASK:
handlePromiseTaskWorkload(lock);
} else if (HelperThreadState().canStartParseTask(lock)) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_PARSE);
break;
case js::THREAD_TYPE_PARSE:
handleParseWorkload(lock);
} else if (HelperThreadState().canStartCompressionTask(lock)) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_COMPRESS);
break;
case js::THREAD_TYPE_COMPRESS:
handleCompressionWorkload(lock);
} else if (HelperThreadState().canStartIonFreeTask(lock)) {
js::oom::SetThreadType(js::oom::THREAD_TYPE_ION_FREE);
break;
case js::THREAD_TYPE_ION_FREE:
handleIonFreeWorkload(lock);
} else {
break;
default:
MOZ_CRASH("No task to perform");
}
js::oom::SetThreadType(js::THREAD_TYPE_NONE);
}
}

View File

@ -146,10 +146,14 @@ class GlobalHelperThreadState
#endif
enum CondVar {
// For notifying threads waiting for work that they may be able to make progress.
// For notifying threads waiting for work that they may be able to make
// progress, ie, a work item has been completed by a helper thread and
// the thread that created the work item can now consume it.
CONSUMER,
// For notifying threads doing work that they may be able to make progress.
// For notifying helper threads doing the work that they may be able to
// make progress, ie, a work item has been enqueued and an idle helper
// thread may pick up up the work item and perform it.
PRODUCER,
// For notifying threads doing work which are paused that they may be
@ -235,10 +239,14 @@ class GlobalHelperThreadState
// Used by a major GC to signal processing enqueued compression tasks.
void startHandlingCompressionTasks(const AutoLockHelperThreadState&);
private:
void scheduleCompressionTasks(const AutoLockHelperThreadState&);
// Unlike the methods above, the value returned by this method can change
// over time, even if the helper thread state lock is held throughout.
public:
// Unlike the public methods above, the value returned by this method can
// change over time, even if the helper thread state lock is held
// throughout.
bool pendingIonCompileHasSufficientPriority(const AutoLockHelperThreadState& lock);
jit::IonBuilder* highestPriorityPendingIonCompile(const AutoLockHelperThreadState& lock,
@ -310,7 +318,7 @@ class GlobalHelperThreadState
void waitForAllThreads();
template <typename T>
bool checkTaskThreadLimit(size_t maxThreads) const;
bool checkTaskThreadLimit(size_t maxThreads, bool isMaster = false) const;
private:

View File

@ -98,7 +98,7 @@ JS::detail::InitWithFailureDiagnostic(bool isDebugBuild)
#if defined(DEBUG) || defined(JS_OOM_BREAKPOINT)
RETURN_IF_FAIL(js::oom::InitThreadType());
js::oom::SetThreadType(js::oom::THREAD_TYPE_COOPERATING);
js::oom::SetThreadType(js::THREAD_TYPE_COOPERATING);
#endif
RETURN_IF_FAIL(js::Mutex::Init());

View File

@ -553,7 +553,7 @@ FrameIter::settleOnActivation()
}
if (activation->isWasm()) {
data_.wasmFrames_ = wasm::FrameIterator(data_.activations_->asWasm());
data_.wasmFrames_ = wasm::WasmFrameIter(data_.activations_->asWasm());
if (data_.wasmFrames_.done()) {
++data_.activations_;
@ -1079,7 +1079,7 @@ FrameIter::wasmUpdateBytecodeOffset()
WasmActivation* activation = data_.activations_->asWasm();
// Relookup the current frame, updating the bytecode offset in the process.
data_.wasmFrames_ = wasm::FrameIterator(activation);
data_.wasmFrames_ = wasm::WasmFrameIter(activation);
while (data_.wasmFrames_.debugFrame() != frame)
++data_.wasmFrames_;

View File

@ -25,7 +25,7 @@
#include "js/RootingAPI.h"
#include "vm/ArgumentsObject.h"
#include "vm/SavedFrame.h"
#include "wasm/WasmFrameIterator.h"
#include "wasm/WasmFrameIter.h"
#include "wasm/WasmTypes.h"
struct JSCompartment;
@ -1767,7 +1767,7 @@ class WasmActivation : public Activation
void* unwindPC() const;
void* resumePC() const;
// Used by wasm::FrameIterator during stack unwinding.
// Used by wasm::WasmFrameIter during stack unwinding.
void unwindExitFP(wasm::Frame* exitFP);
};
@ -1812,7 +1812,7 @@ class FrameIter
jit::JitFrameIterator jitFrames_;
unsigned ionInlineFrameNo_;
wasm::FrameIterator wasmFrames_;
wasm::WasmFrameIter wasmFrames_;
Data(JSContext* cx, DebuggerEvalOption debuggerEvalOption, JSPrincipals* principals);
Data(JSContext* cx, const CooperatingContext& target, DebuggerEvalOption debuggerEvalOption);

View File

@ -102,7 +102,7 @@ WasmHandleDebugTrap()
MOZ_ASSERT(activation);
JSContext* cx = activation->cx();
FrameIterator iter(activation);
WasmFrameIter iter(activation);
MOZ_ASSERT(iter.debugEnabled());
const CallSite* site = iter.debugTrapCallsite();
MOZ_ASSERT(site);
@ -169,18 +169,18 @@ WasmHandleThrow()
WasmActivation* activation = CallingActivation();
JSContext* cx = activation->cx();
// FrameIterator iterates down wasm frames in the activation starting at
// WasmFrameIter iterates down wasm frames in the activation starting at
// WasmActivation::exitFP. Pass Unwind::True to pop WasmActivation::exitFP
// once each time FrameIterator is incremented, ultimately leaving exitFP
// null when the FrameIterator is done(). This is necessary to prevent a
// once each time WasmFrameIter is incremented, ultimately leaving exitFP
// null when the WasmFrameIter is done(). This is necessary to prevent a
// DebugFrame from being observed again after we just called onLeaveFrame
// (which would lead to the frame being re-added to the map of live frames,
// right as it becomes trash).
FrameIterator iter(activation, FrameIterator::Unwind::True);
WasmFrameIter iter(activation, WasmFrameIter::Unwind::True);
MOZ_ASSERT(!iter.done());
// Live wasm code on the stack is kept alive (in wasm::TraceActivations) by
// marking the instance of every wasm::Frame found by FrameIterator.
// marking the instance of every wasm::Frame found by WasmFrameIter.
// However, as explained above, we're popping frames while iterating which
// means that a GC during this loop could collect the code of frames whose
// code is still on the stack. This is actually mostly fine: as soon as we

View File

@ -34,7 +34,6 @@ struct LinkData;
struct LinkDataTier;
struct Metadata;
struct MetadataTier;
class FrameIterator;
// ShareableBytes is a reference-counted Vector of bytes.

View File

@ -16,7 +16,7 @@
* limitations under the License.
*/
#include "wasm/WasmFrameIterator.h"
#include "wasm/WasmFrameIter.h"
#include "wasm/WasmInstance.h"
@ -30,9 +30,9 @@ using mozilla::DebugOnly;
using mozilla::Swap;
/*****************************************************************************/
// FrameIterator implementation
// WasmFrameIter implementation
FrameIterator::FrameIterator()
WasmFrameIter::WasmFrameIter()
: activation_(nullptr),
code_(nullptr),
callsite_(nullptr),
@ -44,7 +44,7 @@ FrameIterator::FrameIterator()
MOZ_ASSERT(done());
}
FrameIterator::FrameIterator(WasmActivation* activation, Unwind unwind)
WasmFrameIter::WasmFrameIter(WasmActivation* activation, Unwind unwind)
: activation_(activation),
code_(nullptr),
callsite_(nullptr),
@ -83,7 +83,7 @@ FrameIterator::FrameIterator(WasmActivation* activation, Unwind unwind)
}
bool
FrameIterator::done() const
WasmFrameIter::done() const
{
MOZ_ASSERT(!!fp_ == !!code_);
MOZ_ASSERT(!!fp_ == !!codeRange_);
@ -91,7 +91,7 @@ FrameIterator::done() const
}
void
FrameIterator::operator++()
WasmFrameIter::operator++()
{
MOZ_ASSERT(!done());
@ -115,7 +115,7 @@ FrameIterator::operator++()
}
void
FrameIterator::popFrame()
WasmFrameIter::popFrame()
{
Frame* prevFP = fp_;
fp_ = prevFP->callerFP;
@ -149,28 +149,28 @@ FrameIterator::popFrame()
}
const char*
FrameIterator::filename() const
WasmFrameIter::filename() const
{
MOZ_ASSERT(!done());
return code_->metadata().filename.get();
}
const char16_t*
FrameIterator::displayURL() const
WasmFrameIter::displayURL() const
{
MOZ_ASSERT(!done());
return code_->metadata().displayURL();
}
bool
FrameIterator::mutedErrors() const
WasmFrameIter::mutedErrors() const
{
MOZ_ASSERT(!done());
return code_->metadata().mutedErrors();
}
JSAtom*
FrameIterator::functionDisplayAtom() const
WasmFrameIter::functionDisplayAtom() const
{
MOZ_ASSERT(!done());
@ -185,7 +185,7 @@ FrameIterator::functionDisplayAtom() const
}
unsigned
FrameIterator::lineOrBytecode() const
WasmFrameIter::lineOrBytecode() const
{
MOZ_ASSERT(!done());
MOZ_ASSERT_IF(!callsite_, activation_->interrupted());
@ -193,14 +193,14 @@ FrameIterator::lineOrBytecode() const
}
Instance*
FrameIterator::instance() const
WasmFrameIter::instance() const
{
MOZ_ASSERT(!done());
return fp_->tls->instance;
}
void**
FrameIterator::unwoundAddressOfReturnAddress() const
WasmFrameIter::unwoundAddressOfReturnAddress() const
{
MOZ_ASSERT(done());
MOZ_ASSERT(unwind_ == Unwind::True);
@ -209,7 +209,7 @@ FrameIterator::unwoundAddressOfReturnAddress() const
}
bool
FrameIterator::debugEnabled() const
WasmFrameIter::debugEnabled() const
{
MOZ_ASSERT(!done());
@ -223,7 +223,7 @@ FrameIterator::debugEnabled() const
}
DebugFrame*
FrameIterator::debugFrame() const
WasmFrameIter::debugFrame() const
{
MOZ_ASSERT(!done());
MOZ_ASSERT(debugEnabled());
@ -231,7 +231,7 @@ FrameIterator::debugFrame() const
}
const CallSite*
FrameIterator::debugTrapCallsite() const
WasmFrameIter::debugTrapCallsite() const
{
MOZ_ASSERT(!done());
MOZ_ASSERT(callsite_);
@ -1009,7 +1009,7 @@ wasm::TraceActivations(JSContext* cx, const CooperatingContext& target, JSTracer
{
for (ActivationIterator iter(cx, target); !iter.done(); ++iter) {
if (iter.activation()->isWasm()) {
for (FrameIterator fi(iter.activation()->asWasm()); !fi.done(); ++fi)
for (WasmFrameIter fi(iter.activation()->asWasm()); !fi.done(); ++fi)
fi.instance()->trace(trc);
}
}

View File

@ -16,8 +16,8 @@
* limitations under the License.
*/
#ifndef wasm_frame_iterator_h
#define wasm_frame_iterator_h
#ifndef wasm_frame_iter_h
#define wasm_frame_iter_h
#include "js/ProfilingFrameIterator.h"
@ -49,7 +49,7 @@ struct CallableOffsets;
// the backtrace may not be correct. That being said, we try our best printing
// an informative message to the user and at least the name of the innermost
// function stack frame.
class FrameIterator
class WasmFrameIter
{
public:
enum class Unwind { True, False };
@ -66,8 +66,8 @@ class FrameIterator
void popFrame();
public:
explicit FrameIterator();
explicit FrameIterator(WasmActivation* activation, Unwind unwind = Unwind::False);
explicit WasmFrameIter();
explicit WasmFrameIter(WasmActivation* activation, Unwind unwind = Unwind::False);
void operator++();
bool done() const;
const char* filename() const;
@ -236,4 +236,4 @@ StartUnwinding(const WasmActivation& activation, const RegisterState& registers,
} // namespace wasm
} // namespace js
#endif // wasm_frame_iterator_h
#endif // wasm_frame_iter_h

View File

@ -6157,6 +6157,7 @@ nsDisplayOpacity::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuil
animationsId,
opacityForSC,
nullptr,
nullptr,
filters);
aManager->CreateWebRenderCommandsFromDisplayList(&mList,
@ -6208,7 +6209,7 @@ nsDisplayBlendMode::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBu
{
nsTArray<mozilla::wr::WrFilterOp> filters;
StackingContextHelper sc(aSc, aBuilder, aDisplayListBuilder, this,
&mList, nullptr, 0, nullptr, nullptr,
&mList, nullptr, 0, nullptr, nullptr, nullptr,
filters, nsCSSRendering::GetGFXBlendMode(mBlendMode));
return nsDisplayWrapList::CreateWebRenderCommands(aBuilder, sc, aParentCommands,
@ -7853,6 +7854,7 @@ nsDisplayTransform::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBu
animationsId,
nullptr,
transformForSC,
nullptr,
filters);
return mStoredList.CreateWebRenderCommands(aBuilder, sc, aParentCommands,
@ -8435,6 +8437,61 @@ nsDisplayPerspective::GetLayerState(nsDisplayListBuilder* aBuilder,
return LAYER_ACTIVE_FORCE;
}
bool
nsDisplayPerspective::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc,
nsTArray<WebRenderParentCommand>& aParentCommands,
WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder)
{
float appUnitsPerPixel = mFrame->PresContext()->AppUnitsPerDevPixel();
Matrix4x4 perspectiveMatrix;
DebugOnly<bool> hasPerspective =
nsDisplayTransform::ComputePerspectiveMatrix(mTransformFrame, appUnitsPerPixel,
perspectiveMatrix);
MOZ_ASSERT(hasPerspective, "Why did we create nsDisplayPerspective?");
/*
* ClipListToRange can remove our child after we were created.
*/
if (!mList.GetChildren()->GetTop()) {
return false;
}
/*
* The resulting matrix is still in the coordinate space of the transformed
* frame. Append a translation to the reference frame coordinates.
*/
nsDisplayTransform* transform =
static_cast<nsDisplayTransform*>(mList.GetChildren()->GetTop());
Point3D newOrigin =
Point3D(NSAppUnitsToFloatPixels(transform->ToReferenceFrame().x, appUnitsPerPixel),
NSAppUnitsToFloatPixels(transform->ToReferenceFrame().y, appUnitsPerPixel),
0.0f);
Point3D roundedOrigin(NS_round(newOrigin.x),
NS_round(newOrigin.y),
0);
gfx::Matrix4x4 transformForSC = gfx::Matrix4x4::Translation(roundedOrigin);
nsTArray<mozilla::wr::WrFilterOp> filters;
StackingContextHelper sc(aSc,
aBuilder,
aDisplayListBuilder,
this,
mList.GetChildren(),
nullptr,
0,
nullptr,
&transformForSC,
&perspectiveMatrix,
filters);
return mList.CreateWebRenderCommands(aBuilder, sc, aParentCommands,
aManager, aDisplayListBuilder);
}
int32_t
nsDisplayPerspective::ZIndex() const
{
@ -9199,6 +9256,7 @@ nsDisplayFilter::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuild
0,
nullptr,
nullptr,
nullptr,
wrFilters);
nsDisplaySVGEffects::CreateWebRenderCommands(aBuilder, sc, aParentCommands, aManager, aDisplayListBuilder);

View File

@ -5094,6 +5094,11 @@ public:
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters) override;
bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
const StackingContextHelper& aSc,
nsTArray<WebRenderParentCommand>& aParentCommands,
mozilla::layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) override;
virtual bool ShouldBuildLayerEvenIfInvisible(nsDisplayListBuilder* aBuilder) override
{

View File

@ -530,6 +530,20 @@ public class CustomTabsActivity extends AppCompatActivity
updateMenuItemForward();
}
@Override
public void onLoadUri(final GeckoView view, final String uriStr,
final TargetWindow where) {
final Uri uri = Uri.parse(uriStr);
if (!TextUtils.isEmpty(mCurrentUrl) &&
Uri.parse(mCurrentUrl).getHost().equals(uri.getHost())) {
view.loadUri(uri);
} else {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(uri);
startActivity(intent);
}
}
/* GeckoView.ProgressListener */
@Override
public void onPageStart(GeckoView view, String url) {

View File

@ -262,4 +262,16 @@ public class WebAppActivity extends AppCompatActivity
@Override
public void onCanGoForward(GeckoView view, boolean canGoForward) {
}
@Override
public void onLoadUri(final GeckoView view, final String uri,
final TargetWindow where) {
if (isInScope(uri)) {
view.loadUri(uri);
} else {
final Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(uri));
startActivity(intent);
}
}
}

View File

@ -3424,9 +3424,22 @@ nsBrowserAccess.prototype = {
return browser;
},
openURI: function browser_openURI(aURI, aOpener, aWhere, aFlags, aTriggeringPrincipal) {
let browser = this._getBrowser(aURI, aOpener, aWhere, aFlags, aTriggeringPrincipal);
return browser ? browser.contentWindow : null;
openURI: function browser_openURI(aURI, aOpener, aWhere, aFlags,
aTriggeringPrincipal) {
if (!aURI) {
throw "Can't open an empty uri";
}
let browser = this._getBrowser(aURI, aOpener, aWhere, aFlags,
aTriggeringPrincipal);
return browser && browser.contentWindow;
},
createContentWindow: function browser_createContentWindow(
aURI, aOpener, aWhere, aFlags,
aTriggeringPrincipal) {
let browser = this._getBrowser(null, aOpener, aWhere, aFlags,
aTriggeringPrincipal);
return browser && browser.contentWindow;
},
openURIInFrame: function browser_openURIInFrame(aURI, aParams, aWhere, aFlags,

View File

@ -128,7 +128,10 @@ public class GeckoView extends LayerView {
private final GeckoViewHandler<NavigationListener> mNavigationHandler =
new GeckoViewHandler<NavigationListener>(
"GeckoViewNavigation", this,
new String[]{ "GeckoView:LocationChange" }
new String[]{
"GeckoView:LocationChange",
"GeckoView:OnLoadUri"
}
) {
@Override
public void handleMessage(final NavigationListener listener,
@ -142,8 +145,13 @@ public class GeckoView extends LayerView {
message.getBoolean("canGoBack"));
listener.onCanGoForward(GeckoView.this,
message.getBoolean("canGoForward"));
} else if ("GeckoView:OnLoadUri".equals(event)) {
final String uri = message.getString("uri");
final NavigationListener.TargetWindow where =
NavigationListener.TargetWindow.get(
message.getInt("where"));
listener.onLoadUri(GeckoView.this, uri, where);
}
}
};
@ -1379,6 +1387,44 @@ public class GeckoView extends LayerView {
* @param canGoForward The new value for the ability.
*/
void onCanGoForward(GeckoView view, boolean canGoForward);
enum TargetWindow {
DEFAULT(0),
CURRENT(1),
NEW(2),
NEWTAB(3),
SWITCHTAB(4);
private static final TargetWindow[] sValues = TargetWindow.values();
private int mValue;
private TargetWindow(int value) {
mValue = value;
}
public static TargetWindow get(int value) {
return sValues[value];
}
}
enum LoadUriResult {
HANDLED(0),
LOAD_IN_FRAME(1);
private int mValue;
private LoadUriResult(int value) {
mValue = value;
}
}
/**
* A request to open an URI.
* @param view The GeckoView that initiated the callback.
* @param uri The URI to be loaded.
* @param where The target window.
*/
void onLoadUri(GeckoView view, String uri, TargetWindow where);
}
/**

View File

@ -267,4 +267,26 @@ public class GeckoViewActivity extends Activity {
prompt.promptForMedia(view, title, video, audio, callback);
}
}
private class Navigation implements GeckoView.NavigationListener {
@Override
public void onLocationChange(GeckoView view, final String url) {
}
@Override
public void onCanGoBack(GeckoView view, boolean canGoBack) {
}
@Override
public void onCanGoForward(GeckoView view, boolean value) {
}
@Override
public void onLoadUri(final GeckoView view, final String uri,
final TargetWindow where) {
Log.d(LOGTAG, "onLoadUriExternal=" + uri +
" where=" + where);
view.loadUri(uri);
}
}
}

View File

@ -70,11 +70,61 @@ class GeckoViewNavigation extends GeckoViewModule {
debug("receiveMessage " + aMsg.name);
}
// nsIBrowserDOMWindow::createContentWindow implementation.
createContentWindow(aUri, aOpener, aWhere, aFlags, aTriggeringPrincipal) {
debug("createContentWindow: aUri=" + (aUri && aUri.spec) +
" aWhere=" + aWhere +
" aFlags=" + aFlags);
if (!aUri) {
throw Cr.NS_ERROR_ABORT;
}
if (aWhere === Ci.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW ||
aWhere === Ci.nsIBrowserDOMWindow.OPEN_CURRENTWINDOW) {
return this.browser.contentWindow;
}
let message = {
type: "GeckoView:OnLoadUri",
uri: aUri.spec,
where: aWhere,
flags: aFlags
};
debug("dispatch " + JSON.stringify(message));
this.eventDispatcher.sendRequest(message);
throw Cr.NS_ERROR_ABORT;
}
// nsIBrowserDOMWindow::openURI implementation.
openURI(aUri, aOpener, aWhere, aFlags) {
debug("openURI: aUri.spec=" + aUri.spec);
// nsIWebNavigation::loadURI(URI, loadFlags, referrer, postData, headers).
this.browser.loadURI(aUri.spec, null, null, null);
openURI(aUri, aOpener, aWhere, aFlags, aTriggeringPrincipal) {
return this.createContentWindow(aUri, aOpener, aWhere, aFlags,
aTriggeringPrincipal);
}
// nsIBrowserDOMWindow::openURIInFrame implementation.
openURIInFrame(aUri, aParams, aWhere, aFlags, aNextTabParentId, aName) {
debug("openURIInFrame: aUri=" + (aUri && aUri.spec) +
" aParams=" + aParams +
" aWhere=" + aWhere +
" aFlags=" + aFlags +
" aNextTabParentId=" + aNextTabParentId +
" aName=" + aName);
if (aWhere === Ci.nsIBrowserDOMWindow.OPEN_DEFAULTWINDOW ||
aWhere === Ci.nsIBrowserDOMWindow.OPEN_CURRENTWINDOW) {
return this.browser.QueryInterface(Ci.nsIFrameLoaderOwner);
}
throw Cr.NS_ERROR_ABORT;
}
isTabContentWindow(aWindow) {
debug("isTabContentWindow " + this.browser.contentWindow === aWindow);
return this.browser.contentWindow === aWindow;
}
// nsIBrowserDOMWindow::canClose implementation.

View File

@ -2,6 +2,7 @@
# 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/.
import errno
import os
import tempfile
import tarfile

View File

@ -1140,4 +1140,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1511109988664000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1511196946849000);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,6 +17,8 @@ only-for-attributes:
- nightly
not-for-build-platforms:
- macosx64-nightly/opt
- win32-nightly/opt
- win64-nightly/opt
- linux-nightly/opt
- linux64-nightly/opt
- macosx64-nightly/opt
- win32-nightly/opt
- win64-nightly/opt

View File

@ -14,6 +14,8 @@ kind-dependencies:
- repackage-signing
only-for-build-platforms:
- linux-nightly/opt
- linux64-nightly/opt
- macosx64-nightly/opt
- win32-nightly/opt
- win64-nightly/opt

View File

@ -16,6 +16,8 @@ only-for-attributes:
- nightly
not-for-build-platforms:
- macosx64-nightly/opt
- win32-nightly/opt
- win64-nightly/opt
- linux-nightly/opt
- linux64-nightly/opt
- macosx64-nightly/opt
- win32-nightly/opt
- win64-nightly/opt

View File

@ -15,6 +15,8 @@ kind-dependencies:
- nightly-l10n-signing
only-for-build-platforms:
- linux-nightly/opt
- linux64-nightly/opt
- macosx64-nightly/opt
- win32-nightly/opt
- win64-nightly/opt

View File

@ -15,6 +15,10 @@ kind-dependencies:
- repackage-l10n
only-for-build-platforms:
- linux-nightly/opt
- linux-devedition-nightly/opt
- linux64-nightly/opt
- linux64-devedition-nightly/opt
- macosx64-nightly/opt
- macosx64-devedition-nightly/opt
- win32-nightly/opt

View File

@ -15,6 +15,10 @@ kind-dependencies:
- build-signing
only-for-build-platforms:
- linux-nightly/opt
- linux-devedition-nightly/opt
- linux64-nightly/opt
- linux64-devedition-nightly/opt
- macosx64-nightly/opt
- macosx64-devedition-nightly/opt
- win32-nightly/opt

View File

@ -16,6 +16,8 @@ from taskgraph.transforms.task import task_description_schema
from voluptuous import Any, Required, Optional
import logging
import re
logger = logging.getLogger(__name__)
@ -63,21 +65,15 @@ _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_L10N = [
# with a beetmover patch in https://github.com/mozilla-releng/beetmoverscript/.
# See example in bug 1348286
UPSTREAM_ARTIFACT_UNSIGNED_PATHS = {
'macosx64-nightly': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US + [
"host/bin/mar",
"host/bin/mbsdiff",
r'^(linux(|64)|macosx64)-nightly$': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US + [
'host/bin/mar',
'host/bin/mbsdiff',
],
'macosx64-nightly-l10n': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_L10N,
'win64-nightly': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US + [
r'^win(32|64)-nightly$': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US + [
"host/bin/mar.exe",
"host/bin/mbsdiff.exe",
],
'win64-nightly-l10n': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_L10N,
'win32-nightly': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_EN_US + [
"host/bin/mar.exe",
"host/bin/mbsdiff.exe",
],
'win32-nightly-l10n': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_L10N,
r'^(linux(|64)|macosx64|win(32|64))-nightly-l10n$': _DESKTOP_UPSTREAM_ARTIFACTS_UNSIGNED_L10N,
}
# Until bug 1331141 is fixed, if you are adding any new artifacts here that
@ -85,10 +81,8 @@ UPSTREAM_ARTIFACT_UNSIGNED_PATHS = {
# with a beetmover patch in https://github.com/mozilla-releng/beetmoverscript/.
# See example in bug 1348286
UPSTREAM_ARTIFACT_SIGNED_PATHS = {
'win64-nightly': ['target.zip'],
'win64-nightly-l10n': ['target.zip'],
'win32-nightly': ['target.zip'],
'win32-nightly-l10n': ['target.zip'],
r'^linux(|64)-nightly(|-l10n)$': ['target.tar.bz2', 'target.tar.bz2.asc'],
r'^win(32|64)-nightly(|-l10n)$': ['target.zip'],
}
# Until bug 1331141 is fixed, if you are adding any new artifacts here that
@ -96,30 +90,32 @@ UPSTREAM_ARTIFACT_SIGNED_PATHS = {
# with a beetmover patch in https://github.com/mozilla-releng/beetmoverscript/.
# See example in bug 1348286
UPSTREAM_ARTIFACT_REPACKAGE_PATHS = {
'macosx64-nightly': ['target.dmg'],
'macosx64-nightly-l10n': ['target.dmg'],
r'^macosx64-nightly(|-l10n)$': ['target.dmg'],
}
# Until bug 1331141 is fixed, if you are adding any new artifacts here that
# need to be transfered to S3, please be aware you also need to follow-up
# with a beetmover patch in https://github.com/mozilla-releng/beetmoverscript/.
# See example in bug 1348286
UPSTREAM_ARTIFACT_SIGNED_REPACKAGE_PATHS = {
'macosx64-nightly': ['target.complete.mar'],
'macosx64-nightly-l10n': ['target.complete.mar'],
'win64-nightly': ['target.complete.mar', 'target.installer.exe'],
'win64-nightly-l10n': ['target.complete.mar', 'target.installer.exe'],
'win32-nightly': [
'target.complete.mar',
'target.installer.exe',
'target.stub-installer.exe'
],
'win32-nightly-l10n': [
r'^(linux(|64)|macosx64)-nightly(|-l10n)$': ['target.complete.mar'],
r'^win64-nightly(|-l10n)$': ['target.complete.mar', 'target.installer.exe'],
r'^win32-nightly(|-l10n)$': [
'target.complete.mar',
'target.installer.exe',
'target.stub-installer.exe'
],
}
# Compile every regex once at import time
for dict_ in (
UPSTREAM_ARTIFACT_UNSIGNED_PATHS, UPSTREAM_ARTIFACT_SIGNED_PATHS,
UPSTREAM_ARTIFACT_REPACKAGE_PATHS, UPSTREAM_ARTIFACT_SIGNED_REPACKAGE_PATHS,
):
for uncompiled_regex, value in dict_.iteritems():
compiled_regex = re.compile(uncompiled_regex)
del dict_[uncompiled_regex]
dict_[compiled_regex] = value
# Voluptuous uses marker objects as dictionary *keys*, but they are not
# comparable, so we cast all of the keys back to regular strings
task_description_schema = {str(k): v for k, v in task_description_schema.schema.iteritems()}
@ -271,18 +267,37 @@ def generate_upstream_artifacts(build_task_ref, build_signing_task_ref,
]
for ref, tasktype, mapping in zip(task_refs, tasktypes, mapping):
if platform in mapping:
upstream_artifacts.append({
"taskId": {"task-reference": ref},
"taskType": tasktype,
"paths": ["{}/{}".format(artifact_prefix, p)
for p in mapping[platform]],
"locale": locale or "en-US",
})
plarform_was_previously_matched_by_regex = None
for platform_regex, paths in mapping.iteritems():
if platform_regex.match(platform) is not None:
_check_platform_matched_only_one_regex(
tasktype, platform, plarform_was_previously_matched_by_regex, platform_regex
)
upstream_artifacts.append({
"taskId": {"task-reference": ref},
"taskType": tasktype,
"paths": ["{}/{}".format(artifact_prefix, path) for path in paths],
"locale": locale or "en-US",
})
plarform_was_previously_matched_by_regex = platform_regex
return upstream_artifacts
def _check_platform_matched_only_one_regex(
task_type, platform, plarform_was_previously_matched_by_regex, platform_regex
):
if plarform_was_previously_matched_by_regex is not None:
raise Exception('In task type "{task_type}", platform "{platform}" matches at \
least 2 regular expressions. First matched: "{first_matched}". Second matched: \
"{second_matched}"'.format(
task_type=task_type, platform=platform,
first_matched=plarform_was_previously_matched_by_regex.pattern,
second_matched=platform_regex.pattern
))
def is_valid_beetmover_job(job):
# windows builds don't have docker-image, so fewer dependencies
if any(b in job['attributes']['build_platform'] for b in _WINDOWS_BUILD_PLATFORMS):

View File

@ -8,6 +8,8 @@ Transform the signing task into an actual task description.
from __future__ import absolute_import, print_function, unicode_literals
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.signed_artifacts import generate_specifications_of_artifacts_to_sign
transforms = TransformSequence()
@ -34,66 +36,26 @@ def add_signed_routes(config, jobs):
@transforms.add
def make_signing_description(config, jobs):
def define_upstream_artifacts(config, jobs):
for job in jobs:
dep_job = job['dependent-task']
build_platform = dep_job.attributes.get('build_platform')
job['upstream-artifacts'] = _generate_upstream_artifacts(
dep_job.attributes.get('build_platform'),
dep_job.attributes.get('nightly')
artifacts_specifications = generate_specifications_of_artifacts_to_sign(
build_platform,
dep_job.attributes.get('nightly'),
keep_locale_template=False
)
if 'android' in build_platform:
# We're in the job that creates both multilocale and en-US APKs
artifacts_specifications[0]['artifacts'].append('public/build/en-US/target.apk')
job['upstream-artifacts'] = [{
'taskId': {'task-reference': '<build>'},
'taskType': 'build',
'paths': spec['artifacts'],
'formats': spec['formats'],
} for spec in artifacts_specifications]
yield job
def _generate_upstream_artifacts(build_platform, is_nightly=False):
if 'android' in build_platform:
artifacts_specificities = [{
'artifacts': [
'public/build/target.apk',
'public/build/en-US/target.apk'
],
'format': 'jar',
}]
# XXX: Mac and Windows don't sign mars because internal aren't signed at
# this stage of the release
elif 'macosx' in build_platform:
artifacts_specificities = [{
'artifacts': ['public/build/target.dmg'],
'format': 'macapp',
}]
elif 'win64' in build_platform:
artifacts_specificities = [{
'artifacts': [
'public/build/target.zip',
'public/build/setup.exe'
],
'format': 'sha2signcode',
}]
elif 'win32' in build_platform:
artifacts_specificities = [{
'artifacts': [
'public/build/target.zip',
'public/build/setup.exe',
],
'format': 'sha2signcode',
}]
if is_nightly:
artifacts_specificities[0]['artifacts'] += ['public/build/setup-stub.exe']
elif 'linux' in build_platform:
artifacts_specificities = [{
'artifacts': ['public/build/target.tar.bz2'],
'format': 'gpg',
}, {
'artifacts': ['public/build/update/target.complete.mar'],
'format': 'mar_sha384',
}]
else:
raise Exception("Platform not implemented for signing")
return [{
'taskId': {'task-reference': '<build>'},
'taskType': 'build',
'paths': specificity['artifacts'],
'formats': [specificity['format']],
} for specificity in artifacts_specificities]

View File

@ -31,6 +31,10 @@ JOB_NAME_WHITELIST = set([
'browser-haz-debug',
'linux-debug',
'linux-devedition',
'linux-devedition-nightly-repackage',
'linux-devedition-nightly-repackage-signing',
'linux-nightly-repackage',
'linux-nightly-repackage-signing',
'linux-opt',
'linux-pgo',
'linux64-add-on-devel',
@ -44,7 +48,11 @@ JOB_NAME_WHITELIST = set([
'linux64-clang-tidy',
'linux64-debug',
'linux64-devedition',
'linux64-devedition-nightly-repackage',
'linux64-devedition-nightly-repackage-signing',
'linux64-jsdcov-opt',
'linux64-nightly-repackage',
'linux64-nightly-repackage-signing',
'linux64-noopt-debug',
'linux64-opt',
'linux64-pgo',

View File

@ -8,6 +8,7 @@ Transform the signing task into an actual task description.
from __future__ import absolute_import, print_function, unicode_literals
from taskgraph.transforms.base import TransformSequence
from taskgraph.util.signed_artifacts import generate_specifications_of_artifacts_to_sign
from taskgraph.util.treeherder import join_symbol
transforms = TransformSequence()
@ -19,72 +20,6 @@ def make_signing_description(config, jobs):
job['depname'] = 'unsigned-repack'
dep_job = job['dependent-task']
dep_platform = dep_job.attributes.get('build_platform')
job['upstream-artifacts'] = []
if 'android' in dep_platform:
job_specs = [
{
'artifacts': ['public/build/{locale}/target.apk'],
'format': 'jar',
},
]
elif 'macosx' in dep_platform:
job_specs = [
{
'artifacts': ['public/build/{locale}/target.dmg'],
'format': 'macapp',
}
]
elif 'win32' in dep_platform:
job_specs = [
{
'artifacts': [
'public/build/{locale}/target.zip',
'public/build/{locale}/setup.exe',
'public/build/{locale}/setup-stub.exe'
],
'format': 'sha2signcode',
}
]
elif 'win64' in dep_platform:
job_specs = [
{
'artifacts': [
'public/build/{locale}/target.zip',
'public/build/{locale}/setup.exe',
],
'format': 'sha2signcode',
}
]
elif 'linux' in dep_platform:
job_specs = [
{
'artifacts': ['public/build/{locale}/target.tar.bz2'],
'format': 'gpg',
}, {
'artifacts': ['public/build/{locale}/target.complete.mar'],
'format': 'mar_sha384',
}
]
else:
raise Exception("Platform not implemented for signing")
upstream_artifacts = []
for spec in job_specs:
fmt = spec['format']
upstream_artifacts.append({
"taskId": {"task-reference": "<unsigned-repack>"},
"taskType": "l10n",
# Set paths based on artifacts in the specs (above) one per
# locale present in the chunk this is signing stuff for.
"paths": [f.format(locale=l)
for l in dep_job.attributes.get('chunk_locales', [])
for f in spec['artifacts']],
"formats": [fmt]
})
job['upstream-artifacts'] = upstream_artifacts
# add the chunk number to the TH symbol
symbol = 'Ns{}'.format(dep_job.attributes.get('l10n_chunk'))
@ -95,3 +30,34 @@ def make_signing_description(config, jobs):
}
yield job
@transforms.add
def define_upstream_artifacts(config, jobs):
for job in jobs:
dep_job = job['dependent-task']
locale_specifications = generate_specifications_of_artifacts_to_sign(
dep_job.attributes.get('build_platform'),
is_nightly=True,
keep_locale_template=True
)
upstream_artifacts = []
for spec in locale_specifications:
upstream_artifacts.append({
'taskId': {'task-reference': '<unsigned-repack>'},
'taskType': 'l10n',
# Set paths based on artifacts in the specs (above) one per
# locale present in the chunk this is signing stuff for.
'paths': [
path_template.format(locale=locale)
for locale in dep_job.attributes.get('chunk_locales', [])
for path_template in spec['artifacts']
],
'formats': spec['formats']
})
job['upstream-artifacts'] = upstream_artifacts
yield job

View File

@ -148,8 +148,15 @@ def make_job_description(config, jobs):
if build_platform.startswith('win'):
worker_type = 'aws-provisioner-v1/gecko-%s-b-win2012' % level
run['use-magic-mh-args'] = False
elif build_platform.startswith('macosx'):
worker_type = 'aws-provisioner-v1/gecko-%s-b-macosx64' % level
else:
if build_platform.startswith('macosx'):
worker_type = 'aws-provisioner-v1/gecko-%s-b-macosx64' % level
elif build_platform.startswith('linux'):
worker_type = 'aws-provisioner-v1/gecko-%s-b-linux' % level
else:
raise NotImplementedError(
'Unsupported build_platform: "{}"'.format(build_platform)
)
run['tooltool-downloads'] = 'internal'
worker['docker-image'] = {"in-tree": "desktop-build"}
@ -185,20 +192,26 @@ def make_job_description(config, jobs):
def _generate_task_mozharness_config(build_platform):
if build_platform.startswith('macosx'):
return ['repackage/osx_signed.py']
elif build_platform.startswith('win'):
return ['repackage/win32_signed.py'] if '32' in build_platform \
else ['repackage/win64_signed.py']
else:
raise NotImplemented('Unsupported build_platform: "{}"'.format(build_platform))
bits = 32 if '32' in build_platform else 64
if build_platform.startswith('linux'):
return ['repackage/linux{}_signed.py'.format(bits)]
elif build_platform.startswith('win'):
return ['repackage/win{}_signed.py'.format(bits)]
raise NotImplementedError('Unsupported build_platform: "{}"'.format(build_platform))
def _generate_task_env(build_platform, build_task_ref, signing_task_ref, locale=None):
mar_prefix = _generate_taskcluster_prefix(build_task_ref, postfix='host/bin/', locale=None)
signed_prefix = _generate_taskcluster_prefix(signing_task_ref, locale=locale)
if build_platform.startswith('macosx'):
if build_platform.startswith('linux') or build_platform.startswith('macosx'):
tarball_extension = 'bz2' if build_platform.startswith('linux') else 'gz'
return {
'SIGNED_INPUT': {'task-reference': '{}target.tar.gz'.format(signed_prefix)},
'SIGNED_INPUT': {'task-reference': '{}target.tar.{}'.format(
signed_prefix, tarball_extension
)},
'UNSIGNED_MAR': {'task-reference': '{}mar'.format(mar_prefix)},
}
elif build_platform.startswith('win'):
@ -215,8 +228,7 @@ def _generate_task_env(build_platform, build_task_ref, signing_task_ref, locale=
}
return task_env
else:
raise NotImplemented('Unsupported build_platform: "{}"'.format(build_platform))
raise NotImplementedError('Unsupported build_platform: "{}"'.format(build_platform))
def _generate_taskcluster_prefix(task_id, postfix='', locale=None):
@ -228,18 +240,23 @@ def _generate_taskcluster_prefix(task_id, postfix='', locale=None):
def _generate_task_output_files(build_platform, locale=None):
locale_output_path = '{}/'.format(locale) if locale else ''
if build_platform.startswith('macosx'):
return [{
'type': 'file',
'path': '/home/worker/workspace/build/artifacts/{}target.dmg'
.format(locale_output_path),
'name': 'public/build/{}target.dmg'.format(locale_output_path),
}, {
if build_platform.startswith('linux') or build_platform.startswith('macosx'):
output_files = [{
'type': 'file',
'path': '/home/worker/workspace/build/artifacts/{}target.complete.mar'
.format(locale_output_path),
'name': 'public/build/{}target.complete.mar'.format(locale_output_path),
}]
if build_platform.startswith('macosx'):
output_files.append({
'type': 'file',
'path': '/home/worker/workspace/build/artifacts/{}target.dmg'
.format(locale_output_path),
'name': 'public/build/{}target.dmg'.format(locale_output_path),
})
elif build_platform.startswith('win'):
output_files = [{
'type': 'file',
@ -259,6 +276,7 @@ def _generate_task_output_files(build_platform, locale=None):
'name': 'public/build/{}target.stub-installer.exe'.format(locale_output_path),
})
if output_files:
return output_files
else:
raise NotImplemented('Unsupported build_platform: "{}"'.format(build_platform))
raise NotImplementedError('Unsupported build_platform: "{}"'.format(build_platform))

View File

@ -130,6 +130,8 @@ def make_repackage_signing_description(config, jobs):
}
funsize_platforms = [
'linux-nightly',
'linux64-nightly',
'macosx64-nightly',
'win32-nightly',
'win64-nightly'

View File

@ -136,11 +136,6 @@ def make_task_description(config, jobs):
'routes': job.get('routes', []),
}
if 'linux' in dep_job.attributes.get('build_platform') and \
dep_job.attributes.get('nightly'):
task['routes'].append("project.releng.funsize.level-{level}.{project}".format(
project=config.params['project'], level=config.params['level']))
yield task

View File

@ -0,0 +1,61 @@
# 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/.
"""
Defines artifacts to sign before repackage.
"""
def generate_specifications_of_artifacts_to_sign(
build_platform, is_nightly=False, keep_locale_template=True
):
if 'android' in build_platform:
artifacts_specifications = [{
'artifacts': [
'public/build/{locale}/target.apk',
],
'formats': ['jar'],
}]
# XXX: Mars aren't signed here (on any platform) because internals will be
# signed at after this stage of the release
elif 'macosx' in build_platform:
artifacts_specifications = [{
'artifacts': ['public/build/{locale}/target.dmg'],
'formats': ['macapp', 'widevine'],
}]
elif 'win' in build_platform:
artifacts_specifications = [{
'artifacts': [
'public/build/{locale}/setup.exe',
],
'formats': ['sha2signcode'],
}, {
'artifacts': [
'public/build/{locale}/target.zip',
],
'formats': ['sha2signcode', 'widevine'],
}]
if 'win32' in build_platform and is_nightly:
artifacts_specifications[0]['artifacts'] += ['public/build/{locale}/setup-stub.exe']
elif 'linux' in build_platform:
artifacts_specifications = [{
'artifacts': ['public/build/{locale}/target.tar.bz2'],
'formats': ['gpg', 'widevine'],
}]
else:
raise Exception("Platform not implemented for signing")
if not keep_locale_template:
artifacts_specifications = _strip_locale_template(artifacts_specifications)
return artifacts_specifications
def _strip_locale_template(artifacts_without_locales):
for spec in artifacts_without_locales:
for index, artifact in enumerate(spec['artifacts']):
stripped_artifact = artifact.format(locale='')
stripped_artifact = stripped_artifact.replace('//', '/')
spec['artifacts'][index] = stripped_artifact
return artifacts_without_locales

View File

@ -0,0 +1,30 @@
import os
platform = "linux32"
config = {
"input_home": "{abs_work_dir}/inputs",
"output_home": "{abs_work_dir}/artifacts{locale}",
"locale": os.environ.get("LOCALE"),
"download_config": {
"target.tar.gz": os.environ.get("SIGNED_INPUT"),
"mar": os.environ.get("UNSIGNED_MAR"),
},
"repackage_config": [[
"mar",
"-i", "{abs_work_dir}/inputs/target.tar.gz",
"--mar", "{abs_work_dir}/inputs/mar",
"-o", "{output_home}/target.complete.mar"
]],
# ToolTool
"tooltool_manifest_src": 'browser/config/tooltool-manifests/{}/releng.manifest'.format(platform),
"tooltool_url": 'http://relengapi/tooltool/',
'tooltool_script': ["/builds/tooltool.py"],
'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
'run_configure': False,
}

View File

@ -0,0 +1,30 @@
import os
platform = "linux64"
config = {
"input_home": "{abs_work_dir}/inputs",
"output_home": "{abs_work_dir}/artifacts{locale}",
"locale": os.environ.get("LOCALE"),
"download_config": {
"target.tar.gz": os.environ.get("SIGNED_INPUT"),
"mar": os.environ.get("UNSIGNED_MAR"),
},
"repackage_config": [[
"mar",
"-i", "{abs_work_dir}/inputs/target.tar.gz",
"--mar", "{abs_work_dir}/inputs/mar",
"-o", "{output_home}/target.complete.mar"
]],
# ToolTool
"tooltool_manifest_src": 'browser/config/tooltool-manifests/{}/releng.manifest'.format(platform),
"tooltool_url": 'http://relengapi/tooltool/',
'tooltool_script': ["/builds/tooltool.py"],
'tooltool_cache': os.environ.get('TOOLTOOL_CACHE'),
'run_configure': False,
}

View File

@ -32,7 +32,6 @@ repackage_config = [[
config = {
"input_home": "{abs_work_dir}\\inputs",
"output_home": "{base_work_dir}\\public\\build{locale}",
"src_mozconfig": "browser/config/mozconfigs/{}/repack".format(platform),
"locale": os.environ.get("LOCALE"),

View File

@ -25,7 +25,6 @@ repackage_config = [[
config = {
"input_home": "{abs_work_dir}\\inputs",
"output_home": "{base_work_dir}\\public\\build{locale}",
"src_mozconfig": "browser/config/mozconfigs/{}/repack".format(platform),
"locale": os.environ.get("LOCALE"),

View File

@ -923,16 +923,15 @@ nsContentTreeOwner::ProvideWindow(mozIDOMWindowProxy* aParent,
flags |= nsIBrowserDOMWindow::OPEN_NO_OPENER;
}
// Get a new rendering area from the browserDOMWin. We don't want
// to be starting any loads here, so get it with a null URI. Since/
// we are not loading any URI, we follow the principle of least privlege
// and use a nullPrincipal as the triggeringPrincipal.
// Get a new rendering area from the browserDOMWin.
// Since we are not loading any URI, we follow the principle of least
// privilege and use a nullPrincipal as the triggeringPrincipal.
//
// This method handles setting the opener for us, so we don't need to set it
// ourselves.
RefPtr<NullPrincipal> nullPrincipal = NullPrincipal::Create();
return browserDOMWin->OpenURI(nullptr, aParent, openLocation,
flags, nullPrincipal, aReturn);
return browserDOMWin->CreateContentWindow(aURI, aParent, openLocation,
flags, nullPrincipal, aReturn);
}
}