Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2020-03-05 09:48:44 +08:00
commit bd46990741
22 changed files with 53 additions and 883 deletions

View file

@ -1332,10 +1332,6 @@ pref("signon.schemeUpgrades", true);
#if defined(NIGHTLY_BUILD) #if defined(NIGHTLY_BUILD)
pref("print.use_simplify_page", true); pref("print.use_simplify_page", true);
#endif #endif
#else
#if defined(EARLY_BETA_OR_EARLIER)
pref("print.use_simplify_page", true);
#endif
#endif #endif
// Space separated list of URLS that are allowed to send objects (instead of // Space separated list of URLS that are allowed to send objects (instead of
@ -1345,11 +1341,7 @@ pref("webchannel.allowObject.urlWhitelist", "https://accounts.firefox.com https:
// Whether or not the browser should scan for unsubmitted // Whether or not the browser should scan for unsubmitted
// crash reports, and then show a notification for submitting // crash reports, and then show a notification for submitting
// those reports. // those reports.
#ifdef EARLY_BETA_OR_EARLIER
pref("browser.crashReports.unsubmittedCheck.enabled", true);
#else
pref("browser.crashReports.unsubmittedCheck.enabled", false); pref("browser.crashReports.unsubmittedCheck.enabled", false);
#endif
// chancesUntilSuppress is how many times we'll show the unsubmitted // chancesUntilSuppress is how many times we'll show the unsubmitted
// crash report notification across different days and shutdown // crash report notification across different days and shutdown

View file

@ -235,7 +235,7 @@
@RESPATH@/components/jar.xpt @RESPATH@/components/jar.xpt
@RESPATH@/components/jsdebugger.xpt @RESPATH@/components/jsdebugger.xpt
@RESPATH@/components/jsdownloads.xpt @RESPATH@/components/jsdownloads.xpt
;@RESPATH@/browser/components/jsinspector.xpt @RESPATH@/components/jsinspector.xpt
@RESPATH@/components/layout_base.xpt @RESPATH@/components/layout_base.xpt
#ifdef NS_PRINTING #ifdef NS_PRINTING
@RESPATH@/components/layout_printing.xpt @RESPATH@/components/layout_printing.xpt

View file

@ -85,6 +85,12 @@
name="playbackrate" name="playbackrate"
checked="true" checked="true"
oncommand="gContextMenu.mediaCommand('playbackRate', 1.0);"/> oncommand="gContextMenu.mediaCommand('playbackRate', 1.0);"/>
<menuitem id="context-media-playbackrate-125x"
label="&mediaPlaybackRate125x.label;"
accesskey="&mediaPlaybackRate125x.accesskey;"
type="radio"
name="playbackrate"
oncommand="gContextMenu.mediaCommand('playbackRate', 1.25);"/>
<menuitem id="context-media-playbackrate-150x" <menuitem id="context-media-playbackrate-150x"
label="&mediaPlaybackRate150x.label;" label="&mediaPlaybackRate150x.label;"
accesskey="&mediaPlaybackRate150x.accesskey;" accesskey="&mediaPlaybackRate150x.accesskey;"

View file

@ -393,6 +393,7 @@ nsContextMenu.prototype = {
if (onMedia) { if (onMedia) {
this.setItemAttr("context-media-playbackrate-050x", "checked", this.target.playbackRate == 0.5); this.setItemAttr("context-media-playbackrate-050x", "checked", this.target.playbackRate == 0.5);
this.setItemAttr("context-media-playbackrate-100x", "checked", this.target.playbackRate == 1.0); this.setItemAttr("context-media-playbackrate-100x", "checked", this.target.playbackRate == 1.0);
this.setItemAttr("context-media-playbackrate-125x", "checked", this.target.playbackRate == 1.25);
this.setItemAttr("context-media-playbackrate-150x", "checked", this.target.playbackRate == 1.5); this.setItemAttr("context-media-playbackrate-150x", "checked", this.target.playbackRate == 1.5);
this.setItemAttr("context-media-playbackrate-200x", "checked", this.target.playbackRate == 2.0); this.setItemAttr("context-media-playbackrate-200x", "checked", this.target.playbackRate == 2.0);
this.setItemAttr("context-media-loop", "checked", this.target.loop); this.setItemAttr("context-media-loop", "checked", this.target.loop);
@ -405,6 +406,7 @@ nsContextMenu.prototype = {
this.setItemAttr("context-media-playbackrate", "disabled", hasError); this.setItemAttr("context-media-playbackrate", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-050x", "disabled", hasError); this.setItemAttr("context-media-playbackrate-050x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-100x", "disabled", hasError); this.setItemAttr("context-media-playbackrate-100x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-125x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-150x", "disabled", hasError); this.setItemAttr("context-media-playbackrate-150x", "disabled", hasError);
this.setItemAttr("context-media-playbackrate-200x", "disabled", hasError); this.setItemAttr("context-media-playbackrate-200x", "disabled", hasError);
this.setItemAttr("context-media-showcontrols", "disabled", hasError); this.setItemAttr("context-media-showcontrols", "disabled", hasError);

View file

@ -423,6 +423,8 @@ items are mutually exclusive. -->
<!ENTITY mediaPlaybackRate050x.accesskey "S"> <!ENTITY mediaPlaybackRate050x.accesskey "S">
<!ENTITY mediaPlaybackRate100x.label "Normal Speed"> <!ENTITY mediaPlaybackRate100x.label "Normal Speed">
<!ENTITY mediaPlaybackRate100x.accesskey "N"> <!ENTITY mediaPlaybackRate100x.accesskey "N">
<!ENTITY mediaPlaybackRate125x.label "Increased Speed (1.25×)">
<!ENTITY mediaPlaybackRate125x.accesskey "I">
<!ENTITY mediaPlaybackRate150x.label "High Speed (1.5×)"> <!ENTITY mediaPlaybackRate150x.label "High Speed (1.5×)">
<!ENTITY mediaPlaybackRate150x.accesskey "H"> <!ENTITY mediaPlaybackRate150x.accesskey "H">
<!-- LOCALIZATION NOTE: "Ludicrous Speed" is a reference to the <!-- LOCALIZATION NOTE: "Ludicrous Speed" is a reference to the

View file

@ -1,3 +0,0 @@
# Define indicating that this build is prior to one of the early betas. To be
# unset mid-way through the beta cycle.
EARLY_BETA_OR_EARLIER=

View file

@ -166,6 +166,7 @@ def old_configure_options(*options):
'--enable-cookies', '--enable-cookies',
'--enable-cpp-rtti', '--enable-cpp-rtti',
'--enable-crashreporter', '--enable-crashreporter',
'--enable-dbm',
'--enable-dbus', '--enable-dbus',
'--enable-debug-js-modules', '--enable-debug-js-modules',
'--enable-jetpack', '--enable-jetpack',

View file

@ -3,9 +3,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
if not CONFIG['NSS_DISABLE_DBM'] and CONFIG['MOZ_MORK']: DIRS += [
DIRS += [
'public', 'public',
'src', 'src',
'build', 'build',
] ]

View file

@ -75,7 +75,7 @@ if CONFIG['MOZ_MAILNEWS_OAUTH2']:
EXTRA_COMPONENTS += ['msgOAuth2Module.js'] EXTRA_COMPONENTS += ['msgOAuth2Module.js']
EXTRA_PP_COMPONENTS += [ EXTRA_PP_COMPONENTS += [
'msgBase.manifest' 'msgBase.manifest',
'nsMailNewsCommandLineHandler.js', 'nsMailNewsCommandLineHandler.js',
] ]

View file

@ -1,16 +0,0 @@
# vim: set filetype=python:
# 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/.
if CONFIG['MOZ_LDAP_XPCOM']:
DIRS += [
'/ldap',
'/ldap/xpcom',
]
if CONFIG['MOZ_MORK']:
DIRS += ['/db']
DIRS += ['/mailnews']

View file

@ -760,15 +760,7 @@ static int ShouldDrop(size_t len) {
nr_socket_short_term_violation_time = TimeStamp::Now(); nr_socket_short_term_violation_time = TimeStamp::Now();
#endif #endif
// Bug 1013007
#if !EARLY_BETA_OR_EARLIER
return R_WOULDBLOCK; return R_WOULDBLOCK;
#else
MOZ_ASSERT(false,
"Short term global rate limit for STUN requests exceeded. Go "
"bug bcampen@mozilla.com if you weren't intentionally "
"spamming ICE candidates, or don't know what that means.");
#endif
} }
if (sustained.getTokens(UINT32_MAX) < len) { if (sustained.getTokens(UINT32_MAX) < len) {
@ -777,15 +769,8 @@ static int ShouldDrop(size_t len) {
#ifdef MOZILLA_INTERNAL_API #ifdef MOZILLA_INTERNAL_API
nr_socket_long_term_violation_time = TimeStamp::Now(); nr_socket_long_term_violation_time = TimeStamp::Now();
#endif #endif
// Bug 1013007
#if !EARLY_BETA_OR_EARLIER
return R_WOULDBLOCK; return R_WOULDBLOCK;
#else
MOZ_ASSERT(false,
"Long term global rate limit for STUN requests exceeded. Go "
"bug bcampen@mozilla.com if you weren't intentionally "
"spamming ICE candidates, or don't know what that means.");
#endif
} }
// Take len tokens from both buckets. // Take len tokens from both buckets.

View file

@ -2168,6 +2168,7 @@ MOZ_PLACES=1
MOZ_SERVICES_HEALTHREPORT=1 MOZ_SERVICES_HEALTHREPORT=1
MOZ_SERVICES_SYNC=1 MOZ_SERVICES_SYNC=1
MOZ_USERINFO=1 MOZ_USERINFO=1
NSS_DISABLE_DBM=
MOZ_MAILNEWS= MOZ_MAILNEWS=
MOZ_MAILNEWS_OAUTH2= MOZ_MAILNEWS_OAUTH2=
MOZ_LDAP_XPCOM= MOZ_LDAP_XPCOM=
@ -2236,19 +2237,6 @@ else
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
fi fi
# Allow influencing configure with a defines.sh script.
. "${srcdir}/build/defines.sh"
# If we're not building a release build, define EARLY_BETA_OR_EARLIER if it is
# set in defines.sh
if test "$BUILDING_RELEASE"; then
# Override value in defines.sh, if any
EARLY_BETA_OR_EARLIER=
elif test "$EARLY_BETA_OR_EARLIER"; then
AC_DEFINE(EARLY_BETA_OR_EARLIER)
fi
AC_SUBST(EARLY_BETA_OR_EARLIER)
# Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
MOZ_ARG_WITH_STRING(app-name, MOZ_ARG_WITH_STRING(app-name,
[--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME], [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
@ -2721,6 +2709,22 @@ x86_64 | arm | aarch64 | x86 | ppc* | ia64)
esac esac
dnl =========================================================
dnl = NSS DBM (BerkeleyDB) Support
dnl = NOTE: Because we don't expressly control the name of
dnl = this var --disable-dbm means NSS_DISABLE_DBM=1
dnl =========================================================
MOZ_ARG_DISABLE_BOOL(dbm,
[ --disable-dbm Disable DBM support in nss],
NSS_DISABLE_DBM=1,
NSS_DISABLE_DBM=)
if test -n "$NSS_DISABLE_DBM"; then
AC_DEFINE(NSS_DISABLE_DBM)
fi
AC_SUBST(NSS_DISABLE_DBM)
dnl ========================================================= dnl =========================================================
dnl = Don't fold mailnews related comps into libXUL dnl = Don't fold mailnews related comps into libXUL
dnl ========================================================= dnl =========================================================

View file

@ -1,199 +0,0 @@
/*
* Copyright 2008, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// must include config.h first for webkit to fiddle with new/delete
#include "SkANP.h"
#include "SkRect.h"
static ANPCanvas* anp_newCanvas(const ANPBitmap* bitmap) {
SkBitmap bm;
return new ANPCanvas(*SkANP::SetBitmap(&bm, *bitmap));
}
static void anp_deleteCanvas(ANPCanvas* canvas) {
delete canvas;
}
static void anp_save(ANPCanvas* canvas) {
canvas->skcanvas->save();
}
static void anp_restore(ANPCanvas* canvas) {
canvas->skcanvas->restore();
}
static void anp_translate(ANPCanvas* canvas, float tx, float ty) {
canvas->skcanvas->translate(SkFloatToScalar(tx), SkFloatToScalar(ty));
}
static void anp_scale(ANPCanvas* canvas, float sx, float sy) {
canvas->skcanvas->scale(SkFloatToScalar(sx), SkFloatToScalar(sy));
}
static void anp_rotate(ANPCanvas* canvas, float degrees) {
canvas->skcanvas->rotate(SkFloatToScalar(degrees));
}
static void anp_skew(ANPCanvas* canvas, float kx, float ky) {
canvas->skcanvas->skew(SkFloatToScalar(kx), SkFloatToScalar(ky));
}
static void anp_clipRect(ANPCanvas* canvas, const ANPRectF* rect) {
SkRect r;
canvas->skcanvas->clipRect(*SkANP::SetRect(&r, *rect));
}
static void anp_clipPath(ANPCanvas* canvas, const ANPPath* path) {
canvas->skcanvas->clipPath(*path);
}
static void anp_concat(ANPCanvas* canvas, const ANPMatrix* matrix) {
canvas->skcanvas->concat(*matrix);
}
static void anp_getTotalMatrix(ANPCanvas* canvas, ANPMatrix* matrix) {
const SkMatrix& src = canvas->skcanvas->getTotalMatrix();
*matrix = *reinterpret_cast<const ANPMatrix*>(&src);
}
static bool anp_getLocalClipBounds(ANPCanvas* canvas, ANPRectF* r,
bool antialias) {
SkRect bounds;
if (canvas->skcanvas->getClipBounds(&bounds)) {
SkANP::SetRect(r, bounds);
return true;
}
return false;
}
static bool anp_getDeviceClipBounds(ANPCanvas* canvas, ANPRectI* r) {
SkIRect bounds;
if (canvas->skcanvas->getClipDeviceBounds(&bounds)) {
SkANP::SetRect(r, bounds);
return true;
}
return false;
}
static void anp_drawColor(ANPCanvas* canvas, ANPColor color) {
canvas->skcanvas->drawColor(color);
}
static void anp_drawPaint(ANPCanvas* canvas, const ANPPaint* paint) {
canvas->skcanvas->drawPaint(*paint);
}
static void anp_drawLine(ANPCanvas* canvas, float x0, float y0,
float x1, float y1, const ANPPaint* paint) {
canvas->skcanvas->drawLine(SkFloatToScalar(x0), SkFloatToScalar(y0),
SkFloatToScalar(x1), SkFloatToScalar(y1), *paint);
}
static void anp_drawRect(ANPCanvas* canvas, const ANPRectF* rect,
const ANPPaint* paint) {
SkRect r;
canvas->skcanvas->drawRect(*SkANP::SetRect(&r, *rect), *paint);
}
static void anp_drawOval(ANPCanvas* canvas, const ANPRectF* rect,
const ANPPaint* paint) {
SkRect r;
canvas->skcanvas->drawOval(*SkANP::SetRect(&r, *rect), *paint);
}
static void anp_drawPath(ANPCanvas* canvas, const ANPPath* path,
const ANPPaint* paint) {
canvas->skcanvas->drawPath(*path, *paint);
}
static void anp_drawText(ANPCanvas* canvas, const void* text, uint32_t length,
float x, float y, const ANPPaint* paint) {
canvas->skcanvas->drawText(text, length,
SkFloatToScalar(x), SkFloatToScalar(y),
*paint);
}
static void anp_drawPosText(ANPCanvas* canvas, const void* text,
uint32_t byteLength, const float xy[], const ANPPaint* paint) {
canvas->skcanvas->drawPosText(text, byteLength,
reinterpret_cast<const SkPoint*>(xy), *paint);
}
static void anp_drawBitmap(ANPCanvas* canvas, const ANPBitmap* bitmap,
float x, float y, const ANPPaint* paint) {
SkBitmap bm;
canvas->skcanvas->drawBitmap(*SkANP::SetBitmap(&bm, *bitmap),
SkFloatToScalar(x), SkFloatToScalar(y),
paint);
}
static void anp_drawBitmapRect(ANPCanvas* canvas, const ANPBitmap* bitmap,
const ANPRectI* src, const ANPRectF* dst,
const ANPPaint* paint) {
SkBitmap bm;
SkRect dstR;
SkIRect srcR;
if (src) {
canvas->skcanvas->drawBitmapRect(*SkANP::SetBitmap(&bm, *bitmap),
*SkANP::SetRect(&srcR, *src),
*SkANP::SetRect(&dstR, *dst),
paint);
} else {
canvas->skcanvas->drawBitmapRect(*SkANP::SetBitmap(&bm, *bitmap),
*SkANP::SetRect(&dstR, *dst),
paint);
}
}
///////////////////////////////////////////////////////////////////////////////
#define ASSIGN(obj, name) (obj)->name = anp_##name
void InitCanvasInterface(ANPCanvasInterfaceV0* i) {
ASSIGN(i, newCanvas);
ASSIGN(i, deleteCanvas);
ASSIGN(i, save);
ASSIGN(i, restore);
ASSIGN(i, translate);
ASSIGN(i, scale);
ASSIGN(i, rotate);
ASSIGN(i, skew);
ASSIGN(i, clipRect);
ASSIGN(i, clipPath);
ASSIGN(i, concat);
ASSIGN(i, getTotalMatrix);
ASSIGN(i, getLocalClipBounds);
ASSIGN(i, getDeviceClipBounds);
ASSIGN(i, drawColor);
ASSIGN(i, drawPaint);
ASSIGN(i, drawLine);
ASSIGN(i, drawRect);
ASSIGN(i, drawOval);
ASSIGN(i, drawPath);
ASSIGN(i, drawText);
ASSIGN(i, drawPosText);
ASSIGN(i, drawBitmap);
ASSIGN(i, drawBitmapRect);
}

View file

@ -1,208 +0,0 @@
/*
* Copyright 2008, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// must include config.h first for webkit to fiddle with new/delete
#include "SkANP.h"
static ANPPaint* anp_newPaint() {
return new ANPPaint;
}
static void anp_deletePaint(ANPPaint* paint) {
delete paint;
}
static ANPPaintFlags anp_getFlags(const ANPPaint* paint) {
return paint->getFlags();
}
static void anp_setFlags(ANPPaint* paint, ANPPaintFlags flags) {
paint->setFlags(flags);
}
static ANPColor anp_getColor(const ANPPaint* paint) {
return paint->getColor();
}
static void anp_setColor(ANPPaint* paint, ANPColor color) {
paint->setColor(color);
}
static ANPPaintStyle anp_getStyle(const ANPPaint* paint) {
return paint->getStyle();
}
static void anp_setStyle(ANPPaint* paint, ANPPaintStyle style) {
paint->setStyle(static_cast<SkPaint::Style>(style));
}
static float anp_getStrokeWidth(const ANPPaint* paint) {
return SkScalarToFloat(paint->getStrokeWidth());
}
static float anp_getStrokeMiter(const ANPPaint* paint) {
return SkScalarToFloat(paint->getStrokeMiter());
}
static ANPPaintCap anp_getStrokeCap(const ANPPaint* paint) {
return paint->getStrokeCap();
}
static ANPPaintJoin anp_getStrokeJoin(const ANPPaint* paint) {
return paint->getStrokeJoin();
}
static void anp_setStrokeWidth(ANPPaint* paint, float width) {
paint->setStrokeWidth(SkFloatToScalar(width));
}
static void anp_setStrokeMiter(ANPPaint* paint, float miter) {
paint->setStrokeMiter(SkFloatToScalar(miter));
}
static void anp_setStrokeCap(ANPPaint* paint, ANPPaintCap cap) {
paint->setStrokeCap(static_cast<SkPaint::Cap>(cap));
}
static void anp_setStrokeJoin(ANPPaint* paint, ANPPaintJoin join) {
paint->setStrokeJoin(static_cast<SkPaint::Join>(join));
}
static ANPTextEncoding anp_getTextEncoding(const ANPPaint* paint) {
return paint->getTextEncoding();
}
static ANPPaintAlign anp_getTextAlign(const ANPPaint* paint) {
return paint->getTextAlign();
}
static float anp_getTextSize(const ANPPaint* paint) {
return SkScalarToFloat(paint->getTextSize());
}
static float anp_getTextScaleX(const ANPPaint* paint) {
return SkScalarToFloat(paint->getTextScaleX());
}
static float anp_getTextSkewX(const ANPPaint* paint) {
return SkScalarToFloat(paint->getTextSkewX());
}
static ANPTypeface* anp_getTypeface(const ANPPaint* paint) {
return reinterpret_cast<ANPTypeface*>(paint->getTypeface());
}
static void anp_setTextEncoding(ANPPaint* paint, ANPTextEncoding encoding) {
paint->setTextEncoding(static_cast<SkPaint::TextEncoding>(encoding));
}
static void anp_setTextAlign(ANPPaint* paint, ANPPaintAlign align) {
paint->setTextAlign(static_cast<SkPaint::Align>(align));
}
static void anp_setTextSize(ANPPaint* paint, float textSize) {
paint->setTextSize(SkFloatToScalar(textSize));
}
static void anp_setTextScaleX(ANPPaint* paint, float scaleX) {
paint->setTextScaleX(SkFloatToScalar(scaleX));
}
static void anp_setTextSkewX(ANPPaint* paint, float skewX) {
paint->setTextSkewX(SkFloatToScalar(skewX));
}
static void anp_setTypeface(ANPPaint* paint, ANPTypeface* tf) {
paint->setTypeface(sk_ref_sp(tf));
}
static float anp_measureText(ANPPaint* paint, const void* text,
uint32_t byteLength, ANPRectF* bounds) {
SkScalar w = paint->measureText(text, byteLength,
reinterpret_cast<SkRect*>(bounds));
return SkScalarToFloat(w);
}
/** Return the number of unichars specifed by the text.
If widths is not null, returns the array of advance widths for each
unichar.
If bounds is not null, returns the array of bounds for each unichar.
*/
static int anp_getTextWidths(ANPPaint* paint, const void* text,
uint32_t byteLength, float widths[], ANPRectF bounds[]) {
return paint->getTextWidths(text, byteLength, widths,
reinterpret_cast<SkRect*>(bounds));
}
static float anp_getFontMetrics(ANPPaint* paint, ANPFontMetrics* metrics) {
SkPaint::FontMetrics fm;
SkScalar spacing = paint->getFontMetrics(&fm);
if (metrics) {
metrics->fTop = SkScalarToFloat(fm.fTop);
metrics->fAscent = SkScalarToFloat(fm.fAscent);
metrics->fDescent = SkScalarToFloat(fm.fDescent);
metrics->fBottom = SkScalarToFloat(fm.fBottom);
metrics->fLeading = SkScalarToFloat(fm.fLeading);
}
return SkScalarToFloat(spacing);
}
///////////////////////////////////////////////////////////////////////////////
#define ASSIGN(obj, name) (obj)->name = anp_##name
void InitPaintInterface(ANPPaintInterfaceV0* i) {
ASSIGN(i, newPaint);
ASSIGN(i, deletePaint);
ASSIGN(i, getFlags);
ASSIGN(i, setFlags);
ASSIGN(i, getColor);
ASSIGN(i, setColor);
ASSIGN(i, getStyle);
ASSIGN(i, setStyle);
ASSIGN(i, getStrokeWidth);
ASSIGN(i, getStrokeMiter);
ASSIGN(i, getStrokeCap);
ASSIGN(i, getStrokeJoin);
ASSIGN(i, setStrokeWidth);
ASSIGN(i, setStrokeMiter);
ASSIGN(i, setStrokeCap);
ASSIGN(i, setStrokeJoin);
ASSIGN(i, getTextEncoding);
ASSIGN(i, getTextAlign);
ASSIGN(i, getTextSize);
ASSIGN(i, getTextScaleX);
ASSIGN(i, getTextSkewX);
ASSIGN(i, getTypeface);
ASSIGN(i, setTextEncoding);
ASSIGN(i, setTextAlign);
ASSIGN(i, setTextSize);
ASSIGN(i, setTextScaleX);
ASSIGN(i, setTextSkewX);
ASSIGN(i, setTypeface);
ASSIGN(i, measureText);
ASSIGN(i, getTextWidths);
ASSIGN(i, getFontMetrics);
}

View file

@ -1,110 +0,0 @@
/*
* Copyright 2008, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// must include config.h first for webkit to fiddle with new/delete
#include "SkANP.h"
#include "SkStream.h"
#include <stdlib.h>
static ANPTypeface* anp_createFromName(const char name[], ANPTypefaceStyle s) {
sk_sp<SkTypeface> tf = SkTypeface::MakeFromName(name,
SkFontStyle::FromOldStyle(s));
return reinterpret_cast<ANPTypeface*>(tf.release());
}
static ANPTypeface* anp_createFromTypeface(const ANPTypeface* family,
ANPTypefaceStyle s) {
sk_sp<SkTypeface> tf = SkTypeface::MakeFromTypeface(const_cast<ANPTypeface*>(family),
static_cast<SkTypeface::Style>(s));
return reinterpret_cast<ANPTypeface*>(tf.release());
}
static int32_t anp_getRefCount(const ANPTypeface* tf) {
return tf ? tf->getRefCnt() : 0;
}
static void anp_ref(ANPTypeface* tf) {
SkSafeRef(tf);
}
static void anp_unref(ANPTypeface* tf) {
SkSafeUnref(tf);
}
static ANPTypefaceStyle anp_getStyle(const ANPTypeface* tf) {
SkTypeface::Style s = tf ? tf->style() : SkTypeface::kNormal;
return static_cast<ANPTypefaceStyle>(s);
}
static int32_t anp_getFontPath(const ANPTypeface* tf, char fileName[],
int32_t length, int32_t* index) {
return 0;
/*
SkStream* stream = tf->openStream(index);
if (stream->getFileName()) {
strcpy(fileName, stream->getFileName());
} else {
return 0;
}
return strlen(fileName);
*/
}
static const char* gFontDir;
#define FONT_DIR_SUFFIX "/fonts/"
static const char* anp_getFontDirectoryPath() {
if (NULL == gFontDir) {
const char* root = getenv("ANDROID_ROOT");
size_t len = strlen(root);
char* storage = (char*)malloc(len + sizeof(FONT_DIR_SUFFIX));
if (NULL == storage) {
return NULL;
}
memcpy(storage, root, len);
memcpy(storage + len, FONT_DIR_SUFFIX, sizeof(FONT_DIR_SUFFIX));
// save this assignment for last, so that if multiple threads call us
// (which should never happen), we never return an incomplete global.
// At worst, we would allocate storage for the path twice.
gFontDir = storage;
}
return gFontDir;
}
///////////////////////////////////////////////////////////////////////////////
#define ASSIGN(obj, name) (obj)->name = anp_##name
void InitTypeFaceInterface(ANPTypefaceInterfaceV0* i) {
ASSIGN(i, createFromName);
ASSIGN(i, createFromTypeface);
ASSIGN(i, getRefCount);
ASSIGN(i, ref);
ASSIGN(i, unref);
ASSIGN(i, getStyle);
ASSIGN(i, getFontPath);
ASSIGN(i, getFontDirectoryPath);
}

View file

@ -1,107 +0,0 @@
/*
* Copyright 2008, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// must include config.h first for webkit to fiddle with new/delete
#include "SkANP.h"
SkRect* SkANP::SetRect(SkRect* dst, const ANPRectF& src) {
dst->set(SkFloatToScalar(src.left),
SkFloatToScalar(src.top),
SkFloatToScalar(src.right),
SkFloatToScalar(src.bottom));
return dst;
}
SkIRect* SkANP::SetRect(SkIRect* dst, const ANPRectI& src) {
dst->set(src.left, src.top, src.right, src.bottom);
return dst;
}
ANPRectI* SkANP::SetRect(ANPRectI* dst, const SkIRect& src) {
dst->left = src.fLeft;
dst->top = src.fTop;
dst->right = src.fRight;
dst->bottom = src.fBottom;
return dst;
}
ANPRectF* SkANP::SetRect(ANPRectF* dst, const SkRect& src) {
dst->left = SkScalarToFloat(src.fLeft);
dst->top = SkScalarToFloat(src.fTop);
dst->right = SkScalarToFloat(src.fRight);
dst->bottom = SkScalarToFloat(src.fBottom);
return dst;
}
SkBitmap* SkANP::SetBitmap(SkBitmap* dst, const ANPBitmap& src) {
SkColorType colorType = kUnknown_SkColorType;
switch (src.format) {
case kRGBA_8888_ANPBitmapFormat:
// Let Skia choose the correct colour type for us based on its
// endianness. This should be correct.
colorType = kN32_SkColorType;
break;
case kRGB_565_ANPBitmapFormat:
colorType = kRGB_565_SkColorType;
break;
default:
break;
}
SkImageInfo info = SkImageInfo::Make(src.width, src.height, colorType, kPremul_SkAlphaType);
dst->setInfo(info, src.rowBytes);
dst->setPixels(src.baseAddr);
return dst;
}
bool SkANP::SetBitmap(ANPBitmap* dst, const SkBitmap& src) {
if (!(dst->baseAddr = src.getPixels())) {
SkDebugf("SkANP::SetBitmap - getPixels() returned null\n");
return false;
}
switch (src.colorType()) {
case SkColorType::kRGBA_8888_SkColorType:
dst->format = kRGBA_8888_ANPBitmapFormat;
break;
case SkColorType::kRGB_565_SkColorType:
dst->format = kRGB_565_ANPBitmapFormat;
break;
default:
SkDebugf("SkANP::SetBitmap - unsupported src.colorType %d\n", src.colorType());
return false;
}
dst->width = src.width();
dst->height = src.height();
dst->rowBytes = src.rowBytes();
return true;
}
void SkANP::InitEvent(ANPEvent* event, ANPEventType et) {
event->inSize = sizeof(ANPEvent);
event->eventType = et;
}

View file

@ -1,79 +0,0 @@
/*
* Copyright 2008, The Android Open Source Project
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SkANP_DEFINED
#define SkANP_DEFINED
#include "android_npapi.h"
#include "SkCanvas.h"
#include "SkMatrix.h"
#include "SkPaint.h"
#include "SkPath.h"
#include "SkTypeface.h"
struct ANPMatrix : SkMatrix {
};
struct ANPPath : SkPath {
};
struct ANPPaint : SkPaint {
};
struct ANPTypeface : SkTypeface {
};
struct ANPCanvas {
SkCanvas* skcanvas;
// draw into the specified bitmap
explicit ANPCanvas(const SkBitmap& bm) {
skcanvas = new SkCanvas(bm);
}
// redirect all drawing to the specific SkCanvas
explicit ANPCanvas(SkCanvas* other) {
skcanvas = other;
skcanvas->ref();
}
~ANPCanvas() {
skcanvas->unref();
}
};
class SkANP {
public:
static SkRect* SetRect(SkRect* dst, const ANPRectF& src);
static SkIRect* SetRect(SkIRect* dst, const ANPRectI& src);
static ANPRectI* SetRect(ANPRectI* dst, const SkIRect& src);
static ANPRectF* SetRect(ANPRectF* dst, const SkRect& src);
static SkBitmap* SetBitmap(SkBitmap* dst, const ANPBitmap& src);
static bool SetBitmap(ANPBitmap* dst, const SkBitmap& src);
static void InitEvent(ANPEvent* event, ANPEventType et);
};
#endif

View file

@ -1,31 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
EXPORTS += [
'SkANP.h',
]
UNIFIED_SOURCES += [
'ANPCanvas.cpp',
'ANPPaint.cpp',
'ANPTypeface.cpp',
'SkANP.cpp',
]
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
FINAL_LIBRARY = 'xul'
DEFINES['SK_BUILD_FOR_ANDROID_NDK'] = True
LOCAL_INCLUDES += [
'/dom/plugins/base',
'/dom/plugins/base/android',
'/gfx/gl',
'/gfx/skia/skia/include/config',
'/gfx/skia/skia/include/core',
]

View file

@ -1267,26 +1267,19 @@ nsNSSComponent::InitializePIPNSSBundle()
nsresult rv; nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv)); nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
MOZ_RELEASE_ASSERT(bundleService);
#endif
if (NS_FAILED(rv) || !bundleService) if (NS_FAILED(rv) || !bundleService)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
bundleService->CreateBundle("chrome://pipnss/locale/pipnss.properties", bundleService->CreateBundle("chrome://pipnss/locale/pipnss.properties",
getter_AddRefs(mPIPNSSBundle)); getter_AddRefs(mPIPNSSBundle));
#ifdef ANDROID
MOZ_RELEASE_ASSERT(mPIPNSSBundle);
#endif
if (!mPIPNSSBundle) if (!mPIPNSSBundle)
rv = NS_ERROR_FAILURE; rv = NS_ERROR_FAILURE;
bundleService->CreateBundle("chrome://pipnss/locale/nsserrors.properties", bundleService->CreateBundle("chrome://pipnss/locale/nsserrors.properties",
getter_AddRefs(mNSSErrorsBundle)); getter_AddRefs(mNSSErrorsBundle));
#ifdef ANDROID
MOZ_RELEASE_ASSERT(mNSSErrorsBundle);
#endif
if (!mNSSErrorsBundle) if (!mNSSErrorsBundle)
rv = NS_ERROR_FAILURE; rv = NS_ERROR_FAILURE;
@ -1488,9 +1481,7 @@ CipherSuiteChangeObserver::StartObserve()
if (!sObserver) { if (!sObserver) {
RefPtr<CipherSuiteChangeObserver> observer = new CipherSuiteChangeObserver(); RefPtr<CipherSuiteChangeObserver> observer = new CipherSuiteChangeObserver();
nsresult rv = Preferences::AddStrongObserver(observer.get(), "security."); nsresult rv = Preferences::AddStrongObserver(observer.get(), "security.");
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
sObserver = nullptr; sObserver = nullptr;
return rv; return rv;
@ -1724,9 +1715,7 @@ GetNSSProfilePath(nsAutoCString& aProfilePath)
#else #else
rv = profileFile->GetNativePath(aProfilePath); rv = profileFile->GetNativePath(aProfilePath);
#endif #endif
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error, MOZ_LOG(gPIPNSSLog, LogLevel::Error,
("Could not get native path for profile directory.\n")); ("Could not get native path for profile directory.\n"));
@ -1754,9 +1743,6 @@ nsNSSComponent::InitializeNSS()
MutexAutoLock lock(mutex); MutexAutoLock lock(mutex);
#ifdef ANDROID
MOZ_RELEASE_ASSERT(!mNSSInitialized);
#endif
if (mNSSInitialized) { if (mNSSInitialized) {
// We should never try to initialize NSS more than once in a process. // We should never try to initialize NSS more than once in a process.
MOZ_ASSERT_UNREACHABLE("Trying to initialize NSS twice"); MOZ_ASSERT_UNREACHABLE("Trying to initialize NSS twice");
@ -1775,9 +1761,7 @@ nsNSSComponent::InitializeNSS()
nsAutoCString profileStr; nsAutoCString profileStr;
nsresult rv = GetNSSProfilePath(profileStr); nsresult rv = GetNSSProfilePath(profileStr);
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
} }
@ -1791,9 +1775,7 @@ nsNSSComponent::InitializeNSS()
// modules will be loaded). // modules will be loaded).
if (runtime) { if (runtime) {
rv = runtime->GetInSafeMode(&inSafeMode); rv = runtime->GetInSafeMode(&inSafeMode);
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return rv; return rv;
} }
@ -1818,14 +1800,9 @@ nsNSSComponent::InitializeNSS()
// pref has been set to "true", attempt to initialize with no DB. // pref has been set to "true", attempt to initialize with no DB.
if (nocertdb || init_rv != SECSuccess) { if (nocertdb || init_rv != SECSuccess) {
init_rv = NSS_NoDB_Init(nullptr); init_rv = NSS_NoDB_Init(nullptr);
#ifdef ANDROID
MOZ_RELEASE_ASSERT(init_rv == SECSuccess);
#endif
} }
if (init_rv != SECSuccess) { if (init_rv != SECSuccess) {
#ifdef ANDROID
MOZ_RELEASE_ASSERT(false);
#endif
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("could not initialize NSS - panicking\n")); MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("could not initialize NSS - panicking\n"));
return NS_ERROR_NOT_AVAILABLE; return NS_ERROR_NOT_AVAILABLE;
} }
@ -1847,9 +1824,7 @@ nsNSSComponent::InitializeNSS()
SSL_OptionSetDefault(SSL_V2_COMPATIBLE_HELLO, false); SSL_OptionSetDefault(SSL_V2_COMPATIBLE_HELLO, false);
rv = setEnabledTLSVersions(); rv = setEnabledTLSVersions();
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return NS_ERROR_UNEXPECTED; return NS_ERROR_UNEXPECTED;
} }
@ -1858,9 +1833,7 @@ nsNSSComponent::InitializeNSS()
LoadLoadableRoots(); LoadLoadableRoots();
rv = LoadExtendedValidationInfo(); rv = LoadExtendedValidationInfo();
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("failed to load EV info")); MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("failed to load EV info"));
return rv; return rv;
@ -1900,18 +1873,14 @@ nsNSSComponent::InitializeNSS()
ENABLED_0RTT_DATA_DEFAULT)); ENABLED_0RTT_DATA_DEFAULT));
if (NS_FAILED(InitializeCipherSuite())) { if (NS_FAILED(InitializeCipherSuite())) {
#ifdef ANDROID
MOZ_RELEASE_ASSERT(false);
#endif
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to initialize cipher suite settings\n")); MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to initialize cipher suite settings\n"));
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
// ensure the CertBlocklist is initialised // ensure the CertBlocklist is initialised
nsCOMPtr<nsICertBlocklist> certList = do_GetService(NS_CERTBLOCKLIST_CONTRACTID); nsCOMPtr<nsICertBlocklist> certList = do_GetService(NS_CERTBLOCKLIST_CONTRACTID);
#ifdef ANDROID
MOZ_RELEASE_ASSERT(certList);
#endif
if (!certList) { if (!certList) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -1928,9 +1897,7 @@ nsNSSComponent::InitializeNSS()
// Initialize the site security service // Initialize the site security service
nsCOMPtr<nsISiteSecurityService> sssService = nsCOMPtr<nsISiteSecurityService> sssService =
do_GetService(NS_SSSERVICE_CONTRACTID); do_GetService(NS_SSSERVICE_CONTRACTID);
#ifdef ANDROID
MOZ_RELEASE_ASSERT(sssService);
#endif
if (!sssService) { if (!sssService) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Cannot initialize site security service\n")); MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Cannot initialize site security service\n"));
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -1939,9 +1906,7 @@ nsNSSComponent::InitializeNSS()
// Initialize the cert override service // Initialize the cert override service
nsCOMPtr<nsICertOverrideService> coService = nsCOMPtr<nsICertOverrideService> coService =
do_GetService(NS_CERTOVERRIDE_CONTRACTID); do_GetService(NS_CERTOVERRIDE_CONTRACTID);
#ifdef ANDROID
MOZ_RELEASE_ASSERT(coService);
#endif
if (!coService) { if (!coService) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Cannot initialize cert override service\n")); MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Cannot initialize cert override service\n"));
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -2010,9 +1975,7 @@ nsNSSComponent::Init()
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Beginning NSS initialization\n")); MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Beginning NSS initialization\n"));
rv = InitializePIPNSSBundle(); rv = InitializePIPNSSBundle();
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to create pipnss bundle.\n")); MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to create pipnss bundle.\n"));
return rv; return rv;
@ -2033,9 +1996,7 @@ nsNSSComponent::Init()
rv = InitializeNSS(); rv = InitializeNSS();
#ifdef ANDROID
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error, MOZ_LOG(gPIPNSSLog, LogLevel::Error,
("nsNSSComponent::InitializeNSS() failed\n")); ("nsNSSComponent::InitializeNSS() failed\n"));
@ -2197,9 +2158,7 @@ nsNSSComponent::RegisterObservers()
nsCOMPtr<nsIObserverService> observerService( nsCOMPtr<nsIObserverService> observerService(
do_GetService("@mozilla.org/observer-service;1")); do_GetService("@mozilla.org/observer-service;1"));
#ifdef ANDROID
MOZ_RELEASE_ASSERT(observerService);
#endif
if (!observerService) { if (!observerService) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
("nsNSSComponent: couldn't get observer service\n")); ("nsNSSComponent: couldn't get observer service\n"));
@ -2421,9 +2380,6 @@ InitializeCipherSuite()
NS_ASSERTION(NS_IsMainThread(), "InitializeCipherSuite() can only be accessed in main thread"); NS_ASSERTION(NS_IsMainThread(), "InitializeCipherSuite() can only be accessed in main thread");
if (NSS_SetDomesticPolicy() != SECSuccess) { if (NSS_SetDomesticPolicy() != SECSuccess) {
#ifdef ANDROID
MOZ_RELEASE_ASSERT(false);
#endif
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }

View file

@ -164,12 +164,6 @@ XPCOMUtils.defineLazyGetter(this, "gSystemCapabilities", function aus_gSC() {
lib.close(); lib.close();
return instructionSet; return instructionSet;
#elifdef XP_LINUX
let instructionSet = "unknown";
if (navigator.cpuHasSSE2) {
instructionSet = "SSE2";
}
return instructionSet;
#else #else
return "NA" return "NA"
#endif #endif

View file

@ -559,8 +559,6 @@ option('--enable-ipdl-tests', help='Enable expensive IPDL tests')
set_config('MOZ_IPDL_TESTS', set_config('MOZ_IPDL_TESTS',
depends_if('--enable-ipdl-tests')(lambda _: True)) depends_if('--enable-ipdl-tests')(lambda _: True))
include('nss.configure')
# Network protocol support # Network protocol support
# ============================================================== # ==============================================================
@depends(check_build_environment, '--help') @depends(check_build_environment, '--help')

View file

@ -1,16 +0,0 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
# DBM support in NSS
# ==============================================================
@depends(build_project, '--help')
def dbm_default(build_project, _):
return True
option('--enable-dbm', default=dbm_default, help='Enable building DBM')
set_config('NSS_DISABLE_DBM', depends('--enable-dbm')(lambda x: not x))