Merge m-i to m-c

This commit is contained in:
Phil Ringnalda 2014-01-18 15:17:10 -08:00
commit 685a462788
184 changed files with 3624 additions and 3944 deletions

View File

@ -68,6 +68,10 @@ pref("network.http.spdy.push-allowance", 32768);
pref("network.buffer.cache.count", 24);
pref("network.buffer.cache.size", 16384);
// predictive actions
pref("network.seer.max-db-size", 2097152); // bytes
pref("network.seer.preserve", 50); // percentage of seer data to keep when cleaning up
/* session history */
pref("browser.sessionhistory.max_total_viewers", 1);
pref("browser.sessionhistory.max_entries", 50);

View File

@ -64,4 +64,6 @@ MOZ_PAY=1
# Enable activities. These are used for FxOS developers currently.
MOZ_ACTIVITIES=1
MOZ_JSDOWNLOADS=1
# Enable exact rooting on desktop.
JSGC_USE_EXACT_ROOTING=1

View File

@ -882,6 +882,8 @@ TouchDragAndHold.prototype = {
if (this._debug) {
info("[0] touchstart " + aStartX + " x " + aStartY);
}
// flush layout, bug 914847
this._utils.elementFromPoint(aStartX, aStartY, false, true);
if (this._native) {
this._utils.sendNativeTouchPoint(this._pointerId, this._dui.TOUCH_CONTACT,
aStartX, aStartY, 1, 90);
@ -909,7 +911,7 @@ TouchDragAndHold.prototype = {
return this._defer.promise;
},
end: function start() {
end: function end() {
if (this._debug) {
info("[" + this._step.steps + "] touchend " + this._endPoint.xPos + " x " + this._endPoint.yPos);
SelectionHelperUI.debugClearDebugPoints();

View File

@ -11,10 +11,13 @@ public class AnnotationInfo {
public final String wrapperName;
public final boolean isStatic;
public final boolean isMultithreaded;
public final boolean noThrow;
public AnnotationInfo(String aWrapperName, boolean aIsStatic, boolean aIsMultithreaded) {
public AnnotationInfo(String aWrapperName, boolean aIsStatic, boolean aIsMultithreaded,
boolean aNoThrow) {
wrapperName = aWrapperName;
isStatic = aIsStatic;
isMultithreaded = aIsMultithreaded;
noThrow = aNoThrow;
}
}

View File

@ -70,11 +70,7 @@ public class CodeGenerator {
" ").append(mCClassName).append("(jobject obj, JNIEnv* env) : AutoGlobalWrappedJavaObject(obj, env) {};\n");
wrapperMethodBodies.append("\n").append(mCClassName).append("* ").append(mCClassName).append("::Wrap(jobject obj) {\n" +
" JNIEnv *env = GetJNIForThread();\n\n" +
" if (!env) {\n" +
" ALOG_BRIDGE(\"Aborted: No env - %s\", __PRETTY_FUNCTION__);\n" +
" return nullptr;\n" +
" }\n\n" +
" JNIEnv *env = GetJNIForThread();\n" +
" ").append(mCClassName).append("* ret = new ").append(mCClassName).append("(obj, env);\n" +
" env->DeleteLocalRef(obj);\n" +
" return ret;\n" +
@ -114,7 +110,10 @@ public class CodeGenerator {
writeSignatureToHeader(headerSignature);
// Use the implementation signature to generate the method body...
writeMethodBody(implementationSignature, CMethodName, theMethod, mClassToWrap, aMethodTuple.mAnnotationInfo.isStatic, aMethodTuple.mAnnotationInfo.isMultithreaded);
writeMethodBody(implementationSignature, CMethodName, theMethod, mClassToWrap,
aMethodTuple.mAnnotationInfo.isStatic,
aMethodTuple.mAnnotationInfo.isMultithreaded,
aMethodTuple.mAnnotationInfo.noThrow);
}
private void generateGetterOrSetterBody(Class<?> aFieldType, String aFieldName, boolean aIsFieldStatic, boolean isSetter) {
@ -229,7 +228,9 @@ public class CodeGenerator {
writeSignatureToHeader(headerSignature);
// Use the implementation signature to generate the method body...
writeCtorBody(implementationSignature, theCtor, aCtorTuple.mAnnotationInfo.isMultithreaded);
writeCtorBody(implementationSignature, theCtor,
aCtorTuple.mAnnotationInfo.isMultithreaded,
aCtorTuple.mAnnotationInfo.noThrow);
if (theCtor.getParameterTypes().length == 0) {
mHasEncounteredDefaultConstructor = true;
@ -286,10 +287,6 @@ public class CodeGenerator {
} else {
wrapperMethodBodies.append("GetJNIForThread();\n");
}
wrapperMethodBodies.append(" if (!env) {\n" +
" ALOG_BRIDGE(\"Aborted: No env - %s\", __PRETTY_FUNCTION__);\n" +
" return").append(Utils.getFailureReturnForType(returnType)).append(";\n" +
" }\n\n");
}
/**
@ -299,7 +296,8 @@ public class CodeGenerator {
* @param aMethod A constructor/method being wrapped.
* @param aIsObjectReturningMethod Does the method being wrapped return an object?
*/
private void writeFramePushBoilerplate(Member aMethod, boolean aIsObjectReturningMethod) {
private void writeFramePushBoilerplate(Member aMethod,
boolean aIsObjectReturningMethod, boolean aNoThrow) {
if (aMethod instanceof Field) {
throw new IllegalArgumentException("Tried to push frame for a FIELD?!");
}
@ -325,13 +323,18 @@ public class CodeGenerator {
if (aIsObjectReturningMethod) {
localReferencesNeeded++;
}
wrapperMethodBodies.append(" if (env->PushLocalFrame(").append(localReferencesNeeded).append(") != 0) {\n" +
" ALOG_BRIDGE(\"Exceptional exit of: %s\", __PRETTY_FUNCTION__);\n" +
" env->ExceptionDescribe();\n"+
" env->ExceptionClear();\n" +
" return").append(Utils.getFailureReturnForType(returnType)).append(";\n" +
wrapperMethodBodies.append(
" if (env->PushLocalFrame(").append(localReferencesNeeded).append(") != 0) {\n");
if (!aNoThrow) {
wrapperMethodBodies.append(
" AndroidBridge::HandleUncaughtException(env);\n" +
" MOZ_ASSUME_UNREACHABLE(\"Exception should have caused crash.\");\n");
} else {
wrapperMethodBodies.append(
" return").append(Utils.getFailureReturnForType(returnType)).append(";\n");
}
wrapperMethodBodies.append(
" }\n\n");
}
private StringBuilder getArgumentMarshalling(Class<?>[] argumentTypes) {
@ -376,12 +379,13 @@ public class CodeGenerator {
return argumentContent;
}
private void writeCtorBody(String implementationSignature, Constructor theCtor, boolean aIsThreaded) {
private void writeCtorBody(String implementationSignature, Constructor theCtor,
boolean aIsThreaded, boolean aNoThrow) {
Class<?>[] argumentTypes = theCtor.getParameterTypes();
writeFunctionStartupBoilerPlate(implementationSignature, Void.class, false, aIsThreaded);
writeFramePushBoilerplate(theCtor, false);
writeFramePushBoilerplate(theCtor, false, aNoThrow);
// Marshall arguments for this constructor, if any...
boolean hasArguments = argumentTypes.length != 0;
@ -420,7 +424,9 @@ public class CodeGenerator {
* @param aMethod The Java method to be wrapped by the C++ method being generated.
* @param aClass The Java class to which the method belongs.
*/
private void writeMethodBody(String methodSignature, String aCMethodName, Method aMethod, Class<?> aClass, boolean aIsStaticBridgeMethod, boolean aIsMultithreaded) {
private void writeMethodBody(String methodSignature, String aCMethodName, Method aMethod,
Class<?> aClass, boolean aIsStaticBridgeMethod, boolean aIsMultithreaded,
boolean aNoThrow) {
Class<?>[] argumentTypes = aMethod.getParameterTypes();
Class<?> returnType = aMethod.getReturnType();
@ -428,7 +434,7 @@ public class CodeGenerator {
boolean isObjectReturningMethod = !returnType.getCanonicalName().equals("void") && Utils.isObjectType(returnType);
writeFramePushBoilerplate(aMethod, isObjectReturningMethod);
writeFramePushBoilerplate(aMethod, isObjectReturningMethod, aNoThrow);
// Marshall arguments, if we have any.
boolean hasArguments = argumentTypes.length != 0;
@ -477,16 +483,12 @@ public class CodeGenerator {
// Tack on the arguments, if any..
wrapperMethodBodies.append(argumentContent)
.append(");\n\n");
.append(");\n");
// Check for exception and return the failure value..
wrapperMethodBodies.append(" if (env->ExceptionCheck()) {\n" +
" ALOG_BRIDGE(\"Exceptional exit of: %s\", __PRETTY_FUNCTION__);\n" +
" env->ExceptionDescribe();\n" +
" env->ExceptionClear();\n" +
" env->PopLocalFrame(nullptr);\n" +
" return").append(Utils.getFailureReturnForType(returnType)).append(";\n" +
" }\n\n");
// Check for exception and crash if any...
if (!aNoThrow) {
wrapperMethodBodies.append(" AndroidBridge::HandleUncaughtException(env);\n");
}
// If we're returning an object, pop the callee's stack frame extracting our ref as the return
// value.

View File

@ -75,6 +75,7 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
String stubName = null;
boolean isStaticStub = false;
boolean isMultithreadedStub = false;
boolean noThrow = false;
try {
// Determine the explicitly-given name of the stub to generate, if any.
final Method stubNameMethod = annotationType.getDeclaredMethod("stubName");
@ -90,6 +91,12 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
final Method multithreadedStubMethod = annotationType.getDeclaredMethod("allowMultithread");
multithreadedStubMethod.setAccessible(true);
isMultithreadedStub = (Boolean) multithreadedStubMethod.invoke(annotation);
// Determine if ignoring exceptions
final Method noThrowMethod = annotationType.getDeclaredMethod("noThrow");
noThrowMethod.setAccessible(true);
noThrow = (Boolean) noThrowMethod.invoke(annotation);
} catch (NoSuchMethodException e) {
System.err.println("Unable to find expected field on WrapElementForJNI annotation. Did the signature change?");
e.printStackTrace(System.err);
@ -110,7 +117,8 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
stubName = aMethodName.substring(0, 1).toUpperCase() + aMethodName.substring(1);
}
AnnotationInfo annotationInfo = new AnnotationInfo(stubName, isStaticStub, isMultithreadedStub);
AnnotationInfo annotationInfo = new AnnotationInfo(
stubName, isStaticStub, isMultithreadedStub, noThrow);
mNextReturnValue = new AnnotatableEntity(candidateElement, annotationInfo);
return;
}
@ -119,7 +127,8 @@ public class GeneratableElementIterator implements Iterator<AnnotatableEntity> {
// If no annotation found, we might be expected to generate anyway using default arguments,
// thanks to the "Generate everything" annotation.
if (mIterateEveryEntry) {
AnnotationInfo annotationInfo = new AnnotationInfo(candidateElement.getName(), false, false);
AnnotationInfo annotationInfo = new AnnotationInfo(
candidateElement.getName(), false, false, false);
mNextReturnValue = new AnnotatableEntity(candidateElement, annotationInfo);
return;
}

View File

@ -100,7 +100,7 @@ IDToString(JSContext *cx, jsid id_)
return JS_GetInternedStringChars(JSID_TO_STRING(id));
JS::Rooted<JS::Value> idval(cx);
if (!JS_IdToValue(cx, id, idval.address()))
if (!JS_IdToValue(cx, id, &idval))
return nullptr;
JSString *str = JS::ToString(cx, idval);
if(!str)

View File

@ -1549,50 +1549,6 @@ if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
esac
fi
dnl ========================================================
dnl = Use incremental GC
dnl ========================================================
JSGC_INCREMENTAL=1
MOZ_ARG_DISABLE_BOOL(gcincremental,
[ --disable-gcincremental Disable incremental GC],
JSGC_INCREMENTAL= )
if test -n "$JSGC_INCREMENTAL"; then
AC_DEFINE(JSGC_INCREMENTAL)
fi
dnl ========================================================
dnl = Use generational GC
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(gcgenerational,
[ --enable-gcgenerational Enable generational GC],
JSGC_GENERATIONAL=1,
JSGC_GENERATIONAL= )
if test -n "$JSGC_GENERATIONAL"; then
AC_DEFINE(JSGC_GENERATIONAL)
fi
dnl ========================================================
dnl = Perform moving GC stack rooting analysis
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(root-analysis,
[ --enable-root-analysis Enable moving GC stack root analysis],
JSGC_ROOT_ANALYSIS=1,
JSGC_ROOT_ANALYSIS= )
if test -n "$JSGC_ROOT_ANALYSIS"; then
AC_DEFINE(JSGC_ROOT_ANALYSIS)
fi
dnl ========================================================
dnl = Use exact stack rooting for GC
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(exact-rooting,
[ --enable-exact-rooting Enable use of exact stack roots for GC],
JSGC_USE_EXACT_ROOTING=1,
JSGC_USE_EXACT_ROOTING= )
if test -n "$JSGC_USE_EXACT_ROOTING"; then
AC_DEFINE(JSGC_USE_EXACT_ROOTING)
fi
dnl ========================================================
dnl = Use Valgrind
dnl ========================================================
@ -4064,6 +4020,7 @@ MOZ_AUDIO_CHANNEL_MANAGER=
NSS_NO_LIBPKIX=
MOZ_CONTENT_SANDBOX=
MOZ_CONTENT_SANDBOX_REPORTER=
JSGC_USE_EXACT_ROOTING=
case "$target_os" in
mingw*)
@ -4208,6 +4165,10 @@ if test -n "$WITH_APP_NAME" ; then
MOZ_APP_NAME="$WITH_APP_NAME"
fi
if test -z "$MOZ_APP_NAME"; then
MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
fi
MOZ_ARG_WITH_STRING(app-basename,
[--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
WITH_APP_BASENAME=$withval,
@ -7074,6 +7035,7 @@ if test -n "$_WRAP_MALLOC"; then
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=vasprintf,--wrap=asprintf"
WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
dnl Wrap operator new and operator delete on Android.
if test "$OS_TARGET" = "Android"; then
@ -7104,6 +7066,18 @@ if test -n "$MOZ_TRACE_JSCALLS"; then
AC_DEFINE(MOZ_TRACE_JSCALLS)
fi
dnl ========================================================
dnl JS opt-mode assertions and minidump instrumentation
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(js-diagnostics,
[ --enable-js-diagnostics
Enable JS diagnostic assertions and breakpad data],
JS_CRASH_DIAGNOSTICS=1,
JS_CRASH_DIAGNOSTICS= )
if test -n "$JS_CRASH_DIAGNOSTICS"; then
AC_DEFINE(JS_CRASH_DIAGNOSTICS)
fi
dnl ========================================================
dnl = Use incremental GC
dnl ========================================================
@ -7115,6 +7089,28 @@ if test -n "$JSGC_INCREMENTAL"; then
AC_DEFINE(JSGC_INCREMENTAL)
fi
dnl ========================================================
dnl = Use exact stack rooting for GC
dnl ========================================================
MOZ_ARG_DISABLE_BOOL(exact-rooting,
[ --disable-exact-rooting Enable use of conservative stack scanning for GC],
JSGC_USE_EXACT_ROOTING= ,
JSGC_USE_EXACT_ROOTING=1 )
if test -n "$JSGC_USE_EXACT_ROOTING"; then
AC_DEFINE(JSGC_USE_EXACT_ROOTING)
fi
dnl ========================================================
dnl = Use generational GC
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(gcgenerational,
[ --enable-gcgenerational Enable generational GC],
JSGC_GENERATIONAL=1,
JSGC_GENERATIONAL= )
if test -n "$JSGC_GENERATIONAL"; then
AC_DEFINE(JSGC_GENERATIONAL)
fi
dnl ========================================================
dnl Zealous JavaScript GC
dnl ========================================================
@ -7127,15 +7123,14 @@ if test -n "$JS_GC_ZEAL" -o -n "$MOZ_DEBUG"; then
fi
dnl ========================================================
dnl JS opt-mode assertions and minidump instrumentation
dnl = Perform moving GC stack rooting analysis
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(js-diagnostics,
[ --enable-js-diagnostics
Enable JS diagnostic assertions and breakpad data],
JS_CRASH_DIAGNOSTICS=1,
JS_CRASH_DIAGNOSTICS= )
if test -n "$JS_CRASH_DIAGNOSTICS"; then
AC_DEFINE(JS_CRASH_DIAGNOSTICS)
MOZ_ARG_ENABLE_BOOL(root-analysis,
[ --enable-root-analysis Enable moving GC stack root analysis],
JSGC_ROOT_ANALYSIS=1,
JSGC_ROOT_ANALYSIS= )
if test -n "$JSGC_ROOT_ANALYSIS"; then
AC_DEFINE(JSGC_ROOT_ANALYSIS)
fi
MOZ_CHECK_CCACHE
@ -8462,10 +8457,6 @@ AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
# - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
# - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.
if test -z "$MOZ_APP_NAME"; then
MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
fi
# For extensions and langpacks, we require a max version that is compatible
# across security releases. MOZ_APP_MAXVERSION is our method for doing that.
# 10.0a1 and 10.0a2 aren't affected
@ -9114,6 +9105,9 @@ if test -z "$JS_SHARED_LIBRARY" ; then
ac_configure_args="$ac_configure_args --disable-export-js"
fi
fi
if test -z "$JSGC_USE_EXACT_ROOTING" ; then
ac_configure_args="$ac_configure_args --disable-exact-rooting"
fi
if test -z "$MOZ_NATIVE_NSPR"; then
ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"

View File

@ -5386,7 +5386,7 @@ nsDocument::Register(JSContext* aCx, const nsAString& aName,
// Create constructor to return. Store the name of the custom element as the
// name of the function.
JSFunction* constructor = JS_NewFunction(aCx, CustomElementConstructor, 0,
JSFUN_CONSTRUCTOR, nullptr,
JSFUN_CONSTRUCTOR, JS::NullPtr(),
NS_ConvertUTF16toUTF8(lcName).get());
JSObject* constructorObject = JS_GetFunctionObject(constructor);
return constructorObject;

View File

@ -257,8 +257,9 @@ MediaEngineTabVideoSource::Draw() {
NS_ENSURE_SUCCESS_VOID(rv);
layers::CairoImage::Data cairoData;
cairoData.mSurface = surf;
cairoData.mDeprecatedSurface = surf;
cairoData.mSize = size;
cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surf);
nsRefPtr<layers::CairoImage> image = new layers::CairoImage();

View File

@ -111,14 +111,6 @@ SpeechSynthesisRequestChild::RecvOnResume(const float& aElapsedTime,
return true;
}
bool
SpeechSynthesisRequestChild::RecvOnError(const float& aElapsedTime,
const uint32_t& aCharIndex)
{
mTask->DispatchErrorImpl(aElapsedTime, aCharIndex);
return true;
}
bool
SpeechSynthesisRequestChild::RecvOnBoundary(const nsString& aName,
const float& aElapsedTime,

View File

@ -22,11 +22,11 @@ class SpeechSynthesisChild : public PSpeechSynthesisChild
friend class nsSynthVoiceRegistry;
public:
bool RecvVoiceAdded(const RemoteVoice& aVoice);
bool RecvVoiceAdded(const RemoteVoice& aVoice) MOZ_OVERRIDE;
bool RecvVoiceRemoved(const nsString& aUri);
bool RecvVoiceRemoved(const nsString& aUri) MOZ_OVERRIDE;
bool RecvSetDefaultVoice(const nsString& aUri, const bool& aIsDefault);
bool RecvSetDefaultVoice(const nsString& aUri, const bool& aIsDefault) MOZ_OVERRIDE;
protected:
SpeechSynthesisChild();
@ -37,8 +37,8 @@ protected:
const nsString& aText,
const float& aVolume,
const float& aPitch,
const float& aRate);
bool DeallocPSpeechSynthesisRequestChild(PSpeechSynthesisRequestChild* aActor);
const float& aRate) MOZ_OVERRIDE;
bool DeallocPSpeechSynthesisRequestChild(PSpeechSynthesisRequestChild* aActor) MOZ_OVERRIDE;
};
class SpeechSynthesisRequestChild : public PSpeechSynthesisRequestChild
@ -48,23 +48,21 @@ public:
virtual ~SpeechSynthesisRequestChild();
protected:
virtual bool RecvOnStart();
virtual bool RecvOnStart() MOZ_OVERRIDE;
virtual bool Recv__delete__(const bool& aIsError,
const float& aElapsedTime,
const uint32_t& aCharIndex);
const uint32_t& aCharIndex) MOZ_OVERRIDE;
virtual bool RecvOnPause(const float& aElapsedTime, const uint32_t& aCharIndex);
virtual bool RecvOnPause(const float& aElapsedTime, const uint32_t& aCharIndex) MOZ_OVERRIDE;
virtual bool RecvOnResume(const float& aElapsedTime, const uint32_t& aCharIndex);
virtual bool RecvOnError(const float& aElapsedTime, const uint32_t& aCharIndex);
virtual bool RecvOnResume(const float& aElapsedTime, const uint32_t& aCharIndex) MOZ_OVERRIDE;
virtual bool RecvOnBoundary(const nsString& aName, const float& aElapsedTime,
const uint32_t& aCharIndex);
const uint32_t& aCharIndex) MOZ_OVERRIDE;
virtual bool RecvOnMark(const nsString& aName, const float& aElapsedTime,
const uint32_t& aCharIndex);
const uint32_t& aCharIndex) MOZ_OVERRIDE;
nsRefPtr<SpeechTaskChild> mTask;
};

View File

@ -23,7 +23,7 @@ class SpeechSynthesisParent : public PSpeechSynthesisParent
public:
bool RecvReadVoiceList(InfallibleTArray<RemoteVoice>* aVoices,
InfallibleTArray<nsString>* aDefaults);
InfallibleTArray<nsString>* aDefaults) MOZ_OVERRIDE;
protected:
SpeechSynthesisParent();
@ -33,9 +33,10 @@ protected:
const nsString& aUri,
const float& aVolume,
const float& aRate,
const float& aPitch);
const float& aPitch)
MOZ_OVERRIDE;
bool DeallocPSpeechSynthesisRequestParent(PSpeechSynthesisRequestParent* aActor);
bool DeallocPSpeechSynthesisRequestParent(PSpeechSynthesisRequestParent* aActor) MOZ_OVERRIDE;
bool RecvPSpeechSynthesisRequestConstructor(PSpeechSynthesisRequestParent* aActor,
const nsString& aText,
@ -43,7 +44,7 @@ protected:
const nsString& aUri,
const float& aVolume,
const float& aRate,
const float& aPitch);
const float& aPitch) MOZ_OVERRIDE;
};
class SpeechSynthesisRequestParent : public PSpeechSynthesisRequestParent
@ -56,11 +57,11 @@ public:
protected:
virtual bool RecvPause();
virtual bool RecvPause() MOZ_OVERRIDE;
virtual bool RecvResume();
virtual bool RecvResume() MOZ_OVERRIDE;
virtual bool RecvCancel();
virtual bool RecvCancel() MOZ_OVERRIDE;
};
class SpeechTaskParent : public nsSpeechTask

View File

@ -590,7 +590,7 @@ IdToString(JSContext *cx, jsid id)
if (JSID_IS_STRING(id))
return JSID_TO_STRING(id);
JS::Rooted<JS::Value> idval(cx);
if (!::JS_IdToValue(cx, id, idval.address()))
if (!::JS_IdToValue(cx, id, &idval))
return nullptr;
return JS::ToString(cx, idval);
}
@ -1311,7 +1311,7 @@ nsDOMClassInfo::GetArrayIndexFromId(JSContext *cx, JS::Handle<jsid> id, bool *aI
} else {
JS::Rooted<JS::Value> idval(cx);
double array_index;
if (!::JS_IdToValue(cx, id, idval.address()) ||
if (!::JS_IdToValue(cx, id, &idval) ||
!JS::ToNumber(cx, idval, &array_index) ||
!::JS_DoubleIsInt32(array_index, &i)) {
return -1;
@ -4358,7 +4358,9 @@ nsStorage2SH::NewEnumerate(nsIXPConnectWrappedNative *wrapper, JSContext *cx,
JS_NewUCStringCopyN(cx, key.get(), key.Length());
NS_ENSURE_TRUE(str, NS_ERROR_OUT_OF_MEMORY);
JS_ValueToId(cx, STRING_TO_JSVAL(str), idp);
JS::Rooted<jsid> id(cx);
JS_ValueToId(cx, JS::StringValue(str), &id);
*idp = id;
keys->RemoveElementAt(0);

View File

@ -1479,7 +1479,7 @@ AppendNamedPropertyIds(JSContext* cx, JS::Handle<JSObject*> proxy,
}
JS::Rooted<jsid> id(cx);
if (!JS_ValueToId(cx, v, id.address())) {
if (!JS_ValueToId(cx, v, &id)) {
return false;
}
@ -1609,7 +1609,8 @@ NativeToString(JSContext* cx, JS::Handle<JSObject*> wrapper,
str = JS_NewStringCopyZ(cx, ifaceAndProtoJSClass->mToString);
} else {
MOZ_ASSERT(JS_IsNativeFunction(obj, Constructor));
str = JS_DecompileFunction(cx, JS_GetObjectFunction(obj), 0);
JS::Rooted<JSFunction*> fun(cx, JS_GetObjectFunction(obj));
str = JS_DecompileFunction(cx, fun, 0);
}
}
str = ConcatJSString(cx, pre, str, post);

View File

@ -5225,7 +5225,8 @@ if (!${obj}) {
if self.idlNode.getExtendedAttribute("Frozen"):
assert self.idlNode.type.isSequence()
freezeValue = CGGeneric(
"if (!JS_FreezeObject(cx, &args.rval().toObject())) {\n"
"JS::Rooted<JSObject*> rvalObj(cx, &args.rval().toObject());\n"
"if (!JS_FreezeObject(cx, rvalObj)) {\n"
" return false;\n"
"}")
if self.idlNode.type.nullable():
@ -5905,7 +5906,7 @@ class CGGenericMethod(CGAbstractBindingMethod):
def generate_code(self):
return CGIndenter(CGGeneric(
"const JSJitInfo *info = FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, vp));\n"
"MOZ_ASSERT(info->type == JSJitInfo::Method);\n"
"MOZ_ASSERT(info->type() == JSJitInfo::Method);\n"
"JSJitMethodOp method = info->method;\n"
"return method(cx, obj, self, JSJitMethodCallArgs(args));"))
@ -6110,7 +6111,7 @@ class CGGenericGetter(CGAbstractBindingMethod):
def generate_code(self):
return CGIndenter(CGGeneric(
"const JSJitInfo *info = FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, vp));\n"
"MOZ_ASSERT(info->type == JSJitInfo::Getter);\n"
"MOZ_ASSERT(info->type() == JSJitInfo::Getter);\n"
"JSJitGetterOp getter = info->getter;\n"
"return getter(cx, obj, self, JSJitGetterCallArgs(args));"))
@ -6226,7 +6227,7 @@ class CGGenericSetter(CGAbstractBindingMethod):
' return ThrowErrorMessage(cx, MSG_MISSING_ARGUMENTS, "%s attribute setter");\n'
"}\n"
"const JSJitInfo *info = FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, vp));\n"
"MOZ_ASSERT(info->type == JSJitInfo::Setter);\n"
"MOZ_ASSERT(info->type() == JSJitInfo::Setter);\n"
"JSJitSetterOp setter = info->setter;\n"
"if (!setter(cx, obj, self, JSJitSetterCallArgs(args))) {\n"
" return false;\n"
@ -6357,16 +6358,16 @@ class CGMemberJITInfo(CGThing):
" %s,\n"
" %s,\n"
" JSJitInfo::%s,\n"
" JSJitInfo::%s, /* aliasSet. Not relevant for setters. */\n"
" %s, /* returnType. Not relevant for setters. */\n"
" %s, /* isInfallible. False in setters. */\n"
" %s, /* isMovable. Not relevant for setters. */\n"
" %s, /* isInSlot. Only relevant for getters. */\n"
" %s, /* isTypedMethod. Only relevant for methods. */\n"
" %s, /* Reserved slot index, if we're stored in a slot, else 0. */\n"
" JSJitInfo::%s /* aliasSet. Not relevant for setters. */\n"
"}" % (opName, protoID, depth, opType,
" %s /* Reserved slot index, if we're stored in a slot, else 0. */\n"
"}" % (opName, protoID, depth, opType, aliasSet,
returnType, failstr, movablestr, slotStr,
typedMethodStr, slotIndex, aliasSet))
typedMethodStr, slotIndex))
if args is not None:
argTypes = "%s_argTypes" % infoName
args = [CGMemberJITInfo.getJSArgType(arg.type) for arg in args]

View File

@ -285,7 +285,7 @@ IdToInt32(JSContext* cx, JS::Handle<jsid> id)
JS::Rooted<JS::Value> idval(cx);
double array_index;
int32_t i;
if (!::JS_IdToValue(cx, id, idval.address()) ||
if (!::JS_IdToValue(cx, id, &idval) ||
!JS::ToNumber(cx, idval, &array_index) ||
!::JS_DoubleIsInt32(array_index, &i)) {
return -1;

View File

@ -94,7 +94,7 @@ nsEventListenerInfo::GetJSVal(JSContext* aCx,
}
nsCOMPtr<nsIJSEventListener> jsl = do_QueryInterface(mListener);
if (jsl) {
if (jsl && jsl->GetHandler().HasEventHandler()) {
JS::Handle<JSObject*> handler(jsl->GetHandler().Ptr()->Callable());
if (handler) {
aAc.construct(aCx, handler);

View File

@ -68,6 +68,10 @@ public:
nsIContent* aContent);
void Destroy(void);
bool IsManaging(nsPresContext* aPresContext, nsIContent* aContent);
bool KeepAliveDuringDeactive() const
{
return !!(mObserving & nsIMEUpdatePreference::NOTIFY_DURING_DEACTIVE);
}
nsCOMPtr<nsIWidget> mWidget;
nsCOMPtr<nsISelection> mSel;
@ -226,6 +230,7 @@ nsIMEStateManager::OnChangeFocusInternal(nsPresContext* aPresContext,
}
if (sTextStateObserver &&
(aPresContext || !sTextStateObserver->KeepAliveDuringDeactive()) &&
!sTextStateObserver->IsManaging(aPresContext, aContent)) {
DestroyTextStateManager();
}

View File

@ -60,6 +60,14 @@ function runTests() {
is(jsdvalue.jsType, 3, "Event listener should be a function! (1)");
*/
root.removeAttribute("onclick");
root.setAttribute("onclick", "...invalid script...");
SimpleTest.expectUncaughtException(true);
infos = els.getListenerInfoFor(root, {});
SimpleTest.expectUncaughtException(false);
is(infos.length, 1);
is(infos[0].listenerObject, null);
root.removeAttribute("onclick");
infos = els.getListenerInfoFor(root, {});
is(infos.length, 0, "Element shouldn't have listeners (2)");

View File

@ -86,7 +86,7 @@ public:
AllocPImageBridgeChild(mozilla::ipc::Transport* aTransport,
base::ProcessId aOtherProcess) MOZ_OVERRIDE;
virtual bool RecvSetProcessPrivileges(const ChildPrivileges& aPrivs);
virtual bool RecvSetProcessPrivileges(const ChildPrivileges& aPrivs) MOZ_OVERRIDE;
virtual PBrowserChild* AllocPBrowserChild(const IPCTabContext &aContext,
const uint32_t &chromeFlags);
@ -100,45 +100,45 @@ public:
virtual PCrashReporterChild*
AllocPCrashReporterChild(const mozilla::dom::NativeThreadId& id,
const uint32_t& processType);
const uint32_t& processType) MOZ_OVERRIDE;
virtual bool
DeallocPCrashReporterChild(PCrashReporterChild*);
DeallocPCrashReporterChild(PCrashReporterChild*) MOZ_OVERRIDE;
virtual PHalChild* AllocPHalChild() MOZ_OVERRIDE;
virtual bool DeallocPHalChild(PHalChild*) MOZ_OVERRIDE;
virtual PIndexedDBChild* AllocPIndexedDBChild();
virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor);
virtual PIndexedDBChild* AllocPIndexedDBChild() MOZ_OVERRIDE;
virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor) MOZ_OVERRIDE;
virtual PMemoryReportRequestChild*
AllocPMemoryReportRequestChild(const uint32_t& generation);
AllocPMemoryReportRequestChild(const uint32_t& generation) MOZ_OVERRIDE;
virtual bool
DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor);
DeallocPMemoryReportRequestChild(PMemoryReportRequestChild* actor) MOZ_OVERRIDE;
virtual bool
RecvPMemoryReportRequestConstructor(PMemoryReportRequestChild* child,
const uint32_t& generation);
const uint32_t& generation) MOZ_OVERRIDE;
virtual bool
RecvAudioChannelNotify();
RecvAudioChannelNotify() MOZ_OVERRIDE;
virtual bool
RecvDumpMemoryInfoToTempDir(const nsString& aIdentifier,
const bool& aMinimizeMemoryUsage,
const bool& aDumpChildProcesses);
const bool& aDumpChildProcesses) MOZ_OVERRIDE;
virtual bool
RecvDumpGCAndCCLogsToFile(const nsString& aIdentifier,
const bool& aDumpAllTraces,
const bool& aDumpChildProcesses);
const bool& aDumpChildProcesses) MOZ_OVERRIDE;
virtual PTestShellChild* AllocPTestShellChild();
virtual bool DeallocPTestShellChild(PTestShellChild*);
virtual bool RecvPTestShellConstructor(PTestShellChild*);
virtual PTestShellChild* AllocPTestShellChild() MOZ_OVERRIDE;
virtual bool DeallocPTestShellChild(PTestShellChild*) MOZ_OVERRIDE;
virtual bool RecvPTestShellConstructor(PTestShellChild*) MOZ_OVERRIDE;
jsipc::JavaScriptChild *GetCPOWManager();
virtual PNeckoChild* AllocPNeckoChild();
virtual bool DeallocPNeckoChild(PNeckoChild*);
virtual PNeckoChild* AllocPNeckoChild() MOZ_OVERRIDE;
virtual bool DeallocPNeckoChild(PNeckoChild*) MOZ_OVERRIDE;
virtual PExternalHelperAppChild *AllocPExternalHelperAppChild(
const OptionalURIParams& uri,
@ -147,23 +147,23 @@ public:
const bool& aForceSave,
const int64_t& aContentLength,
const OptionalURIParams& aReferrer,
PBrowserChild* aBrowser);
virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService);
PBrowserChild* aBrowser) MOZ_OVERRIDE;
virtual bool DeallocPExternalHelperAppChild(PExternalHelperAppChild *aService) MOZ_OVERRIDE;
virtual PSmsChild* AllocPSmsChild();
virtual bool DeallocPSmsChild(PSmsChild*);
virtual PSmsChild* AllocPSmsChild() MOZ_OVERRIDE;
virtual bool DeallocPSmsChild(PSmsChild*) MOZ_OVERRIDE;
virtual PTelephonyChild* AllocPTelephonyChild();
virtual bool DeallocPTelephonyChild(PTelephonyChild*);
virtual PTelephonyChild* AllocPTelephonyChild() MOZ_OVERRIDE;
virtual bool DeallocPTelephonyChild(PTelephonyChild*) MOZ_OVERRIDE;
virtual PStorageChild* AllocPStorageChild();
virtual bool DeallocPStorageChild(PStorageChild* aActor);
virtual PStorageChild* AllocPStorageChild() MOZ_OVERRIDE;
virtual bool DeallocPStorageChild(PStorageChild* aActor) MOZ_OVERRIDE;
virtual PBluetoothChild* AllocPBluetoothChild();
virtual bool DeallocPBluetoothChild(PBluetoothChild* aActor);
virtual PBluetoothChild* AllocPBluetoothChild() MOZ_OVERRIDE;
virtual bool DeallocPBluetoothChild(PBluetoothChild* aActor) MOZ_OVERRIDE;
virtual PFMRadioChild* AllocPFMRadioChild();
virtual bool DeallocPFMRadioChild(PFMRadioChild* aActor);
virtual PFMRadioChild* AllocPFMRadioChild() MOZ_OVERRIDE;
virtual bool DeallocPFMRadioChild(PFMRadioChild* aActor) MOZ_OVERRIDE;
virtual PAsmJSCacheEntryChild* AllocPAsmJSCacheEntryChild(
const asmjscache::OpenMode& aOpenMode,
@ -172,80 +172,83 @@ public:
virtual bool DeallocPAsmJSCacheEntryChild(
PAsmJSCacheEntryChild* aActor) MOZ_OVERRIDE;
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild();
virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor);
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() MOZ_OVERRIDE;
virtual bool DeallocPSpeechSynthesisChild(PSpeechSynthesisChild* aActor) MOZ_OVERRIDE;
virtual bool RecvRegisterChrome(const InfallibleTArray<ChromePackage>& packages,
const InfallibleTArray<ResourceMapping>& resources,
const InfallibleTArray<OverrideMapping>& overrides,
const nsCString& locale);
const nsCString& locale) MOZ_OVERRIDE;
virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild();
virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*);
virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() MOZ_OVERRIDE;
virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) MOZ_OVERRIDE;
virtual bool RecvSetOffline(const bool& offline);
virtual bool RecvSetOffline(const bool& offline) MOZ_OVERRIDE;
virtual bool RecvSpeakerManagerNotify();
virtual bool RecvSpeakerManagerNotify() MOZ_OVERRIDE;
virtual bool RecvNotifyVisited(const URIParams& aURI);
virtual bool RecvNotifyVisited(const URIParams& aURI) MOZ_OVERRIDE;
// auto remove when alertfinished is received.
nsresult AddRemoteAlertObserver(const nsString& aData, nsIObserver* aObserver);
virtual bool RecvPreferenceUpdate(const PrefSetting& aPref);
virtual bool RecvPreferenceUpdate(const PrefSetting& aPref) MOZ_OVERRIDE;
virtual bool RecvNotifyAlertsObserver(const nsCString& aType, const nsString& aData);
virtual bool RecvNotifyAlertsObserver(const nsCString& aType,
const nsString& aData) MOZ_OVERRIDE;
virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
const IPC::Principal& aPrincipal);
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere);
virtual bool RecvGeolocationUpdate(const GeoPosition& somewhere) MOZ_OVERRIDE;
virtual bool RecvAddPermission(const IPC::Permission& permission);
virtual bool RecvAddPermission(const IPC::Permission& permission) MOZ_OVERRIDE;
virtual bool RecvScreenSizeChanged(const gfxIntSize &size);
virtual bool RecvScreenSizeChanged(const gfxIntSize &size) MOZ_OVERRIDE;
virtual bool RecvFlushMemory(const nsString& reason);
virtual bool RecvFlushMemory(const nsString& reason) MOZ_OVERRIDE;
virtual bool RecvActivateA11y();
virtual bool RecvActivateA11y() MOZ_OVERRIDE;
virtual bool RecvGarbageCollect();
virtual bool RecvCycleCollect();
virtual bool RecvGarbageCollect() MOZ_OVERRIDE;
virtual bool RecvCycleCollect() MOZ_OVERRIDE;
virtual bool RecvAppInfo(const nsCString& version, const nsCString& buildID,
const nsCString& name, const nsCString& UAName);
const nsCString& name, const nsCString& UAName) MOZ_OVERRIDE;
virtual bool RecvLastPrivateDocShellDestroyed();
virtual bool RecvLastPrivateDocShellDestroyed() MOZ_OVERRIDE;
virtual bool RecvFilePathUpdate(const nsString& aStorageType,
const nsString& aStorageName,
const nsString& aPath,
const nsCString& aReason);
const nsCString& aReason) MOZ_OVERRIDE;
virtual bool RecvFileSystemUpdate(const nsString& aFsName,
const nsString& aVolumeName,
const int32_t& aState,
const int32_t& aMountGeneration,
const bool& aIsMediaPresent,
const bool& aIsSharing,
const bool& aIsFormatting);
const bool& aIsFormatting) MOZ_OVERRIDE;
virtual bool RecvNuwaFork() MOZ_OVERRIDE;
virtual bool RecvNotifyProcessPriorityChanged(const hal::ProcessPriority& aPriority);
virtual bool RecvMinimizeMemoryUsage();
virtual bool RecvCancelMinimizeMemoryUsage();
virtual bool
RecvNotifyProcessPriorityChanged(const hal::ProcessPriority& aPriority) MOZ_OVERRIDE;
virtual bool RecvMinimizeMemoryUsage() MOZ_OVERRIDE;
virtual bool RecvCancelMinimizeMemoryUsage() MOZ_OVERRIDE;
virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI, const uint32_t& aType);
virtual bool RecvUnregisterSheet(const URIParams& aURI, const uint32_t& aType);
virtual bool RecvLoadAndRegisterSheet(const URIParams& aURI,
const uint32_t& aType) MOZ_OVERRIDE;
virtual bool RecvUnregisterSheet(const URIParams& aURI, const uint32_t& aType) MOZ_OVERRIDE;
virtual bool RecvNotifyPhoneStateChange(const nsString& state);
virtual bool RecvNotifyPhoneStateChange(const nsString& state) MOZ_OVERRIDE;
void AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
void RemoveIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS);
virtual bool RecvNotifyIdleObserver(const uint64_t& aObserver,
const nsCString& aTopic,
const nsString& aData);
const nsString& aData) MOZ_OVERRIDE;
#ifdef ANDROID
gfxIntSize GetScreenSize() { return mScreenSize; }
#endif
@ -264,7 +267,7 @@ public:
protected:
virtual bool RecvPBrowserConstructor(PBrowserChild* actor,
const IPCTabContext& context,
const uint32_t& chromeFlags);
const uint32_t& chromeFlags) MOZ_OVERRIDE;
private:
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;

View File

@ -189,7 +189,7 @@ public:
virtual PCrashReporterParent*
AllocPCrashReporterParent(const NativeThreadId& tid,
const uint32_t& processType) MOZ_OVERRIDE;
const uint32_t& processType) MOZ_OVERRIDE;
virtual bool
RecvPCrashReporterConstructor(PCrashReporterParent* actor,
const NativeThreadId& tid,
@ -223,7 +223,7 @@ public:
const bool& aIsVideo) MOZ_OVERRIDE;
protected:
void OnChannelConnected(int32_t pid) MOZ_OVERRIDE;
virtual void ActorDestroy(ActorDestroyReason why);
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
void OnNuwaForkTimeout();
bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE;
@ -331,34 +331,36 @@ private:
bool* aIsForBrowser) MOZ_OVERRIDE;
virtual bool RecvGetXPCOMProcessAttributes(bool* aIsOffline) MOZ_OVERRIDE;
virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*);
virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*) MOZ_OVERRIDE;
virtual PBrowserParent* AllocPBrowserParent(const IPCTabContext& aContext,
const uint32_t& aChromeFlags);
virtual bool DeallocPBrowserParent(PBrowserParent* frame);
const uint32_t& aChromeFlags) MOZ_OVERRIDE;
virtual bool DeallocPBrowserParent(PBrowserParent* frame) MOZ_OVERRIDE;
virtual PDeviceStorageRequestParent* AllocPDeviceStorageRequestParent(const DeviceStorageParams&);
virtual bool DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent*);
virtual PDeviceStorageRequestParent*
AllocPDeviceStorageRequestParent(const DeviceStorageParams&) MOZ_OVERRIDE;
virtual bool DeallocPDeviceStorageRequestParent(PDeviceStorageRequestParent*) MOZ_OVERRIDE;
virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams);
virtual bool DeallocPBlobParent(PBlobParent*);
virtual PBlobParent* AllocPBlobParent(const BlobConstructorParams& aParams) MOZ_OVERRIDE;
virtual bool DeallocPBlobParent(PBlobParent*) MOZ_OVERRIDE;
virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter);
virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) MOZ_OVERRIDE;
virtual bool RecvGetRandomValues(const uint32_t& length,
InfallibleTArray<uint8_t>* randomValues);
InfallibleTArray<uint8_t>* randomValues) MOZ_OVERRIDE;
virtual bool DeallocPHalParent(PHalParent*) MOZ_OVERRIDE;
virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor);
virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor) MOZ_OVERRIDE;
virtual PMemoryReportRequestParent* AllocPMemoryReportRequestParent(const uint32_t& generation);
virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor);
virtual PMemoryReportRequestParent*
AllocPMemoryReportRequestParent(const uint32_t& generation) MOZ_OVERRIDE;
virtual bool DeallocPMemoryReportRequestParent(PMemoryReportRequestParent* actor) MOZ_OVERRIDE;
virtual PTestShellParent* AllocPTestShellParent();
virtual bool DeallocPTestShellParent(PTestShellParent* shell);
virtual PTestShellParent* AllocPTestShellParent() MOZ_OVERRIDE;
virtual bool DeallocPTestShellParent(PTestShellParent* shell) MOZ_OVERRIDE;
virtual bool DeallocPNeckoParent(PNeckoParent* necko);
virtual bool DeallocPNeckoParent(PNeckoParent* necko) MOZ_OVERRIDE;
virtual PExternalHelperAppParent* AllocPExternalHelperAppParent(
const OptionalURIParams& aUri,
@ -367,23 +369,23 @@ private:
const bool& aForceSave,
const int64_t& aContentLength,
const OptionalURIParams& aReferrer,
PBrowserParent* aBrowser);
virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService);
PBrowserParent* aBrowser) MOZ_OVERRIDE;
virtual bool DeallocPExternalHelperAppParent(PExternalHelperAppParent* aService) MOZ_OVERRIDE;
virtual PSmsParent* AllocPSmsParent();
virtual bool DeallocPSmsParent(PSmsParent*);
virtual PSmsParent* AllocPSmsParent() MOZ_OVERRIDE;
virtual bool DeallocPSmsParent(PSmsParent*) MOZ_OVERRIDE;
virtual PTelephonyParent* AllocPTelephonyParent();
virtual bool DeallocPTelephonyParent(PTelephonyParent*);
virtual PTelephonyParent* AllocPTelephonyParent() MOZ_OVERRIDE;
virtual bool DeallocPTelephonyParent(PTelephonyParent*) MOZ_OVERRIDE;
virtual bool DeallocPStorageParent(PStorageParent* aActor);
virtual bool DeallocPStorageParent(PStorageParent* aActor) MOZ_OVERRIDE;
virtual PBluetoothParent* AllocPBluetoothParent();
virtual bool DeallocPBluetoothParent(PBluetoothParent* aActor);
virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor);
virtual PBluetoothParent* AllocPBluetoothParent() MOZ_OVERRIDE;
virtual bool DeallocPBluetoothParent(PBluetoothParent* aActor) MOZ_OVERRIDE;
virtual bool RecvPBluetoothConstructor(PBluetoothParent* aActor) MOZ_OVERRIDE;
virtual PFMRadioParent* AllocPFMRadioParent();
virtual bool DeallocPFMRadioParent(PFMRadioParent* aActor);
virtual PFMRadioParent* AllocPFMRadioParent() MOZ_OVERRIDE;
virtual bool DeallocPFMRadioParent(PFMRadioParent* aActor) MOZ_OVERRIDE;
virtual PAsmJSCacheEntryParent* AllocPAsmJSCacheEntryParent(
const asmjscache::OpenMode& aOpenMode,
@ -392,32 +394,37 @@ private:
virtual bool DeallocPAsmJSCacheEntryParent(
PAsmJSCacheEntryParent* aActor) MOZ_OVERRIDE;
virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent();
virtual bool DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor);
virtual bool RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor);
virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent() MOZ_OVERRIDE;
virtual bool DeallocPSpeechSynthesisParent(PSpeechSynthesisParent* aActor) MOZ_OVERRIDE;
virtual bool RecvPSpeechSynthesisConstructor(PSpeechSynthesisParent* aActor) MOZ_OVERRIDE;
virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs);
virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue);
virtual bool RecvReadPrefsArray(InfallibleTArray<PrefSetting>* aPrefs) MOZ_OVERRIDE;
virtual bool RecvReadFontList(InfallibleTArray<FontListEntry>* retValue) MOZ_OVERRIDE;
virtual bool RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions);
virtual bool RecvReadPermissions(InfallibleTArray<IPC::Permission>* aPermissions) MOZ_OVERRIDE;
virtual bool RecvSetClipboardText(const nsString& text, const bool& isPrivateData, const int32_t& whichClipboard);
virtual bool RecvGetClipboardText(const int32_t& whichClipboard, nsString* text);
virtual bool RecvEmptyClipboard();
virtual bool RecvClipboardHasText(bool* hasText);
virtual bool RecvSetClipboardText(const nsString& text,
const bool& isPrivateData,
const int32_t& whichClipboard) MOZ_OVERRIDE;
virtual bool RecvGetClipboardText(const int32_t& whichClipboard, nsString* text) MOZ_OVERRIDE;
virtual bool RecvEmptyClipboard() MOZ_OVERRIDE;
virtual bool RecvClipboardHasText(bool* hasText) MOZ_OVERRIDE;
virtual bool RecvGetSystemColors(const uint32_t& colorsCount, InfallibleTArray<uint32_t>* colors);
virtual bool RecvGetIconForExtension(const nsCString& aFileExt, const uint32_t& aIconSize, InfallibleTArray<uint8_t>* bits);
virtual bool RecvGetShowPasswordSetting(bool* showPassword);
virtual bool RecvGetSystemColors(const uint32_t& colorsCount,
InfallibleTArray<uint32_t>* colors) MOZ_OVERRIDE;
virtual bool RecvGetIconForExtension(const nsCString& aFileExt,
const uint32_t& aIconSize,
InfallibleTArray<uint8_t>* bits) MOZ_OVERRIDE;
virtual bool RecvGetShowPasswordSetting(bool* showPassword) MOZ_OVERRIDE;
virtual bool RecvStartVisitedQuery(const URIParams& uri);
virtual bool RecvStartVisitedQuery(const URIParams& uri) MOZ_OVERRIDE;
virtual bool RecvVisitURI(const URIParams& uri,
const OptionalURIParams& referrer,
const uint32_t& flags);
const uint32_t& flags) MOZ_OVERRIDE;
virtual bool RecvSetURITitle(const URIParams& uri,
const nsString& title);
const nsString& title) MOZ_OVERRIDE;
virtual bool RecvShowFilePicker(const int16_t& mode,
const int16_t& selectedType,
@ -429,78 +436,78 @@ private:
const InfallibleTArray<nsString>& filterNames,
InfallibleTArray<nsString>* files,
int16_t* retValue,
nsresult* result);
nsresult* result) MOZ_OVERRIDE;
virtual bool RecvShowAlertNotification(const nsString& aImageUrl, const nsString& aTitle,
const nsString& aText, const bool& aTextClickable,
const nsString& aCookie, const nsString& aName,
const nsString& aBidi, const nsString& aLang,
const IPC::Principal& aPrincipal);
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
virtual bool RecvCloseAlert(const nsString& aName,
const IPC::Principal& aPrincipal);
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
virtual bool RecvLoadURIExternal(const URIParams& uri);
virtual bool RecvLoadURIExternal(const URIParams& uri) MOZ_OVERRIDE;
virtual bool RecvSyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals);
InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
virtual bool AnswerRpcMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aRetvals);
InfallibleTArray<nsString>* aRetvals) MOZ_OVERRIDE;
virtual bool RecvAsyncMessage(const nsString& aMsg,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
const IPC::Principal& aPrincipal);
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
virtual bool RecvFilePathUpdateNotify(const nsString& aType,
const nsString& aStorageName,
const nsString& aFilePath,
const nsCString& aReason);
const nsCString& aReason) MOZ_OVERRIDE;
virtual bool RecvAddGeolocationListener(const IPC::Principal& aPrincipal,
const bool& aHighAccuracy);
virtual bool RecvRemoveGeolocationListener();
virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable);
const bool& aHighAccuracy) MOZ_OVERRIDE;
virtual bool RecvRemoveGeolocationListener() MOZ_OVERRIDE;
virtual bool RecvSetGeolocationHigherAccuracy(const bool& aEnable) MOZ_OVERRIDE;
virtual bool RecvConsoleMessage(const nsString& aMessage);
virtual bool RecvConsoleMessage(const nsString& aMessage) MOZ_OVERRIDE;
virtual bool RecvScriptError(const nsString& aMessage,
const nsString& aSourceName,
const nsString& aSourceLine,
const uint32_t& aLineNumber,
const uint32_t& aColNumber,
const uint32_t& aFlags,
const nsCString& aCategory);
const nsCString& aCategory) MOZ_OVERRIDE;
virtual bool RecvPrivateDocShellsExist(const bool& aExist);
virtual bool RecvPrivateDocShellsExist(const bool& aExist) MOZ_OVERRIDE;
virtual bool RecvFirstIdle();
virtual bool RecvFirstIdle() MOZ_OVERRIDE;
virtual bool RecvAudioChannelGetState(const AudioChannelType& aType,
const bool& aElementHidden,
const bool& aElementWasHidden,
AudioChannelState* aValue);
AudioChannelState* aValue) MOZ_OVERRIDE;
virtual bool RecvAudioChannelRegisterType(const AudioChannelType& aType,
const bool& aWithVideo);
const bool& aWithVideo) MOZ_OVERRIDE;
virtual bool RecvAudioChannelUnregisterType(const AudioChannelType& aType,
const bool& aElementHidden,
const bool& aWithVideo);
const bool& aWithVideo) MOZ_OVERRIDE;
virtual bool RecvAudioChannelChangedNotification();
virtual bool RecvAudioChannelChangedNotification() MOZ_OVERRIDE;
virtual bool RecvAudioChannelChangeDefVolChannel(
const AudioChannelType& aType, const bool& aHidden);
virtual bool RecvAudioChannelChangeDefVolChannel(const AudioChannelType& aType,
const bool& aHidden) MOZ_OVERRIDE;
virtual bool RecvBroadcastVolume(const nsString& aVolumeName);
virtual bool RecvBroadcastVolume(const nsString& aVolumeName) MOZ_OVERRIDE;
virtual bool RecvSpeakerManagerGetSpeakerStatus(bool* aValue);
virtual bool RecvSpeakerManagerGetSpeakerStatus(bool* aValue) MOZ_OVERRIDE;
virtual bool RecvSpeakerManagerForceSpeaker(const bool& aEnable);
virtual bool RecvSpeakerManagerForceSpeaker(const bool& aEnable) MOZ_OVERRIDE;
virtual bool RecvSystemMessageHandled() MOZ_OVERRIDE;
@ -514,16 +521,18 @@ private:
virtual bool RecvSetFakeVolumeState(const nsString& fsName, const int32_t& fsState) MOZ_OVERRIDE;
virtual bool RecvKeywordToURI(const nsCString& aKeyword, OptionalInputStreamParams* aPostData,
OptionalURIParams* aURI);
OptionalURIParams* aURI) MOZ_OVERRIDE;
virtual void ProcessingError(Result what) MOZ_OVERRIDE;
virtual bool RecvGetGraphicsFeatureStatus(const int32_t& aFeature,
int32_t* aStatus,
bool* aSuccess);
bool* aSuccess) MOZ_OVERRIDE;
virtual bool RecvAddIdleObserver(const uint64_t& observerId, const uint32_t& aIdleTimeInS);
virtual bool RecvRemoveIdleObserver(const uint64_t& observerId, const uint32_t& aIdleTimeInS);
virtual bool RecvAddIdleObserver(const uint64_t& observerId,
const uint32_t& aIdleTimeInS) MOZ_OVERRIDE;
virtual bool RecvRemoveIdleObserver(const uint64_t& observerId,
const uint32_t& aIdleTimeInS) MOZ_OVERRIDE;
// If you add strong pointers to cycle collected objects here, be sure to
// release these objects in ShutDownProcess. See the comment there for more

View File

@ -78,12 +78,12 @@ public:
protected:
virtual bool
RecvAnnotateCrashReport(const nsCString& key, const nsCString& data) {
RecvAnnotateCrashReport(const nsCString& key, const nsCString& data) MOZ_OVERRIDE {
AnnotateCrashReport(key, data);
return true;
}
virtual bool
RecvAppendAppNotes(const nsCString& data);
RecvAppendAppNotes(const nsCString& data) MOZ_OVERRIDE;
virtual mozilla::ipc::IProtocol*
CloneProtocol(Channel* aChannel,
mozilla::ipc::ProtocolCloneContext *aCtx) MOZ_OVERRIDE;

View File

@ -209,45 +209,48 @@ public:
JS::Handle<JSObject *> aCpows,
nsIPrincipal* aPrincipal) MOZ_OVERRIDE;
virtual bool RecvLoadURL(const nsCString& uri);
virtual bool RecvLoadURL(const nsCString& uri) MOZ_OVERRIDE;
virtual bool RecvCacheFileDescriptor(const nsString& aPath,
const FileDescriptor& aFileDescriptor)
MOZ_OVERRIDE;
virtual bool RecvShow(const nsIntSize& size);
virtual bool RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size, const ScreenOrientation& orientation);
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
virtual bool RecvHandleDoubleTap(const CSSIntPoint& aPoint);
virtual bool RecvHandleSingleTap(const CSSIntPoint& aPoint);
virtual bool RecvHandleLongTap(const CSSIntPoint& aPoint);
virtual bool RecvHandleLongTapUp(const CSSIntPoint& aPoint);
virtual bool RecvNotifyTransformBegin(const ViewID& aViewId);
virtual bool RecvNotifyTransformEnd(const ViewID& aViewId);
virtual bool RecvActivate();
virtual bool RecvDeactivate();
virtual bool RecvShow(const nsIntSize& size) MOZ_OVERRIDE;
virtual bool RecvUpdateDimensions(const nsRect& rect,
const nsIntSize& size,
const ScreenOrientation& orientation) MOZ_OVERRIDE;
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
virtual bool RecvHandleDoubleTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
virtual bool RecvHandleSingleTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
virtual bool RecvHandleLongTap(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
virtual bool RecvHandleLongTapUp(const CSSIntPoint& aPoint) MOZ_OVERRIDE;
virtual bool RecvNotifyTransformBegin(const ViewID& aViewId) MOZ_OVERRIDE;
virtual bool RecvNotifyTransformEnd(const ViewID& aViewId) MOZ_OVERRIDE;
virtual bool RecvActivate() MOZ_OVERRIDE;
virtual bool RecvDeactivate() MOZ_OVERRIDE;
virtual bool RecvMouseEvent(const nsString& aType,
const float& aX,
const float& aY,
const int32_t& aButton,
const int32_t& aClickCount,
const int32_t& aModifiers,
const bool& aIgnoreRootScrollFrame);
virtual bool RecvRealMouseEvent(const mozilla::WidgetMouseEvent& event);
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event);
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event);
const bool& aIgnoreRootScrollFrame) MOZ_OVERRIDE;
virtual bool RecvRealMouseEvent(const mozilla::WidgetMouseEvent& event) MOZ_OVERRIDE;
virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& event) MOZ_OVERRIDE;
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& event) MOZ_OVERRIDE;
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
const ScrollableLayerGuid& aGuid);
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
const ScrollableLayerGuid& aGuid);
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual bool RecvKeyEvent(const nsString& aType,
const int32_t& aKeyCode,
const int32_t& aCharCode,
const int32_t& aModifiers,
const bool& aPreventDefault);
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event);
virtual bool RecvTextEvent(const mozilla::WidgetTextEvent& event);
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event);
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture);
virtual bool RecvLoadRemoteScript(const nsString& aURL, const bool& aRunInGlobalScope);
const bool& aPreventDefault) MOZ_OVERRIDE;
virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent& event) MOZ_OVERRIDE;
virtual bool RecvTextEvent(const mozilla::WidgetTextEvent& event) MOZ_OVERRIDE;
virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent& event) MOZ_OVERRIDE;
virtual bool RecvActivateFrameEvent(const nsString& aType, const bool& capture) MOZ_OVERRIDE;
virtual bool RecvLoadRemoteScript(const nsString& aURL,
const bool& aRunInGlobalScope) MOZ_OVERRIDE;
virtual bool RecvAsyncMessage(const nsString& aMessage,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
@ -257,22 +260,23 @@ public:
AllocPDocumentRendererChild(const nsRect& documentRect, const gfx::Matrix& transform,
const nsString& bgcolor,
const uint32_t& renderFlags, const bool& flushLayout,
const nsIntSize& renderSize);
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor);
const nsIntSize& renderSize) MOZ_OVERRIDE;
virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild* actor) MOZ_OVERRIDE;
virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild* actor,
const nsRect& documentRect,
const gfx::Matrix& transform,
const nsString& bgcolor,
const uint32_t& renderFlags,
const bool& flushLayout,
const nsIntSize& renderSize);
const nsIntSize& renderSize) MOZ_OVERRIDE;
virtual PContentDialogChild* AllocPContentDialogChild(const uint32_t&,
const nsCString&,
const nsCString&,
const InfallibleTArray<int>&,
const InfallibleTArray<nsString>&);
virtual bool DeallocPContentDialogChild(PContentDialogChild* aDialog);
const InfallibleTArray<nsString>&)
MOZ_OVERRIDE;
virtual bool DeallocPContentDialogChild(PContentDialogChild* aDialog) MOZ_OVERRIDE;
static void ParamsToArrays(nsIDialogParamBlock* aParams,
InfallibleTArray<int>& aIntParams,
InfallibleTArray<nsString>& aStringParams);
@ -288,16 +292,19 @@ public:
const IPC::Principal& aPrincipal);
#endif /* DEBUG */
virtual PContentPermissionRequestChild* AllocPContentPermissionRequestChild(const nsCString& aType,
const nsCString& aAccess,
const IPC::Principal& aPrincipal);
virtual bool DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor);
virtual PContentPermissionRequestChild*
AllocPContentPermissionRequestChild(const nsCString& aType,
const nsCString& aAccess,
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
virtual bool
DeallocPContentPermissionRequestChild(PContentPermissionRequestChild* actor) MOZ_OVERRIDE;
virtual POfflineCacheUpdateChild* AllocPOfflineCacheUpdateChild(
const URIParams& manifestURI,
const URIParams& documentURI,
const bool& stickDocument);
virtual bool DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate);
const bool& stickDocument) MOZ_OVERRIDE;
virtual bool
DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild* offlineCacheUpdate) MOZ_OVERRIDE;
nsIWebNavigation* WebNavigation() { return mWebNav; }
@ -376,9 +383,9 @@ protected:
virtual PIndexedDBChild* AllocPIndexedDBChild(const nsCString& aGroup,
const nsCString& aASCIIOrigin,
bool* /* aAllowed */);
bool* /* aAllowed */) MOZ_OVERRIDE;
virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor);
virtual bool DeallocPIndexedDBChild(PIndexedDBChild* aActor) MOZ_OVERRIDE;
private:
/**
@ -402,7 +409,7 @@ private:
bool UseDirectCompositor();
void ActorDestroy(ActorDestroyReason why);
void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);

View File

@ -110,81 +110,82 @@ public:
void Destroy();
virtual bool RecvMoveFocus(const bool& aForward);
virtual bool RecvEvent(const RemoteDOMEvent& aEvent);
virtual bool RecvPRenderFrameConstructor(PRenderFrameParent* actor);
virtual bool RecvMoveFocus(const bool& aForward) MOZ_OVERRIDE;
virtual bool RecvEvent(const RemoteDOMEvent& aEvent) MOZ_OVERRIDE;
virtual bool RecvPRenderFrameConstructor(PRenderFrameParent* actor) MOZ_OVERRIDE;
virtual bool RecvInitRenderFrame(PRenderFrameParent* aFrame,
ScrollingBehavior* scrolling,
TextureFactoryIdentifier* identifier,
uint64_t* layersId,
bool *aSuccess);
bool *aSuccess) MOZ_OVERRIDE;
virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
const nsString& aURL,
const nsString& aName,
const nsString& aFeatures,
bool* aOutWindowOpened);
virtual bool AnswerCreateWindow(PBrowserParent** retval);
bool* aOutWindowOpened) MOZ_OVERRIDE;
virtual bool AnswerCreateWindow(PBrowserParent** retval) MOZ_OVERRIDE;
virtual bool RecvSyncMessage(const nsString& aMessage,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aJSONRetVal);
InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
virtual bool AnswerRpcMessage(const nsString& aMessage,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
const IPC::Principal& aPrincipal,
InfallibleTArray<nsString>* aJSONRetVal);
InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
virtual bool RecvAsyncMessage(const nsString& aMessage,
const ClonedMessageData& aData,
const InfallibleTArray<CpowEntry>& aCpows,
const IPC::Principal& aPrincipal);
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
virtual bool RecvNotifyIMEFocus(const bool& aFocus,
nsIMEUpdatePreference* aPreference,
uint32_t* aSeqno);
uint32_t* aSeqno) MOZ_OVERRIDE;
virtual bool RecvNotifyIMETextChange(const uint32_t& aStart,
const uint32_t& aEnd,
const uint32_t& aNewEnd);
const uint32_t& aNewEnd) MOZ_OVERRIDE;
virtual bool RecvNotifyIMESelectedCompositionRect(const uint32_t& aOffset,
const nsIntRect& aRect,
const nsIntRect& aCaretRect) MOZ_OVERRIDE;
virtual bool RecvNotifyIMESelection(const uint32_t& aSeqno,
const uint32_t& aAnchor,
const uint32_t& aFocus);
virtual bool RecvNotifyIMETextHint(const nsString& aText);
const uint32_t& aFocus) MOZ_OVERRIDE;
virtual bool RecvNotifyIMETextHint(const nsString& aText) MOZ_OVERRIDE;
virtual bool RecvEndIMEComposition(const bool& aCancel,
nsString* aComposition);
nsString* aComposition) MOZ_OVERRIDE;
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
int32_t* aIMEOpen,
intptr_t* aNativeIMEContext);
intptr_t* aNativeIMEContext) MOZ_OVERRIDE;
virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
const int32_t& aIMEOpen,
const nsString& aType,
const nsString& aInputmode,
const nsString& aActionHint,
const int32_t& aCause,
const int32_t& aFocusChange);
virtual bool RecvRequestFocus(const bool& aCanRaise);
virtual bool RecvSetCursor(const uint32_t& aValue);
virtual bool RecvSetBackgroundColor(const nscolor& aValue);
virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus);
virtual bool RecvGetDPI(float* aValue);
virtual bool RecvGetDefaultScale(double* aValue);
virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue);
const int32_t& aFocusChange) MOZ_OVERRIDE;
virtual bool RecvRequestFocus(const bool& aCanRaise) MOZ_OVERRIDE;
virtual bool RecvSetCursor(const uint32_t& aValue) MOZ_OVERRIDE;
virtual bool RecvSetBackgroundColor(const nscolor& aValue) MOZ_OVERRIDE;
virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) MOZ_OVERRIDE;
virtual bool RecvGetDPI(float* aValue) MOZ_OVERRIDE;
virtual bool RecvGetDefaultScale(double* aValue) MOZ_OVERRIDE;
virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) MOZ_OVERRIDE;
virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
const ViewID& aViewId,
const CSSRect& aRect);
const CSSRect& aRect) MOZ_OVERRIDE;
virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
const ViewID& aViewId,
const bool& aIsRoot,
const ZoomConstraints& aConstraints);
const ZoomConstraints& aConstraints) MOZ_OVERRIDE;
virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid,
const bool& aPreventDefault);
virtual PContentDialogParent* AllocPContentDialogParent(const uint32_t& aType,
const nsCString& aName,
const nsCString& aFeatures,
const InfallibleTArray<int>& aIntParams,
const InfallibleTArray<nsString>& aStringParams);
virtual bool DeallocPContentDialogParent(PContentDialogParent* aDialog)
const bool& aPreventDefault) MOZ_OVERRIDE;
virtual PContentDialogParent*
AllocPContentDialogParent(const uint32_t& aType,
const nsCString& aName,
const nsCString& aFeatures,
const InfallibleTArray<int>& aIntParams,
const InfallibleTArray<nsString>& aStringParams) MOZ_OVERRIDE;
virtual bool DeallocPContentDialogParent(PContentDialogParent* aDialog) MOZ_OVERRIDE
{
delete aDialog;
return true;
@ -227,15 +228,20 @@ public:
bool SendHandleDoubleTap(const CSSIntPoint& aPoint);
virtual PDocumentRendererParent*
AllocPDocumentRendererParent(const nsRect& documentRect, const gfx::Matrix& transform,
AllocPDocumentRendererParent(const nsRect& documentRect,
const gfx::Matrix& transform,
const nsString& bgcolor,
const uint32_t& renderFlags, const bool& flushLayout,
const nsIntSize& renderSize);
virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor);
const uint32_t& renderFlags,
const bool& flushLayout,
const nsIntSize& renderSize) MOZ_OVERRIDE;
virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor) MOZ_OVERRIDE;
virtual PContentPermissionRequestParent*
AllocPContentPermissionRequestParent(const nsCString& aType, const nsCString& aAccess, const IPC::Principal& aPrincipal);
virtual bool DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor);
AllocPContentPermissionRequestParent(const nsCString& aType,
const nsCString& aAccess,
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
virtual bool
DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor) MOZ_OVERRIDE;
virtual POfflineCacheUpdateParent*
AllocPOfflineCacheUpdateParent(const URIParams& aManifestURI,
@ -247,10 +253,9 @@ public:
const URIParams& aDocumentURI,
const bool& stickDocument) MOZ_OVERRIDE;
virtual bool
DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor)
MOZ_OVERRIDE;
DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor) MOZ_OVERRIDE;
virtual bool RecvSetOfflinePermission(const IPC::Principal& principal);
virtual bool RecvSetOfflinePermission(const IPC::Principal& principal) MOZ_OVERRIDE;
bool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
@ -292,15 +297,15 @@ protected:
virtual PIndexedDBParent* AllocPIndexedDBParent(
const nsCString& aGroup,
const nsCString& aASCIIOrigin,
bool* /* aAllowed */);
bool* /* aAllowed */) MOZ_OVERRIDE;
virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor);
virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor) MOZ_OVERRIDE;
virtual bool
RecvPIndexedDBConstructor(PIndexedDBParent* aActor,
const nsCString& aGroup,
const nsCString& aASCIIOrigin,
bool* aAllowed);
bool* aAllowed) MOZ_OVERRIDE;
Element* mFrameElement;
nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;

View File

@ -105,7 +105,7 @@ static nsresult CompareDictionaries(JSContext* aCx, JSObject *aA,
if (bprop.isUndefined()) {
// Unknown property found in A. Bail with name
JS::Rooted<JS::Value> nameval(aCx);
bool success = JS_IdToValue(aCx, props[i], nameval.address());
bool success = JS_IdToValue(aCx, props[i], &nameval);
NS_ENSURE_TRUE(success, NS_ERROR_UNEXPECTED);
JS::Rooted<JSString*> namestr(aCx, JS::ToString(aCx, nameval));

View File

@ -38,8 +38,6 @@ PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
NPPluginFuncs* pFuncs, NPError* error)
{
JNIEnv* env = GetJNIForThread();
if (!env)
return NS_ERROR_FAILURE;
mozilla::AutoLocalJNIFrame jniFrame(env);

View File

@ -125,8 +125,6 @@ AudioRunnable::Run()
PR_SetCurrentThreadName("Android Audio");
JNIEnv* jenv = GetJNIForThread();
if (!jenv)
return NS_ERROR_FAILURE;
mozilla::AutoLocalJNIFrame autoFrame(jenv, 2);
@ -210,8 +208,6 @@ anp_audio_newTrack(uint32_t sampleRate, // sampling rate in Hz
}
JNIEnv *jenv = GetJNIForThread();
if (!jenv)
return nullptr;
s->at_class = init_jni_bindings(jenv);
s->rate = sampleRate;
@ -308,8 +304,6 @@ anp_audio_start(ANPAudioTrack* s)
}
JNIEnv *jenv = GetJNIForThread();
if (!jenv)
return;
mozilla::AutoLocalJNIFrame autoFrame(jenv, 0);
jenv->CallVoidMethod(s->output_unit, at.play);
@ -338,8 +332,6 @@ anp_audio_pause(ANPAudioTrack* s)
}
JNIEnv *jenv = GetJNIForThread();
if (!jenv)
return;
mozilla::AutoLocalJNIFrame autoFrame(jenv, 0);
jenv->CallVoidMethod(s->output_unit, at.pause);
@ -354,8 +346,6 @@ anp_audio_stop(ANPAudioTrack* s)
s->isStopped = true;
JNIEnv *jenv = GetJNIForThread();
if (!jenv)
return;
mozilla::AutoLocalJNIFrame autoFrame(jenv, 0);
jenv->CallVoidMethod(s->output_unit, at.stop);

View File

@ -899,7 +899,7 @@ nsJSObjWrapper::NP_Enumerate(NPObject *npobj, NPIdentifier **idarray,
for (uint32_t i = 0; i < *count; i++) {
JS::Rooted<JS::Value> v(cx);
if (!JS_IdToValue(cx, ida[i], v.address())) {
if (!JS_IdToValue(cx, ida[i], &v)) {
PR_Free(*idarray);
return false;
}

View File

@ -1569,10 +1569,10 @@ void nsPluginInstanceOwner::ExitFullScreen() {
void nsPluginInstanceOwner::ExitFullScreen(jobject view) {
JNIEnv* env = AndroidBridge::GetJNIEnv();
if (env && sFullScreenInstance && sFullScreenInstance->mInstance &&
if (sFullScreenInstance && sFullScreenInstance->mInstance &&
env->IsSameObject(view, (jobject)sFullScreenInstance->mInstance->GetJavaSurface())) {
sFullScreenInstance->ExitFullScreen();
}
}
}
#endif

View File

@ -643,8 +643,9 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect,
NS_ASSERTION(image->GetFormat() == CAIRO_SURFACE, "Wrong format?");
CairoImage* cairoImage = static_cast<CairoImage*>(image.get());
CairoImage::Data cairoData;
cairoData.mSurface = surface;
cairoData.mDeprecatedSurface = surface;
cairoData.mSize = surface->GetSize().ToIntSize();
cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
cairoImage->SetData(cairoData);
container->SetCurrentImage(cairoImage);

View File

@ -16,6 +16,9 @@ function checkException(func, exc)
catch (ex) {
exceptionThrew = true;
is(ex.name, exc, "Expected "+exc+" exception");
if (ex.name != exc) {
ok(true, "The exception which was thrown is: " + ex);
}
}
ok(exceptionThrew, "Exception "+exc+" threw");
}

View File

@ -190,7 +190,7 @@ InstallXBLField(JSContext* cx,
JSFlatString* fieldStr = JS_ASSERT_STRING_IS_FLAT(name.toString());
fieldName.init(fieldStr);
MOZ_ALWAYS_TRUE(JS_ValueToId(cx, name, idp.address()));
MOZ_ALWAYS_TRUE(JS_ValueToId(cx, name, idp));
// If a separate XBL scope is being used, the callee is not same-compartment
// with the xbl prototype, and the object is a cross-compartment wrapper.

View File

@ -320,7 +320,8 @@ nsXBLProtoImplAnonymousMethod::Execute(nsIContent* aBoundElement)
// Clone the function object, using thisObject as the parent so "this" is in
// the scope chain of the resulting function (for backwards compat to the
// days when this was an event handler).
JS::Rooted<JSObject*> method(cx, ::JS_CloneFunctionObject(cx, GetCompiledMethod(), thisObject));
JS::Rooted<JSObject*> jsMethodObject(cx, GetCompiledMethod());
JS::Rooted<JSObject*> method(cx, ::JS_CloneFunctionObject(cx, jsMethodObject, thisObject));
if (!method)
return NS_ERROR_OUT_OF_MEMORY;

View File

@ -312,7 +312,8 @@ nsXBLPrototypeHandler::ExecuteHandler(EventTarget* aTarget,
NS_ENSURE_SUCCESS(rv, rv);
// Next, clone the generic handler to be parented to the target.
JS::Rooted<JSObject*> bound(cx, JS_CloneFunctionObject(cx, genericHandler, &targetV.toObject()));
JS::Rooted<JSObject*> target(cx, &targetV.toObject());
JS::Rooted<JSObject*> bound(cx, JS_CloneFunctionObject(cx, genericHandler, target));
NS_ENSURE_TRUE(bound, NS_ERROR_FAILURE);
// Now, wrap the bound handler into the content compartment and use it.

View File

@ -366,6 +366,9 @@ GLContextEGL::MakeCurrentImpl(bool aForce) {
EGLSurface surface = mSurfaceOverride != EGL_NO_SURFACE
? mSurfaceOverride
: mSurface;
if (surface == EGL_NO_SURFACE) {
return false;
}
succeeded = sEGLLibrary.fMakeCurrent(EGL_DISPLAY(),
surface, surface,
mContext);
@ -414,7 +417,7 @@ GLContextEGL::RenewSurface() {
void
GLContextEGL::ReleaseSurface() {
DestroySurface(mSurface);
mSurface = nullptr;
mSurface = EGL_NO_SURFACE;
}
bool

View File

@ -675,5 +675,22 @@ RemoteBitmapImage::DeprecatedGetAsSurface()
return newSurf.forget();
}
TemporaryRef<gfx::SourceSurface>
RemoteBitmapImage::GetAsSourceSurface()
{
gfx::SurfaceFormat fmt = mFormat == RemoteImageData::BGRX32
? gfx::SurfaceFormat::B8G8R8X8
: gfx::SurfaceFormat::B8G8R8A8;
RefPtr<gfx::DataSourceSurface> newSurf = gfx::Factory::CreateDataSourceSurface(mSize, fmt);
for (int y = 0; y < mSize.height; y++) {
memcpy(newSurf->GetData() + newSurf->Stride() * y,
mData + mStride * y,
mSize.width * 4);
}
return newSurf;
}
} // namespace
} // namespace

View File

@ -41,6 +41,9 @@
* gfxASurface. When AddRefing, we assert that we're on the main thread.
* When Releasing, if we're not on the main thread, we post an event to
* the main thread to do the actual release.
*
* This should be removed after after Image::DeprecatedGetAsSurface is
* removed. It is replaced by nsMainThreadSourceSurfaceRef
*/
class nsMainThreadSurfaceRef;
@ -80,6 +83,49 @@ public:
}
};
/**
* Same purpose as nsMainThreadSurfaceRef byt holds a gfx::SourceSurface instead.
* The specialization of nsMainThreadSurfaceRef should be removed after
* Image::DeprecatedGetAsSurface is removed
*/
class nsMainThreadSourceSurfaceRef;
template <>
class nsAutoRefTraits<nsMainThreadSourceSurfaceRef> {
public:
typedef mozilla::gfx::SourceSurface* RawRef;
/**
* The XPCOM event that will do the actual release on the main thread.
*/
class SurfaceReleaser : public nsRunnable {
public:
SurfaceReleaser(RawRef aRef) : mRef(aRef) {}
NS_IMETHOD Run() {
mRef->Release();
return NS_OK;
}
RawRef mRef;
};
static RawRef Void() { return nullptr; }
static void Release(RawRef aRawRef)
{
if (NS_IsMainThread()) {
aRawRef->Release();
return;
}
nsCOMPtr<nsIRunnable> runnable = new SurfaceReleaser(aRawRef);
NS_DispatchToMainThread(runnable);
}
static void AddRef(RawRef aRawRef)
{
NS_ASSERTION(NS_IsMainThread(),
"Can only add a reference on the main thread");
aRawRef->AddRef();
}
};
#endif
#ifdef XP_WIN
@ -877,8 +923,12 @@ protected:
class CairoImage : public Image {
public:
struct Data {
gfxASurface* mSurface;
gfxASurface* mDeprecatedSurface;
gfx::IntSize mSize;
// mSourceSurface wraps mDeprrecatedSurface's data, therefore it should not
// outlive mDeprecatedSurface
RefPtr<gfx::SourceSurface> mSourceSurface;
};
/**
@ -888,14 +938,19 @@ public:
*/
void SetData(const Data& aData)
{
mSurface = aData.mSurface;
mDeprecatedSurface = aData.mDeprecatedSurface;
mSize = aData.mSize;
mSourceSurface = aData.mSourceSurface;
}
virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface()
{
return mSourceSurface.get();
}
virtual already_AddRefed<gfxASurface> DeprecatedGetAsSurface()
{
nsRefPtr<gfxASurface> surface = mSurface.get();
nsRefPtr<gfxASurface> surface = mDeprecatedSurface.get();
return surface.forget();
}
@ -903,8 +958,14 @@ public:
CairoImage() : Image(nullptr, CAIRO_SURFACE) {}
nsCountedRef<nsMainThreadSurfaceRef> mSurface;
private:
nsCountedRef<nsMainThreadSurfaceRef> mDeprecatedSurface;
gfx::IntSize mSize;
// mSourceSurface wraps mDeprrecatedSurface's data, therefore it should not
// outlive mDeprecatedSurface
nsCountedRef<nsMainThreadSourceSurfaceRef> mSourceSurface;
};
class RemoteBitmapImage : public Image {
@ -912,6 +973,7 @@ public:
RemoteBitmapImage() : Image(nullptr, REMOTE_IMAGE_BITMAP) {}
already_AddRefed<gfxASurface> DeprecatedGetAsSurface();
TemporaryRef<gfx::SourceSurface> GetAsSourceSurface();
gfx::IntSize GetSize() { return mSize; }

View File

@ -203,7 +203,17 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
apzc->NotifyLayersUpdated(container->GetFrameMetrics(),
aIsFirstPaint && (aLayersId == aFirstPaintLayersId));
// Use the composition bounds as the hit test region.
// Optionally, the GeckoContentController can provide a touch-sensitive
// region that constrains all frames associated with the controller.
// In this case we intersect the composition bounds with that region.
ScreenRect visible(container->GetFrameMetrics().mCompositionBounds);
CSSRect touchSensitiveRegion;
if (state->mController->GetTouchSensitiveRegion(&touchSensitiveRegion)) {
visible = visible.Intersect(touchSensitiveRegion
* container->GetFrameMetrics().LayersPixelsPerCSSPixel()
* LayerToScreenScale(1.0));
}
apzc->SetLayerHitTestData(visible, aTransform, aLayer->GetTransform());
APZC_LOG("Setting rect(%f %f %f %f) as visible region for APZC %p\n", visible.x, visible.y,
visible.width, visible.height,

View File

@ -127,13 +127,14 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
CairoImage *cairoImage =
static_cast<CairoImage*>(aImage);
if (!cairoImage->mSurface) {
nsRefPtr<gfxASurface> surf = cairoImage->DeprecatedGetAsSurface();
if (!surf) {
return nullptr;
}
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D10)) {
nsAutoPtr<TextureD3D10BackendData> dat(new TextureD3D10BackendData());
dat->mTexture = SurfaceToTexture(device(), cairoImage->mSurface, cairoImage->mSize);
dat->mTexture = SurfaceToTexture(device(), surf, cairoImage->GetSize());
if (dat->mTexture) {
device()->CreateShaderResourceView(dat->mTexture, nullptr, getter_AddRefs(dat->mSRView));
@ -141,7 +142,7 @@ ImageLayerD3D10::GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex
}
}
aHasAlpha = cairoImage->mSurface->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
aHasAlpha = surf->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
} else if (aImage->GetFormat() == ImageFormat::D3D9_RGB32_TEXTURE) {
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D10)) {
// Use resource sharing to open the D3D9 texture as a D3D10 texture,
@ -212,14 +213,14 @@ ImageLayerD3D10::RenderLayer()
ID3D10EffectTechnique *technique;
nsRefPtr<IDXGIKeyedMutex> keyedMutex;
nsRefPtr<gfxASurface> surf = image->DeprecatedGetAsSurface();
if (image->GetFormat() == ImageFormat::CAIRO_SURFACE ||
image->GetFormat() == ImageFormat::REMOTE_IMAGE_BITMAP ||
image->GetFormat() == ImageFormat::REMOTE_IMAGE_DXGI_TEXTURE ||
image->GetFormat() == ImageFormat::D3D9_RGB32_TEXTURE) {
NS_ASSERTION(image->GetFormat() != ImageFormat::CAIRO_SURFACE ||
!static_cast<CairoImage*>(image)->mSurface ||
static_cast<CairoImage*>(image)->mSurface->GetContentType() != GFX_CONTENT_ALPHA,
!surf || surf->GetContentType() != GFX_CONTENT_ALPHA,
"Image layer has alpha image");
bool hasAlpha = false;

View File

@ -344,19 +344,20 @@ ImageLayerD3D9::GetTexture(Image *aImage, bool& aHasAlpha)
CairoImage *cairoImage =
static_cast<CairoImage*>(aImage);
if (!cairoImage->mSurface) {
nsRefPtr<gfxASurface> surf = cairoImage->DeprecatedGetAsSurface();
if (!surf) {
return nullptr;
}
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
nsAutoPtr<TextureD3D9BackendData> dat(new TextureD3D9BackendData());
dat->mTexture = SurfaceToTexture(device(), cairoImage->mSurface, cairoImage->mSize);
dat->mTexture = SurfaceToTexture(device(), surf, cairoImage->GetSize());
if (dat->mTexture) {
aImage->SetBackendData(mozilla::layers::LAYERS_D3D9, dat.forget());
}
}
aHasAlpha = cairoImage->mSurface->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
aHasAlpha = surf->GetContentType() == GFX_CONTENT_COLOR_ALPHA;
} else if (aImage->GetFormat() == D3D9_RGB32_TEXTURE) {
if (!aImage->GetBackendData(mozilla::layers::LAYERS_D3D9)) {
// The texture in which the frame is stored belongs to DXVA's D3D9 device.
@ -413,9 +414,9 @@ ImageLayerD3D9::RenderLayer()
image->GetFormat() == REMOTE_IMAGE_BITMAP ||
image->GetFormat() == D3D9_RGB32_TEXTURE)
{
nsRefPtr<gfxASurface> surf = image->DeprecatedGetAsSurface();
NS_ASSERTION(image->GetFormat() != CAIRO_SURFACE ||
!static_cast<CairoImage*>(image)->mSurface ||
static_cast<CairoImage*>(image)->mSurface->GetContentType() != GFX_CONTENT_ALPHA,
!surf || surf->GetContentType() != GFX_CONTENT_ALPHA,
"Image layer has alpha image");
bool hasAlpha = false;

View File

@ -1570,6 +1570,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri
mFrameMetrics.mZoom.scale *= parentResolutionChange;
mFrameMetrics.mResolution = aLayerMetrics.mResolution;
mFrameMetrics.mCumulativeResolution = aLayerMetrics.mCumulativeResolution;
mFrameMetrics.mHasScrollgrab = aLayerMetrics.mHasScrollgrab;
// If the layers update was not triggered by our own repaint request, then
// we want to take the new scroll offset.

View File

@ -86,7 +86,7 @@ public:
virtual bool RecvResume() MOZ_OVERRIDE;
virtual bool RecvNotifyChildCreated(const uint64_t& child) MOZ_OVERRIDE;
virtual bool RecvMakeSnapshot(const SurfaceDescriptor& aInSnapshot,
SurfaceDescriptor* aOutSnapshot);
SurfaceDescriptor* aOutSnapshot) MOZ_OVERRIDE;
virtual bool RecvFlushRendering() MOZ_OVERRIDE;
virtual bool RecvForceComposite() MOZ_OVERRIDE;
@ -239,8 +239,8 @@ protected:
AllocPLayerTransactionParent(const nsTArray<LayersBackend>& aBackendHints,
const uint64_t& aId,
TextureFactoryIdentifier* aTextureFactoryIdentifier,
bool* aSuccess);
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers);
bool* aSuccess) MOZ_OVERRIDE;
virtual bool DeallocPLayerTransactionParent(PLayerTransactionParent* aLayers) MOZ_OVERRIDE;
virtual void ScheduleTask(CancelableTask*, int);
void Composite();
void CompositeInTransaction();

View File

@ -81,6 +81,22 @@ public:
return false;
}
/**
* APZ uses |FrameMetrics::mCompositionBounds| for hit testing. Sometimes,
* widget code has knowledge of a touch-sensitive region that should
* additionally constrain hit testing for all frames associated with the
* controller. This method allows APZ to query the controller for such a
* region. A return value of true indicates that the controller has such a
* region, and it is returned in |aOutRegion|.
* TODO: once bug 928833 is implemented, this should be removed, as
* APZ can then get the correct touch-sensitive region for each frame
* directly from the layer.
*/
virtual bool GetTouchSensitiveRegion(CSSRect* aOutRegion)
{
return false;
}
/**
* General tranformation notices for consumers. These fire any time
* the apzc is modifying the view, including panning, zooming, and

View File

@ -55,8 +55,8 @@ public:
DeallocPGrallocBufferParent(PGrallocBufferParent* actor) MOZ_OVERRIDE;
// PImageBridge
virtual bool RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply);
virtual bool RecvUpdateNoSwap(const EditArray& aEdits);
virtual bool RecvUpdate(const EditArray& aEdits, EditReplyArray* aReply) MOZ_OVERRIDE;
virtual bool RecvUpdateNoSwap(const EditArray& aEdits) MOZ_OVERRIDE;
virtual bool IsAsync() const MOZ_OVERRIDE { return true; }

View File

@ -240,6 +240,12 @@ SharedRGBImage::DeprecatedGetAsSurface()
return nullptr;
}
TemporaryRef<gfx::SourceSurface>
SharedRGBImage::GetAsSourceSurface()
{
return nullptr;
}
} // namespace layers
} // namespace mozilla

View File

@ -119,6 +119,8 @@ public:
already_AddRefed<gfxASurface> DeprecatedGetAsSurface();
TemporaryRef<gfx::SourceSurface> GetAsSourceSurface();
bool Allocate(gfx::IntSize aSize, gfx::SurfaceFormat aFormat);
private:
gfx::IntSize mSize;

View File

@ -27,15 +27,12 @@ public:
{
}
bool EnsureInitialized()
{
if (mInitialized)
return true;
JNIEnv* env = GetJNIForThread();
if (!env)
return false;
AutoLocalJNIFrame jniFrame(env);
@ -54,8 +51,6 @@ public:
return nullptr;
JNIEnv* env = GetJNIForThread();
if (!env)
return nullptr;
AutoLocalJNIFrame jniFrame(env);
@ -65,8 +60,6 @@ public:
void ReleaseSurfaceTexture(jobject aSurfaceTexture)
{
JNIEnv* env = GetJNIForThread();
if (!env)
return;
env->DeleteGlobalRef(aSurfaceTexture);
}
@ -74,8 +67,6 @@ public:
void UpdateTexImage(jobject aSurfaceTexture)
{
JNIEnv* env = GetJNIForThread();
if (!env)
return;
AutoLocalJNIFrame jniFrame(env);
env->CallObjectMethod(aSurfaceTexture, jSurfaceTexture_updateTexImage);
@ -84,8 +75,6 @@ public:
bool GetTransformMatrix(jobject aSurfaceTexture, gfx3DMatrix& aMatrix)
{
JNIEnv* env = GetJNIForThread();
if (!env)
return false;
AutoLocalJNIFrame jniFrame(env);
@ -172,8 +161,6 @@ nsSurfaceTexture::Init(GLuint aTexture)
return false;
JNIEnv* env = GetJNIForThread();
if (!env)
return false;
mSurfaceTexture = sJNIFunctions.CreateSurfaceTexture(aTexture);
if (!mSurfaceTexture)
@ -204,10 +191,8 @@ nsSurfaceTexture::~nsSurfaceTexture()
}
JNIEnv* env = GetJNIForThread();
if (!env)
return;
if (mSurfaceTexture && env) {
if (mSurfaceTexture) {
GeckoAppShell::UnregisterSurfaceTextureFrameListener(mSurfaceTexture);
env->DeleteGlobalRef(mSurfaceTexture);
@ -259,4 +244,4 @@ nsSurfaceTexture::NotifyFrameAvailable()
}
}
#endif // MOZ_WIDGET_ANDROID
#endif // MOZ_WIDGET_ANDROID

View File

@ -953,9 +953,10 @@ RasterImage::GetCurrentImage()
}
CairoImage::Data cairoData;
cairoData.mSurface = imageSurface;
cairoData.mDeprecatedSurface = imageSurface;
GetWidth(&cairoData.mSize.width);
GetHeight(&cairoData.mSize.height);
cairoData.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, imageSurface);
ImageFormat cairoFormat = CAIRO_SURFACE;
nsRefPtr<layers::Image> image = mImageContainer->CreateImage(&cairoFormat, 1);
@ -2926,7 +2927,7 @@ RasterImage::RequestDecodeIfNeeded(nsresult aStatus,
// If we were a size decode and a full decode was requested, now's the time.
if (NS_SUCCEEDED(aStatus) &&
aIntent != eShutdownIntent_Error &&
aIntent == eShutdownIntent_Done &&
aDone &&
aWasSize &&
mWantFullDecode) {

View File

@ -105,7 +105,9 @@ MessagePump::Run(MessagePump::Delegate* aDelegate)
// This processes messages in the Android Looper. Note that we only
// get here if the normal Gecko event loop has been awoken above.
// Bug 750713
did_work |= GeckoAppShell::PumpMessageLoop();
if (MOZ_LIKELY(AndroidBridge::HasEnv())) {
did_work |= GeckoAppShell::PumpMessageLoop();
}
#endif
did_work |= aDelegate->DoDelayedWork(&delayed_work_time_);

View File

@ -25,49 +25,49 @@ class JavaScriptChild
bool init();
void trace(JSTracer *trc);
bool RecvDropObject(const ObjectId &objId);
bool RecvDropObject(const ObjectId &objId) MOZ_OVERRIDE;
bool AnswerPreventExtensions(const ObjectId &objId, ReturnStatus *rs);
bool AnswerPreventExtensions(const ObjectId &objId, ReturnStatus *rs) MOZ_OVERRIDE;
bool AnswerGetPropertyDescriptor(const ObjectId &objId, const nsString &id,
const uint32_t &flags, ReturnStatus *rs,
PPropertyDescriptor *out);
PPropertyDescriptor *out) MOZ_OVERRIDE;
bool AnswerGetOwnPropertyDescriptor(const ObjectId &objId,
const nsString &id,
const uint32_t &flags,
ReturnStatus *rs,
PPropertyDescriptor *out);
PPropertyDescriptor *out) MOZ_OVERRIDE;
bool AnswerDefineProperty(const ObjectId &objId, const nsString &id,
const PPropertyDescriptor &flags,
ReturnStatus *rs);
ReturnStatus *rs) MOZ_OVERRIDE;
bool AnswerDelete(const ObjectId &objId, const nsString &id,
ReturnStatus *rs, bool *success);
ReturnStatus *rs, bool *success) MOZ_OVERRIDE;
bool AnswerHas(const ObjectId &objId, const nsString &id,
ReturnStatus *rs, bool *bp);
ReturnStatus *rs, bool *bp) MOZ_OVERRIDE;
bool AnswerHasOwn(const ObjectId &objId, const nsString &id,
ReturnStatus *rs, bool *bp);
ReturnStatus *rs, bool *bp) MOZ_OVERRIDE;
bool AnswerGet(const ObjectId &objId, const ObjectId &receiverId,
const nsString &id,
ReturnStatus *rs, JSVariant *result);
ReturnStatus *rs, JSVariant *result) MOZ_OVERRIDE;
bool AnswerSet(const ObjectId &objId, const ObjectId &receiverId,
const nsString &id, const bool &strict,
const JSVariant &value, ReturnStatus *rs, JSVariant *result);
const JSVariant &value, ReturnStatus *rs, JSVariant *result) MOZ_OVERRIDE;
bool AnswerIsExtensible(const ObjectId &objId, ReturnStatus *rs,
bool *result);
bool *result) MOZ_OVERRIDE;
bool AnswerCall(const ObjectId &objId, const nsTArray<JSParam> &argv,
ReturnStatus *rs, JSVariant *result,
nsTArray<JSParam> *outparams);
nsTArray<JSParam> *outparams) MOZ_OVERRIDE;
bool AnswerObjectClassIs(const ObjectId &objId, const uint32_t &classValue,
bool *result);
bool AnswerClassName(const ObjectId &objId, nsString *result);
bool *result) MOZ_OVERRIDE;
bool AnswerClassName(const ObjectId &objId, nsString *result) MOZ_OVERRIDE;
bool AnswerGetPropertyNames(const ObjectId &objId, const uint32_t &flags,
ReturnStatus *rs, nsTArray<nsString> *names);
ReturnStatus *rs, nsTArray<nsString> *names) MOZ_OVERRIDE;
bool AnswerInstanceOf(const ObjectId &objId, const JSIID &iid,
ReturnStatus *rs, bool *instanceof);
ReturnStatus *rs, bool *instanceof) MOZ_OVERRIDE;
bool AnswerDOMInstanceOf(const ObjectId &objId, const int &prototypeID, const int &depth,
ReturnStatus *rs, bool *instanceof);
ReturnStatus *rs, bool *instanceof) MOZ_OVERRIDE;
protected:
JSObject *unwrap(JSContext *cx, ObjectId id);

View File

@ -137,7 +137,7 @@ bool
JavaScriptShared::convertIdToGeckoString(JSContext *cx, JS::HandleId id, nsString *to)
{
RootedValue idval(cx);
if (!JS_IdToValue(cx, id, idval.address()))
if (!JS_IdToValue(cx, id, &idval))
return false;
RootedString str(cx, ToString(cx, idval));
@ -159,7 +159,7 @@ JavaScriptShared::convertGeckoStringToId(JSContext *cx, const nsString &from, JS
if (!str)
return false;
return JS_ValueToId(cx, StringValue(str), to.address());
return JS_ValueToId(cx, StringValue(str), to);
}
bool

View File

@ -502,7 +502,7 @@ jsd_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* nameStr)
/* Not found in property list, look it up explicitly */
nameval = STRING_TO_JSVAL(name);
if(!JS_ValueToId(cx, nameval, nameid.address()))
if(!JS_ValueToId(cx, nameval, &nameid))
return nullptr;
if(!(obj = JSVAL_TO_OBJECT(jsdval->val)))
@ -544,7 +544,7 @@ jsd_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* nameStr)
}
}
if (!JS_IdToValue(cx, nameid, propId.address()))
if (!JS_IdToValue(cx, nameid, &propId))
return nullptr;
propAlias = JSVAL_NULL;

View File

@ -12,7 +12,7 @@
*/
#include "mozilla/NullPtr.h"
#include "jsbytecode.h"
#include "js/CallArgs.h"
@ -143,7 +143,7 @@ extern JS_PUBLIC_API(JSCompartment *)
JS_EnterCompartmentOfScript(JSContext *cx, JSScript *target);
extern JS_PUBLIC_API(JSString *)
JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);
JS_DecompileScript(JSContext *cx, JS::HandleScript script, const char *name, unsigned indent);
/*
* Currently, we only support runtime-wide debugging. In the future, we should

View File

@ -3373,10 +3373,14 @@ fi
dnl ========================================================
dnl = Use exact stack rooting for GC
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(exact-rooting,
[ --enable-exact-rooting Enable use of exact stack roots for GC],
JSGC_USE_EXACT_ROOTING=1,
JSGC_USE_EXACT_ROOTING= )
dnl Use exact rooting by default in all shell builds. The top-level mozilla
dnl configure.in will configure SpiderMonkey with --disable-exact-rooting as
dnl needed on a per-platform basis.
JSGC_USE_EXACT_ROOTING=1
MOZ_ARG_DISABLE_BOOL(exact-rooting,
[ --disable-exact-rooting Enable use of conservative stack scanning for GC],
JSGC_USE_EXACT_ROOTING= ,
JSGC_USE_EXACT_ROOTING=1 )
if test -n "$JSGC_USE_EXACT_ROOTING"; then
AC_DEFINE(JSGC_USE_EXACT_ROOTING)
fi

View File

@ -6516,7 +6516,9 @@ frontend::EmitTree(ExclusiveContext *cx, BytecodeEmitter *bce, ParseNode *pn)
uint32_t slot = bce->arrayCompDepth;
if (!AdjustBlockSlot(cx, bce, &slot))
return false;
if (!EmitUnaliasedVarOp(cx, pn->getOp(), slot, bce))
if (!EmitUnaliasedVarOp(cx, JSOP_GETLOCAL, slot, bce))
return false;
if (Emit1(cx, bce, JSOP_ARRAYPUSH) < 0)
return false;
break;
}

View File

@ -4,12 +4,12 @@
FRAGMENT(JSObject, simple) {
JS::Rooted<JSObject *> glob(cx, JS::CurrentGlobalOrNull(cx));
JS::Rooted<JSObject *> plain(cx, JS_NewObject(cx, nullptr, JS::NullPtr(), JS::NullPtr()));
JS::Rooted<JSObject *> global(cx, JS::CurrentGlobalOrNull(cx));
JS::Rooted<JSObject *> func(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
JS::CurrentGlobalOrNull(cx), "dys"));
JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0,
JS::CurrentGlobalOrNull(cx), 0));
global, "dys"));
JS::Rooted<JSObject *> anon(cx, (JSObject *) JS_NewFunction(cx, (JSNative) 1, 0, 0, global, 0));
JS::Rooted<JSFunction *> funcPtr(cx, JS_NewFunction(cx, (JSNative) 1, 0, 0,
JS::CurrentGlobalOrNull(cx), "formFollows"));
global, "formFollows"));
JSObject &plainRef = *plain;
JSFunction &funcRef = *funcPtr;

View File

@ -0,0 +1,8 @@
setJitCompilerOption("ion.usecount.trigger", 20);
Function.prototype.__proto__ = new Boolean({ get: function() {} }, {});
function g(x, y) {}
function f() {
g.apply(this, arguments);
}
for (var i = 0; i < 130; ++i)
f(i, i*2);

View File

@ -10,6 +10,7 @@
# include <sys/mman.h>
#endif
#include "mozilla/Compression.h"
#include "mozilla/PodOperations.h"
#include "jslibmath.h"
@ -32,6 +33,7 @@ using namespace js;
using namespace jit;
using namespace frontend;
using mozilla::PodEqual;
using mozilla::Compression::LZ4;
void
AsmJSModule::initHeap(Handle<ArrayBufferObject*> heap, JSContext *cx)
@ -814,8 +816,7 @@ struct PropertyNameWrapper
class ModuleChars
{
uint32_t length_;
const jschar *begin_;
protected:
uint32_t isFunCtor_;
js::Vector<PropertyNameWrapper, 0, SystemAllocPolicy> funCtorArgs_;
@ -827,8 +828,34 @@ class ModuleChars
static uint32_t endOffset(AsmJSParser &parser) {
return parser.tokenStream.peekTokenPos().end;
}
};
class ModuleCharsForStore : ModuleChars
{
uint32_t uncompressedSize_;
uint32_t compressedSize_;
js::Vector<char, 0, SystemAllocPolicy> compressedBuffer_;
public:
bool init(AsmJSParser &parser, const AsmJSModule &module) {
JS_ASSERT(beginOffset(parser) < endOffset(parser));
uncompressedSize_ = (endOffset(parser) - beginOffset(parser)) * sizeof(jschar);
size_t maxCompressedSize = LZ4::maxCompressedSize(uncompressedSize_);
if (maxCompressedSize < uncompressedSize_)
return false;
if (!compressedBuffer_.resize(maxCompressedSize))
return false;
const jschar *chars = parser.tokenStream.rawBase() + beginOffset(parser);
const char *source = reinterpret_cast<const char*>(chars);
size_t compressedSize = LZ4::compress(source, uncompressedSize_, compressedBuffer_.begin());
if (!compressedSize || compressedSize > UINT32_MAX)
return false;
compressedSize_ = compressedSize;
bool initFromParsedModule(AsmJSParser &parser, const AsmJSModule &module) {
// For a function statement or named function expression:
// function f(x,y,z) { abc }
// the range [beginOffset, endOffset) captures the source:
@ -841,9 +868,6 @@ class ModuleChars
// For functions created with 'new Function', function arguments are
// not present in the source so we must manually explicitly serialize
// and match the formals as a Vector of PropertyName.
JS_ASSERT(beginOffset(parser) < endOffset(parser));
begin_ = parser.tokenStream.rawBase() + beginOffset(parser);
length_ = endOffset(parser) - beginOffset(parser);
isFunCtor_ = parser.pc->isFunctionConstructorBody();
if (isFunCtor_) {
unsigned numArgs;
@ -853,42 +877,65 @@ class ModuleChars
return false;
}
}
return true;
}
size_t serializedSize() const {
return sizeof(uint32_t) +
length_ * sizeof(jschar) +
sizeof(uint32_t) +
compressedSize_ +
sizeof(uint32_t) +
(isFunCtor_ ? SerializedVectorSize(funCtorArgs_) : 0);
}
uint8_t *serialize(uint8_t *cursor) const {
cursor = WriteScalar<uint32_t>(cursor, length_);
cursor = WriteBytes(cursor, begin_, length_ * sizeof(jschar));
cursor = WriteScalar<uint32_t>(cursor, uncompressedSize_);
cursor = WriteScalar<uint32_t>(cursor, compressedSize_);
cursor = WriteBytes(cursor, compressedBuffer_.begin(), compressedSize_);
cursor = WriteScalar<uint32_t>(cursor, isFunCtor_);
if (isFunCtor_)
cursor = SerializeVector(cursor, funCtorArgs_);
return cursor;
}
};
class ModuleCharsForLookup : ModuleChars
{
js::Vector<jschar, 0, SystemAllocPolicy> chars_;
public:
const uint8_t *deserialize(ExclusiveContext *cx, const uint8_t *cursor) {
cursor = ReadScalar<uint32_t>(cursor, &length_);
begin_ = reinterpret_cast<const jschar *>(cursor);
cursor += length_ * sizeof(jschar);
uint32_t uncompressedSize;
cursor = ReadScalar<uint32_t>(cursor, &uncompressedSize);
uint32_t compressedSize;
cursor = ReadScalar<uint32_t>(cursor, &compressedSize);
if (!chars_.resize(uncompressedSize / sizeof(jschar)))
return nullptr;
const char *source = reinterpret_cast<const char*>(cursor);
char *dest = reinterpret_cast<char*>(chars_.begin());
if (!LZ4::decompress(source, dest, uncompressedSize))
return nullptr;
cursor += compressedSize;
cursor = ReadScalar<uint32_t>(cursor, &isFunCtor_);
if (isFunCtor_)
cursor = DeserializeVector(cx, cursor, &funCtorArgs_);
return cursor;
}
bool matchUnparsedModule(AsmJSParser &parser) const {
bool match(AsmJSParser &parser) const {
const jschar *parseBegin = parser.tokenStream.rawBase() + beginOffset(parser);
const jschar *parseLimit = parser.tokenStream.rawLimit();
JS_ASSERT(parseLimit >= parseBegin);
if (uint32_t(parseLimit - parseBegin) < length_)
if (uint32_t(parseLimit - parseBegin) < chars_.length())
return false;
if (!PodEqual(begin_, parseBegin, length_))
if (!PodEqual(chars_.begin(), parseBegin, chars_.length()))
return false;
if (isFunCtor_ != parser.pc->isFunctionConstructorBody())
return false;
@ -900,7 +947,7 @@ class ModuleChars
// new Function('"use asm"; function f() {} return f')
// from incorrectly matching
// new Function('"use asm"; function f() {} return ff')
if (parseBegin + length_ != parseLimit)
if (parseBegin + chars_.length() != parseLimit)
return false;
unsigned numArgs;
ParseNode *arg = FunctionArgsList(parser.pc->maybeFunction, &numArgs);
@ -942,8 +989,8 @@ js::StoreAsmJSModuleInCache(AsmJSParser &parser,
if (!machineId.extractCurrentState(cx))
return false;
ModuleChars moduleChars;
if (!moduleChars.initFromParsedModule(parser, module))
ModuleCharsForStore moduleChars;
if (!moduleChars.init(parser, module))
return false;
size_t serializedSize = machineId.serializedSize() +
@ -1021,9 +1068,9 @@ js::LookupAsmJSModuleInCache(ExclusiveContext *cx,
if (machineId != cachedMachineId)
return true;
ModuleChars moduleChars;
ModuleCharsForLookup moduleChars;
cursor = moduleChars.deserialize(cx, cursor);
if (!moduleChars.matchUnparsedModule(parser))
if (!moduleChars.match(parser))
return true;
ScopedJSDeletePtr<AsmJSModule> module(

View File

@ -5092,7 +5092,7 @@ IonBuilder::testShouldDOMCall(types::TypeSet *inTypes,
compartment->runtime()->DOMcallbacks()->instanceClassMatchesProto;
const JSJitInfo *jinfo = func->jitInfo();
if (jinfo->type != opType)
if (jinfo->type() != opType)
return false;
for (unsigned i = 0; i < inTypes->getObjectCount(); i++) {
@ -5243,16 +5243,16 @@ DOMCallNeedsBarrier(const JSJitInfo* jitinfo, types::TemporaryTypeSet *types)
{
// If the return type of our DOM native is in "types" already, we don't
// actually need a barrier.
if (jitinfo->returnType == JSVAL_TYPE_UNKNOWN)
if (jitinfo->returnType() == JSVAL_TYPE_UNKNOWN)
return true;
// JSVAL_TYPE_OBJECT doesn't tell us much; we still have to barrier on the
// actual type of the object.
if (jitinfo->returnType == JSVAL_TYPE_OBJECT)
if (jitinfo->returnType() == JSVAL_TYPE_OBJECT)
return true;
// No need for a barrier if we're already expecting the type we'll produce.
return jitinfo->returnType != types->getKnownTypeTag();
return jitinfo->returnType() != types->getKnownTypeTag();
}
bool
@ -6225,12 +6225,12 @@ IonBuilder::pushDOMTypeBarrier(MInstruction *ins, types::TemporaryTypeSet *obser
// JSValueType than codegen can, short of jitinfo->returnType just being
// JSVAL_TYPE_UNKNOWN.
MDefinition* replace = ins;
if (jitinfo->returnType != JSVAL_TYPE_DOUBLE ||
if (jitinfo->returnType() != JSVAL_TYPE_DOUBLE ||
observed->getKnownTypeTag() != JSVAL_TYPE_INT32) {
JS_ASSERT(jitinfo->returnType == JSVAL_TYPE_UNKNOWN ||
JS_ASSERT(jitinfo->returnType() == JSVAL_TYPE_UNKNOWN ||
observed->getKnownTypeTag() == JSVAL_TYPE_UNKNOWN ||
jitinfo->returnType == observed->getKnownTypeTag());
replace = ensureDefiniteType(ins, jitinfo->returnType);
jitinfo->returnType() == observed->getKnownTypeTag());
replace = ensureDefiniteType(ins, jitinfo->returnType());
if (replace != ins) {
current->pop();
current->push(replace);
@ -8835,7 +8835,7 @@ IonBuilder::setPropTryCommonDOMSetter(bool *emitted, MDefinition *obj,
return true;
// Emit SetDOMProperty.
JS_ASSERT(setter->jitInfo()->type == JSJitInfo::Setter);
JS_ASSERT(setter->jitInfo()->type() == JSJitInfo::Setter);
MSetDOMProperty *set = MSetDOMProperty::New(alloc(), setter->jitInfo()->setter, obj, value);
current->add(set);

View File

@ -964,6 +964,7 @@ class CallInfo
}
void setImplicitlyUsedUnchecked() {
fun_->setImplicitlyUsedUnchecked();
thisArg_->setImplicitlyUsedUnchecked();
for (uint32_t i = 0; i < argc(); i++)
getArg(i)->setImplicitlyUsedUnchecked();

View File

@ -196,6 +196,7 @@ IonBuilder::inlineMathFunction(CallInfo &callInfo, MMathFunction::Function funct
if (!cache)
return InliningStatus_NotInlined;
callInfo.fun()->setImplicitlyUsedUnchecked();
callInfo.thisArg()->setImplicitlyUsedUnchecked();
MMathFunction *ins = MMathFunction::New(alloc(), callInfo.getArg(0), function, cache);
@ -246,6 +247,9 @@ IonBuilder::inlineArray(CallInfo &callInfo)
initLength = arg->toConstant()->value().toInt32();
if (initLength >= JSObject::NELEMENTS_LIMIT)
return InliningStatus_NotInlined;
if (initLength <= ArrayObject::EagerAllocationMaxLength)
allocating = MNewArray::NewArray_Allocating;
}
callInfo.setImplicitlyUsedUnchecked();

View File

@ -671,11 +671,11 @@ MCallDOMNative::getAliasSet() const
const JSJitInfo *jitInfo = getSingleTarget()->jitInfo();
JS_ASSERT(jitInfo);
JS_ASSERT(jitInfo->aliasSet != JSJitInfo::AliasNone);
JS_ASSERT(jitInfo->aliasSet() != JSJitInfo::AliasNone);
// If we don't know anything about the types of our arguments, we have to
// assume that type-coercions can have side-effects, so we need to alias
// everything.
if (jitInfo->aliasSet != JSJitInfo::AliasDOMSets || !jitInfo->isTypedMethodJitInfo())
if (jitInfo->aliasSet() != JSJitInfo::AliasDOMSets || !jitInfo->isTypedMethodJitInfo())
return AliasSet::Store(AliasSet::Any);
uint32_t argIndex = 0;
@ -723,7 +723,7 @@ MCallDOMNative::computeMovable()
JS_ASSERT(jitInfo);
JS_ASSERT_IF(jitInfo->isMovable,
jitInfo->aliasSet != JSJitInfo::AliasEverything);
jitInfo->aliasSet() != JSJitInfo::AliasEverything);
if (jitInfo->isMovable && !isEffectful())
setMovable();

View File

@ -7918,7 +7918,7 @@ class MGetDOMProperty
: info_(jitinfo)
{
JS_ASSERT(jitinfo);
JS_ASSERT(jitinfo->type == JSJitInfo::Getter);
JS_ASSERT(jitinfo->type() == JSJitInfo::Getter);
setOperand(0, obj);
@ -7927,7 +7927,7 @@ class MGetDOMProperty
// We are movable iff the jitinfo says we can be.
if (isDomMovable()) {
JS_ASSERT(jitinfo->aliasSet != JSJitInfo::AliasEverything);
JS_ASSERT(jitinfo->aliasSet() != JSJitInfo::AliasEverything);
setMovable();
}
@ -7957,7 +7957,7 @@ class MGetDOMProperty
return info_->isMovable;
}
JSJitInfo::AliasSet domAliasSet() const {
return info_->aliasSet;
return info_->aliasSet();
}
size_t domMemberSlotIndex() const {
MOZ_ASSERT(info_->isInSlot);

View File

@ -22,12 +22,12 @@ BEGIN_TEST(testDefineGetterSetterNonEnumerable)
CHECK(obj);
vobj = OBJECT_TO_JSVAL(obj);
JSFunction *funGet = JS_NewFunction(cx, NativeGetterSetter, 0, 0, nullptr, "get");
JSFunction *funGet = JS_NewFunction(cx, NativeGetterSetter, 0, 0, JS::NullPtr(), "get");
CHECK(funGet);
JS::RootedObject funGetObj(cx, JS_GetFunctionObject(funGet));
JS::RootedValue vget(cx, OBJECT_TO_JSVAL(funGetObj));
JSFunction *funSet = JS_NewFunction(cx, NativeGetterSetter, 1, 0, nullptr, "set");
JSFunction *funSet = JS_NewFunction(cx, NativeGetterSetter, 1, 0, JS::NullPtr(), "set");
CHECK(funSet);
JS::RootedObject funSetObj(cx, JS_GetFunctionObject(funSet));
JS::RootedValue vset(cx, OBJECT_TO_JSVAL(funSetObj));

View File

@ -55,7 +55,7 @@ document_resolve(JSContext *cx, JS::HandleObject obj, JS::HandleId id, unsigned
{
// If id is "all", resolve document.all=true.
JS::RootedValue v(cx);
if (!JS_IdToValue(cx, id, v.address()))
if (!JS_IdToValue(cx, id, &v))
return false;
if (JSVAL_IS_STRING(v)) {
JSString *str = JSVAL_TO_STRING(v);

View File

@ -2225,28 +2225,22 @@ JS_DestroyIdArray(JSContext *cx, JSIdArray *ida)
}
JS_PUBLIC_API(bool)
JS_ValueToId(JSContext *cx, jsval valueArg, jsid *idp)
JS_ValueToId(JSContext *cx, jsval valueArg, MutableHandleId idp)
{
RootedValue value(cx, valueArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, value);
RootedId id(cx);
if (!ValueToId<CanGC>(cx, value, &id))
return false;
*idp = id;
return true;
return ValueToId<CanGC>(cx, value, idp);
}
JS_PUBLIC_API(bool)
JS_IdToValue(JSContext *cx, jsid id, jsval *vp)
JS_IdToValue(JSContext *cx, jsid id, MutableHandleValue vp)
{
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
*vp = IdToJsval(id);
assertSameCompartment(cx, *vp);
vp.set(IdToJsval(id));
assertSameCompartment(cx, vp);
return true;
}
@ -2661,20 +2655,17 @@ JS_GetObjectRuntime(JSObject *obj)
}
JS_PUBLIC_API(bool)
JS_FreezeObject(JSContext *cx, JSObject *objArg)
JS_FreezeObject(JSContext *cx, HandleObject obj)
{
RootedObject obj(cx, objArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, obj);
return JSObject::freeze(cx, obj);
}
JS_PUBLIC_API(bool)
JS_DeepFreezeObject(JSContext *cx, JSObject *objArg)
JS_DeepFreezeObject(JSContext *cx, HandleObject obj)
{
RootedObject obj(cx, objArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, obj);
@ -3685,10 +3676,8 @@ static const Class prop_iter_class = {
};
JS_PUBLIC_API(JSObject *)
JS_NewPropertyIterator(JSContext *cx, JSObject *objArg)
JS_NewPropertyIterator(JSContext *cx, HandleObject obj)
{
RootedObject obj(cx, objArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, obj);
@ -3717,10 +3706,8 @@ JS_NewPropertyIterator(JSContext *cx, JSObject *objArg)
}
JS_PUBLIC_API(bool)
JS_NextProperty(JSContext *cx, JSObject *iterobjArg, jsid *idp)
JS_NextProperty(JSContext *cx, HandleObject iterobj, jsid *idp)
{
RootedObject iterobj(cx, iterobjArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, iterobj);
@ -3789,9 +3776,8 @@ JS_IsArrayObject(JSContext *cx, JSObject *objArg)
}
JS_PUBLIC_API(bool)
JS_GetArrayLength(JSContext *cx, JSObject *objArg, uint32_t *lengthp)
JS_GetArrayLength(JSContext *cx, HandleObject obj, uint32_t *lengthp)
{
RootedObject obj(cx, objArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, obj);
@ -3799,9 +3785,8 @@ JS_GetArrayLength(JSContext *cx, JSObject *objArg, uint32_t *lengthp)
}
JS_PUBLIC_API(bool)
JS_SetArrayLength(JSContext *cx, JSObject *objArg, uint32_t length)
JS_SetArrayLength(JSContext *cx, HandleObject obj, uint32_t length)
{
RootedObject obj(cx, objArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, obj);
@ -3809,19 +3794,13 @@ JS_SetArrayLength(JSContext *cx, JSObject *objArg, uint32_t length)
}
JS_PUBLIC_API(bool)
JS_CheckAccess(JSContext *cx, JSObject *objArg, jsid idArg, JSAccessMode mode,
jsval *vp, unsigned *attrsp)
JS_CheckAccess(JSContext *cx, HandleObject obj, HandleId id, JSAccessMode mode,
MutableHandleValue vp, unsigned *attrsp)
{
RootedObject obj(cx, objArg);
RootedId id(cx, idArg);
RootedValue value(cx, *vp);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, obj, id);
bool status = CheckAccess(cx, obj, id, mode, &value, attrsp);
*vp = value;
return status;
return CheckAccess(cx, obj, id, mode, vp, attrsp);
}
JS_PUBLIC_API(void)
@ -3867,9 +3846,8 @@ JS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPri
JS_PUBLIC_API(JSFunction *)
JS_NewFunction(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,
JSObject *parentArg, const char *name)
HandleObject parent, const char *name)
{
RootedObject parent(cx, parentArg);
JS_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
AssertHeapIsIdle(cx);
@ -3888,10 +3866,9 @@ JS_NewFunction(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,
}
JS_PUBLIC_API(JSFunction *)
JS_NewFunctionById(JSContext *cx, JSNative native, unsigned nargs, unsigned flags, JSObject *parentArg,
jsid id)
JS_NewFunctionById(JSContext *cx, JSNative native, unsigned nargs, unsigned flags,
HandleObject parent, HandleId id)
{
RootedObject parent(cx, parentArg);
JS_ASSERT(JSID_IS_STRING(id));
JS_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
JS_ASSERT(native);
@ -3905,7 +3882,7 @@ JS_NewFunctionById(JSContext *cx, JSNative native, unsigned nargs, unsigned flag
}
JS_PUBLIC_API(JSFunction *)
JS::GetSelfHostedFunction(JSContext *cx, const char *selfHostedName, jsid id, unsigned nargs)
JS::GetSelfHostedFunction(JSContext *cx, const char *selfHostedName, HandleId id, unsigned nargs)
{
JS_ASSERT(JSID_IS_STRING(id));
JS_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
@ -3923,10 +3900,10 @@ JS::GetSelfHostedFunction(JSContext *cx, const char *selfHostedName, jsid id, un
}
JS_PUBLIC_API(JSObject *)
JS_CloneFunctionObject(JSContext *cx, JSObject *funobjArg, JSObject *parentArg)
JS_CloneFunctionObject(JSContext *cx, HandleObject funobj, HandleObject parentArg)
{
RootedObject funobj(cx, funobjArg);
RootedObject parent(cx, parentArg);
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, parent);
@ -4024,9 +4001,8 @@ JS_IsConstructor(JSFunction *fun)
}
JS_PUBLIC_API(JSObject*)
JS_BindCallable(JSContext *cx, JSObject *targetArg, JSObject *newThis)
JS_BindCallable(JSContext *cx, HandleObject target, HandleObject newThis)
{
RootedObject target(cx, targetArg);
RootedValue thisArg(cx, ObjectValue(*newThis));
return js_fun_bind(cx, target, thisArg, nullptr, 0);
}
@ -4060,14 +4036,13 @@ js_generic_native_method_dispatcher(JSContext *cx, unsigned argc, Value *vp)
}
JS_PUBLIC_API(bool)
JS_DefineFunctions(JSContext *cx, JSObject *objArg, const JSFunctionSpec *fs)
JS_DefineFunctions(JSContext *cx, HandleObject obj, const JSFunctionSpec *fs)
{
JS_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, objArg);
assertSameCompartment(cx, obj);
RootedObject obj(cx, objArg);
RootedObject ctor(cx);
for (; fs->name; fs++) {
@ -4512,9 +4487,8 @@ JS_CompileUCScript(JSContext *cx, JS::HandleObject obj, const jschar *chars,
}
JS_PUBLIC_API(bool)
JS_BufferIsCompilableUnit(JSContext *cx, JSObject *objArg, const char *utf8, size_t length)
JS_BufferIsCompilableUnit(JSContext *cx, HandleObject obj, const char *utf8, size_t length)
{
RootedObject obj(cx, objArg);
bool result;
JSExceptionState *exnState;
JSErrorReporter older;
@ -4642,13 +4616,12 @@ JS_CompileFunction(JSContext *cx, JS::HandleObject obj, const char *name,
}
JS_PUBLIC_API(JSString *)
JS_DecompileScript(JSContext *cx, JSScript *scriptArg, const char *name, unsigned indent)
JS_DecompileScript(JSContext *cx, HandleScript script, const char *name, unsigned indent)
{
JS_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
RootedScript script(cx, scriptArg);
script->ensureNonLazyCanonicalFunction(cx);
RootedFunction fun(cx, script->functionNonDelazifying());
if (fun)
@ -4660,24 +4633,22 @@ JS_DecompileScript(JSContext *cx, JSScript *scriptArg, const char *name, unsigne
}
JS_PUBLIC_API(JSString *)
JS_DecompileFunction(JSContext *cx, JSFunction *funArg, unsigned indent)
JS_DecompileFunction(JSContext *cx, HandleFunction fun, unsigned indent)
{
JS_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, funArg);
RootedFunction fun(cx, funArg);
assertSameCompartment(cx, fun);
return FunctionToString(cx, fun, false, !(indent & JS_DONT_PRETTY_PRINT));
}
JS_PUBLIC_API(JSString *)
JS_DecompileFunctionBody(JSContext *cx, JSFunction *funArg, unsigned indent)
JS_DecompileFunctionBody(JSContext *cx, HandleFunction fun, unsigned indent)
{
JS_ASSERT(!cx->runtime()->isAtomsCompartment(cx->compartment()));
AssertHeapIsIdle(cx);
CHECK_REQUEST(cx);
assertSameCompartment(cx, funArg);
RootedFunction fun(cx, funArg);
assertSameCompartment(cx, fun);
return FunctionToString(cx, fun, true, !(indent & JS_DONT_PRETTY_PRINT));
}

View File

@ -2309,10 +2309,10 @@ class AutoIdArray : private AutoGCRooter
} /* namespace JS */
extern JS_PUBLIC_API(bool)
JS_ValueToId(JSContext *cx, jsval v, jsid *idp);
JS_ValueToId(JSContext *cx, jsval v, JS::MutableHandle<jsid> idp);
extern JS_PUBLIC_API(bool)
JS_IdToValue(JSContext *cx, jsid id, jsval *vp);
JS_IdToValue(JSContext *cx, jsid id, JS::MutableHandle<JS::Value> vp);
/*
* JSNewResolveOp flag bits.
@ -2745,13 +2745,13 @@ JS_NewObjectWithGivenProto(JSContext *cx, const JSClass *clasp, JS::Handle<JSObj
* deep-frozen.
*/
extern JS_PUBLIC_API(bool)
JS_DeepFreezeObject(JSContext *cx, JSObject *obj);
JS_DeepFreezeObject(JSContext *cx, JS::Handle<JSObject*> obj);
/*
* Freezes an object; see ES5's Object.freeze(obj) method.
*/
extern JS_PUBLIC_API(bool)
JS_FreezeObject(JSContext *cx, JSObject *obj);
JS_FreezeObject(JSContext *cx, JS::Handle<JSObject*> obj);
extern JS_PUBLIC_API(bool)
JS_PreventExtensions(JSContext *cx, JS::HandleObject obj);
@ -3060,10 +3060,10 @@ extern JS_PUBLIC_API(bool)
JS_IsArrayObject(JSContext *cx, JSObject *obj);
extern JS_PUBLIC_API(bool)
JS_GetArrayLength(JSContext *cx, JSObject *obj, uint32_t *lengthp);
JS_GetArrayLength(JSContext *cx, JS::Handle<JSObject*> obj, uint32_t *lengthp);
extern JS_PUBLIC_API(bool)
JS_SetArrayLength(JSContext *cx, JSObject *obj, uint32_t length);
JS_SetArrayLength(JSContext *cx, JS::Handle<JSObject*> obj, uint32_t length);
extern JS_PUBLIC_API(bool)
JS_DefineElement(JSContext *cx, JSObject *obj, uint32_t index, jsval value,
@ -3158,7 +3158,7 @@ JS_Enumerate(JSContext *cx, JSObject *obj);
* order, which uses order of property definition in obj.
*/
extern JS_PUBLIC_API(JSObject *)
JS_NewPropertyIterator(JSContext *cx, JSObject *obj);
JS_NewPropertyIterator(JSContext *cx, JS::Handle<JSObject*> obj);
/*
* Return true on success with *idp containing the id of the next enumerable
@ -3166,11 +3166,11 @@ JS_NewPropertyIterator(JSContext *cx, JSObject *obj);
* left to visit. Return false on error.
*/
extern JS_PUBLIC_API(bool)
JS_NextProperty(JSContext *cx, JSObject *iterobj, jsid *idp);
JS_NextProperty(JSContext *cx, JS::Handle<JSObject*> iterobj, jsid *idp);
extern JS_PUBLIC_API(bool)
JS_CheckAccess(JSContext *cx, JSObject *obj, jsid id, JSAccessMode mode,
jsval *vp, unsigned *attrsp);
JS_CheckAccess(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JSAccessMode mode,
JS::MutableHandle<JS::Value> vp, unsigned *attrsp);
extern JS_PUBLIC_API(jsval)
JS_GetReservedSlot(JSObject *obj, uint32_t index);
@ -3257,7 +3257,7 @@ JS_InitDestroyPrincipalsCallback(JSRuntime *rt, JSDestroyPrincipalsOp destroyPri
*/
extern JS_PUBLIC_API(JSFunction *)
JS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,
JSObject *parent, const char *name);
JS::Handle<JSObject*> parent, const char *name);
/*
* Create the function with the name given by the id. JSID_IS_STRING(id) must
@ -3265,12 +3265,13 @@ JS_NewFunction(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,
*/
extern JS_PUBLIC_API(JSFunction *)
JS_NewFunctionById(JSContext *cx, JSNative call, unsigned nargs, unsigned flags,
JSObject *parent, jsid id);
JS::Handle<JSObject*> parent, JS::Handle<jsid> id);
namespace JS {
extern JS_PUBLIC_API(JSFunction *)
GetSelfHostedFunction(JSContext *cx, const char *selfHostedName, jsid id, unsigned nargs);
GetSelfHostedFunction(JSContext *cx, const char *selfHostedName, JS::Handle<jsid> id,
unsigned nargs);
} /* namespace JS */
@ -3327,10 +3328,10 @@ JS_IsConstructor(JSFunction *fun);
* If |callable| is not callable, will throw and return nullptr.
*/
extern JS_PUBLIC_API(JSObject*)
JS_BindCallable(JSContext *cx, JSObject *callable, JSObject *newThis);
JS_BindCallable(JSContext *cx, JS::Handle<JSObject*> callable, JS::Handle<JSObject*> newThis);
extern JS_PUBLIC_API(bool)
JS_DefineFunctions(JSContext *cx, JSObject *obj, const JSFunctionSpec *fs);
JS_DefineFunctions(JSContext *cx, JS::Handle<JSObject*> obj, const JSFunctionSpec *fs);
extern JS_PUBLIC_API(JSFunction *)
JS_DefineFunction(JSContext *cx, JSObject *obj, const char *name, JSNative call,
@ -3350,7 +3351,7 @@ JS_DefineFunctionById(JSContext *cx, JSObject *obj, jsid id, JSNative call,
* fail if funobj was lexically nested inside some other function.
*/
extern JS_PUBLIC_API(JSObject *)
JS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);
JS_CloneFunctionObject(JSContext *cx, JS::Handle<JSObject*> funobj, JS::Handle<JSObject*> parent);
/*
* Given a buffer, return false if the buffer might become a valid
@ -3360,7 +3361,8 @@ JS_CloneFunctionObject(JSContext *cx, JSObject *funobj, JSObject *parent);
* the compiler.
*/
extern JS_PUBLIC_API(bool)
JS_BufferIsCompilableUnit(JSContext *cx, JSObject *obj, const char *utf8, size_t length);
JS_BufferIsCompilableUnit(JSContext *cx, JS::Handle<JSObject*> obj, const char *utf8,
size_t length);
extern JS_PUBLIC_API(JSScript *)
JS_CompileScript(JSContext *cx, JS::HandleObject obj,
@ -3684,7 +3686,7 @@ CompileFunction(JSContext *cx, JS::HandleObject obj, const ReadOnlyCompileOption
} /* namespace JS */
extern JS_PUBLIC_API(JSString *)
JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned indent);
JS_DecompileScript(JSContext *cx, JS::Handle<JSScript*> script, const char *name, unsigned indent);
/*
* API extension: OR this into indent to avoid pretty-printing the decompiled
@ -3693,10 +3695,10 @@ JS_DecompileScript(JSContext *cx, JSScript *script, const char *name, unsigned i
#define JS_DONT_PRETTY_PRINT ((unsigned)0x8000)
extern JS_PUBLIC_API(JSString *)
JS_DecompileFunction(JSContext *cx, JSFunction *fun, unsigned indent);
JS_DecompileFunction(JSContext *cx, JS::Handle<JSFunction*> fun, unsigned indent);
extern JS_PUBLIC_API(JSString *)
JS_DecompileFunctionBody(JSContext *cx, JSFunction *fun, unsigned indent);
JS_DecompileFunctionBody(JSContext *cx, JS::Handle<JSFunction*> fun, unsigned indent);
/*
* NB: JS_ExecuteScript and the JS_Evaluate*Script* quadruplets use the obj

View File

@ -2004,8 +2004,8 @@ js::array_sort(JSContext *cx, unsigned argc, Value *vp)
return true;
}
static JS_ALWAYS_INLINE bool
NewbornArrayPushImpl(JSContext *cx, HandleObject obj, const Value &v)
bool
js::NewbornArrayPush(JSContext *cx, HandleObject obj, const Value &v)
{
Rooted<ArrayObject*> arr(cx, &obj->as<ArrayObject>());
@ -2024,12 +2024,6 @@ NewbornArrayPushImpl(JSContext *cx, HandleObject obj, const Value &v)
return true;
}
bool
js_NewbornArrayPush(JSContext *cx, HandleObject obj, const Value &vp)
{
return NewbornArrayPushImpl(cx, obj, vp);
}
/* ES5 15.4.4.7 */
bool
js::array_push(JSContext *cx, unsigned argc, Value *vp)
@ -3052,10 +3046,8 @@ js_Array(JSContext *cx, unsigned argc, Value *vp)
* Allocate dense elements eagerly for small arrays, to avoid reallocating
* elements when filling the array.
*/
static const uint32_t ArrayEagerAllocationMaxLength = 2048;
RootedObject obj(cx);
obj = (length <= ArrayEagerAllocationMaxLength)
obj = (length <= ArrayObject::EagerAllocationMaxLength)
? NewDenseAllocatedArray(cx, length)
: NewDenseUnallocatedArray(cx, length);
if (!obj)

View File

@ -140,13 +140,6 @@ ArrayShiftMoveElements(JSObject *obj);
extern bool
array_shift(JSContext *cx, unsigned argc, js::Value *vp);
} /* namespace js */
#ifdef DEBUG
extern bool
js_ArrayInfo(JSContext *cx, unsigned argc, js::Value *vp);
#endif
/*
* Append the given (non-hole) value to the end of an array. The array must be
* a newborn array -- that is, one which has not been exposed to script for
@ -155,7 +148,14 @@ js_ArrayInfo(JSContext *cx, unsigned argc, js::Value *vp);
* sparse, which requires that the array be completely filled.)
*/
extern bool
js_NewbornArrayPush(JSContext *cx, js::HandleObject obj, const js::Value &v);
NewbornArrayPush(JSContext *cx, HandleObject obj, const Value &v);
} /* namespace js */
#ifdef DEBUG
extern bool
js_ArrayInfo(JSContext *cx, unsigned argc, js::Value *vp);
#endif
/* Array constructor native. Exposed only so the JIT can know its address. */
bool

View File

@ -1448,11 +1448,13 @@ typedef bool
void *specializedThis, const JSJitMethodCallArgs& args);
struct JSJitInfo {
enum OpType MOZ_ENUM_TYPE(uint8_t) {
enum OpType {
Getter,
Setter,
Method,
ParallelNative
ParallelNative,
// Must be last
OpTypeCount
};
enum ArgType {
@ -1476,7 +1478,7 @@ struct JSJitInfo {
ArgTypeListEnd = (1 << 31)
};
enum AliasSet MOZ_ENUM_TYPE(uint8_t) {
enum AliasSet {
// An enum that describes what this getter/setter/method aliases. This
// determines what things can be hoisted past this call, and if this
// call is movable what it can be hoisted past.
@ -1491,17 +1493,20 @@ struct JSJitInfo {
// Alias the world. Calling this can change arbitrary values anywhere
// in the system. Most things fall in this bucket.
AliasEverything
AliasEverything,
// Must be last.
AliasSetCount
};
bool hasParallelNative() const
{
return type == ParallelNative;
return type() == ParallelNative;
}
bool isDOMJitInfo() const
{
return type != ParallelNative;
return type() != ParallelNative;
}
bool isTypedMethodJitInfo() const
@ -1509,6 +1514,21 @@ struct JSJitInfo {
return isTypedMethod;
}
OpType type() const
{
return OpType(type_);
}
AliasSet aliasSet() const
{
return AliasSet(aliasSet_);
}
JSValueType returnType() const
{
return JSValueType(returnType_);
}
union {
JSJitGetterOp getter;
JSJitSetterOp setter;
@ -1519,30 +1539,53 @@ struct JSJitInfo {
uint16_t protoID;
uint16_t depth;
// type not being ParallelNative means this is a DOM method. If you
// change that, come up with a different way of implementing
// These fields are carefully packed to take up 4 bytes. If you need more
// bits for whatever reason, please see if you can steal bits from existing
// fields before adding more members to this structure.
#define JITINFO_OP_TYPE_BITS 4
#define JITINFO_ALIAS_SET_BITS 4
#define JITINFO_RETURN_TYPE_BITS 8
// If this field is not ParallelNative, then this is a DOM method.
// If you change that, come up with a different way of implementing
// isDOMJitInfo().
OpType type;
JSValueType returnType; /* The return type tag. Might be JSVAL_TYPE_UNKNOWN */
uint16_t isInfallible : 1; /* Is op fallible? False in setters. */
uint16_t isMovable : 1; /* Is op movable? To be movable the op must
uint32_t type_ : JITINFO_OP_TYPE_BITS;
// The alias set for this op. This is a _minimal_ alias set; in
// particular for a method it does not include whatever argument
// conversions might do. That's covered by argTypes and runtime
// analysis of the actual argument types being passed in.
uint32_t aliasSet_ : JITINFO_ALIAS_SET_BITS;
// The return type tag. Might be JSVAL_TYPE_UNKNOWN.
uint32_t returnType_ : JITINFO_RETURN_TYPE_BITS;
static_assert(OpTypeCount <= (1 << JITINFO_OP_TYPE_BITS),
"Not enough space for OpType");
static_assert(AliasSetCount <= (1 << JITINFO_ALIAS_SET_BITS),
"Not enough space for AliasSet");
static_assert((sizeof(JSValueType) * 8) <= JITINFO_RETURN_TYPE_BITS,
"Not enough space for JSValueType");
#undef JITINFO_RETURN_TYPE_BITS
#undef JITINFO_ALIAS_SET_BITS
#undef JITINFO_OP_TYPE_BITS
uint32_t isInfallible : 1; /* Is op fallible? False in setters. */
uint32_t isMovable : 1; /* Is op movable? To be movable the op must
not AliasEverything, but even that might
not be enough (e.g. in cases when it can
throw). */
// XXXbz should we have a JSValueType for the type of the member?
uint16_t isInSlot : 1; /* True if this is a getter that can get a member
uint32_t isInSlot : 1; /* True if this is a getter that can get a member
from a slot of the "this" object directly. */
uint16_t isTypedMethod : 1; /* True if this is an instance of
uint32_t isTypedMethod : 1; /* True if this is an instance of
JSTypedMethodJitInfo. */
uint16_t slotIndex : 12; /* If isInSlot is true, the index of the slot to
uint32_t slotIndex : 12; /* If isInSlot is true, the index of the slot to
get the value from. Otherwise 0. */
AliasSet aliasSet; /* The alias set for this op. This is a _minimal_
alias set; in particular for a method it does not
include whatever argument conversions might do.
That's covered by argTypes and runtime analysis
of the actual argument types being passed in. */
private:
static void staticAsserts()
{
@ -1555,6 +1598,12 @@ private:
}
};
static_assert(sizeof(JSJitInfo) == (sizeof(void*) + 2 * sizeof(uint32_t)),
"There are several thousand instances of JSJitInfo stored in "
"a binary. Please don't increase its space requirements without "
"verifying that there is no other way forward (better packing, "
"smaller datatypes for fields, subclassing, etc.).");
struct JSTypedMethodJitInfo
{
// We use C-style inheritance here, rather than C++ style inheritance
@ -1604,7 +1653,7 @@ inline int CheckIsParallelNative(JSParallelNative parallelNative);
*/
#define JS_JITINFO_NATIVE_PARALLEL(infoName, parallelOp) \
const JSJitInfo infoName = \
{{JS_CAST_PARALLEL_NATIVE_TO(parallelOp, JSJitGetterOp)},0,0,JSJitInfo::ParallelNative,JSVAL_TYPE_MISSING,false,false,false,false,0,JSJitInfo::AliasEverything}
{{JS_CAST_PARALLEL_NATIVE_TO(parallelOp, JSJitGetterOp)},0,0,JSJitInfo::ParallelNative,JSJitInfo::AliasEverything,JSVAL_TYPE_MISSING,false,false,false,false,0}
#define JS_JITINFO_NATIVE_PARALLEL_THREADSAFE(infoName, wrapperName, serialOp) \
bool wrapperName##_ParallelNativeThreadSafeWrapper(js::ForkJoinSlice *slice, unsigned argc, \

View File

@ -875,7 +875,8 @@ ToDisassemblySource(JSContext *cx, HandleValue v, JSAutoByteString *bytes)
}
if (obj->is<JSFunction>()) {
JSString *str = JS_DecompileFunction(cx, &obj->as<JSFunction>(), JS_DONT_PRETTY_PRINT);
RootedFunction fun(cx, &obj->as<JSFunction>());
JSString *str = JS_DecompileFunction(cx, fun, JS_DONT_PRETTY_PRINT);
if (!str)
return false;
return bytes->encodeLatin1(cx, str);

View File

@ -439,7 +439,7 @@ OPDEF(JSOP_UNUSED201, 201,"unused201", NULL, 1, 0, 0, JOF_BYTE)
*/
OPDEF(JSOP_GENERATOR, 202,"generator", NULL, 1, 0, 0, JOF_BYTE)
OPDEF(JSOP_YIELD, 203,"yield", NULL, 1, 1, 1, JOF_BYTE)
OPDEF(JSOP_ARRAYPUSH, 204,"arraypush", NULL, 4, 1, 0, JOF_LOCAL)
OPDEF(JSOP_ARRAYPUSH, 204,"arraypush", NULL, 1, 2, 0, JOF_BYTE)
OPDEF(JSOP_UNUSED205, 205, "unused205", NULL, 1, 0, 0, JOF_BYTE)
OPDEF(JSOP_UNUSED206, 206, "unused206", NULL, 1, 0, 0, JOF_BYTE)

View File

@ -33,6 +33,7 @@
#include "jit/IonCode.h"
#include "js/OldDebugAPI.h"
#include "vm/ArgumentsObject.h"
#include "vm/Compression.h"
#include "vm/Debugger.h"
#include "vm/Shape.h"
#include "vm/Xdr.h"
@ -1239,7 +1240,7 @@ ScriptSource::setSource(const jschar *src, size_t length)
}
bool
SourceCompressionTask::compress()
SourceCompressionTask::work()
{
// A given compression token can be compressed on any thread, and the ss
// not being ready indicates to other threads that its fields might change

View File

@ -27,121 +27,6 @@ using namespace js;
using mozilla::CeilingLog2Size;
using mozilla::PodArrayZero;
#if USE_ZLIB
static void *
zlib_alloc(void *cx, uInt items, uInt size)
{
return js_calloc(items, size);
}
static void
zlib_free(void *cx, void *addr)
{
js_free(addr);
}
Compressor::Compressor(const unsigned char *inp, size_t inplen)
: inp(inp),
inplen(inplen),
outbytes(0)
{
JS_ASSERT(inplen > 0);
zs.opaque = nullptr;
zs.next_in = (Bytef *)inp;
zs.avail_in = 0;
zs.next_out = nullptr;
zs.avail_out = 0;
zs.zalloc = zlib_alloc;
zs.zfree = zlib_free;
}
Compressor::~Compressor()
{
int ret = deflateEnd(&zs);
if (ret != Z_OK) {
// If we finished early, we can get a Z_DATA_ERROR.
JS_ASSERT(ret == Z_DATA_ERROR);
JS_ASSERT(uInt(zs.next_in - inp) < inplen || !zs.avail_out);
}
}
bool
Compressor::init()
{
if (inplen >= UINT32_MAX)
return false;
// zlib is slow and we'd rather be done compression sooner
// even if it means decompression is slower which penalizes
// Function.toString()
int ret = deflateInit(&zs, Z_BEST_SPEED);
if (ret != Z_OK) {
JS_ASSERT(ret == Z_MEM_ERROR);
return false;
}
return true;
}
void
Compressor::setOutput(unsigned char *out, size_t outlen)
{
JS_ASSERT(outlen > outbytes);
zs.next_out = out + outbytes;
zs.avail_out = outlen - outbytes;
}
Compressor::Status
Compressor::compressMore()
{
JS_ASSERT(zs.next_out);
uInt left = inplen - (zs.next_in - inp);
bool done = left <= CHUNKSIZE;
if (done)
zs.avail_in = left;
else if (zs.avail_in == 0)
zs.avail_in = CHUNKSIZE;
Bytef *oldout = zs.next_out;
int ret = deflate(&zs, done ? Z_FINISH : Z_NO_FLUSH);
outbytes += zs.next_out - oldout;
if (ret == Z_MEM_ERROR) {
zs.avail_out = 0;
return OOM;
}
if (ret == Z_BUF_ERROR || (done && ret == Z_OK)) {
JS_ASSERT(zs.avail_out == 0);
return MOREOUTPUT;
}
JS_ASSERT_IF(!done, ret == Z_OK);
JS_ASSERT_IF(done, ret == Z_STREAM_END);
return done ? DONE : CONTINUE;
}
bool
js::DecompressString(const unsigned char *inp, size_t inplen, unsigned char *out, size_t outlen)
{
JS_ASSERT(inplen <= UINT32_MAX);
z_stream zs;
zs.zalloc = zlib_alloc;
zs.zfree = zlib_free;
zs.opaque = nullptr;
zs.next_in = (Bytef *)inp;
zs.avail_in = inplen;
zs.next_out = out;
JS_ASSERT(outlen);
zs.avail_out = outlen;
int ret = inflateInit(&zs);
if (ret != Z_OK) {
JS_ASSERT(ret == Z_MEM_ERROR);
return false;
}
ret = inflate(&zs, Z_FINISH);
JS_ASSERT(ret == Z_STREAM_END);
ret = inflateEnd(&zs);
JS_ASSERT(ret == Z_OK);
return true;
}
#endif
#ifdef DEBUG
/* For JS_OOM_POSSIBLY_FAIL in jsutil.h. */
JS_PUBLIC_DATA(uint32_t) OOM_maxAllocations = UINT32_MAX;

View File

@ -16,10 +16,6 @@
#include <limits.h>
#ifdef USE_ZLIB
#include <zlib.h>
#endif
#include "js/Utility.h"
static JS_ALWAYS_INLINE void *
@ -264,41 +260,6 @@ ClearAllBitArrayElements(size_t *array, size_t length)
array[i] = 0;
}
#ifdef USE_ZLIB
class Compressor
{
/* Number of bytes we should hand to zlib each compressMore() call. */
static const size_t CHUNKSIZE = 2048;
z_stream zs;
const unsigned char *inp;
size_t inplen;
size_t outbytes;
public:
enum Status {
MOREOUTPUT,
DONE,
CONTINUE,
OOM
};
Compressor(const unsigned char *inp, size_t inplen);
~Compressor();
bool init();
void setOutput(unsigned char *out, size_t outlen);
size_t outWritten() const { return outbytes; }
/* Compress some of the input. Return true if it should be called again. */
Status compressMore();
};
/*
* Decompress a string. The caller must know the length of the output and
* allocate |out| to a string of that length.
*/
bool DecompressString(const unsigned char *inp, size_t inplen,
unsigned char *out, size_t outlen);
#endif
} /* namespace js */
/* Crash diagnostics */

View File

@ -369,7 +369,7 @@ JS_NondeterministicGetWeakMapKeys(JSContext *cx, JSObject *objArg, JSObject **re
RootedObject key(cx, r.front().key());
if (!cx->compartment()->wrap(cx, &key))
return false;
if (!js_NewbornArrayPush(cx, arr, ObjectValue(*key)))
if (!NewbornArrayPush(cx, arr, ObjectValue(*key)))
return false;
}
}

View File

@ -870,7 +870,7 @@ WorkerThread::handleCompressionWorkload(WorkerThreadState &state)
{
AutoUnlockWorkerThreadState unlock(runtime);
if (!compressionTask->compress())
if (!compressionTask->work())
compressionTask->setOOM();
}

View File

@ -413,7 +413,7 @@ struct SourceCompressionTask
complete();
}
bool compress();
bool work();
bool complete();
void abort() { abort_ = 1; }
bool active() const { return !!ss; }

View File

@ -155,6 +155,7 @@ UNIFIED_SOURCES += [
'vm/ArgumentsObject.cpp',
'vm/CallNonGenericMethod.cpp',
'vm/CharacterEncoding.cpp',
'vm/Compression.cpp',
'vm/DateTime.cpp',
'vm/Debugger.cpp',
'vm/ErrorObject.cpp',

View File

@ -3675,14 +3675,15 @@ NestedShell(JSContext *cx, unsigned argc, jsval *vp)
static bool
DecompileFunctionSomehow(JSContext *cx, unsigned argc, Value *vp,
JSString *(*decompiler)(JSContext *, JSFunction *, unsigned))
JSString *(*decompiler)(JSContext *, HandleFunction, unsigned))
{
CallArgs args = CallArgsFromVp(argc, vp);
if (args.length() < 1 || !args[0].isObject() || !args[0].toObject().is<JSFunction>()) {
args.rval().setUndefined();
return true;
}
JSString *result = decompiler(cx, &args[0].toObject().as<JSFunction>(), 0);
RootedFunction fun(cx, &args[0].toObject().as<JSFunction>());
JSString *result = decompiler(cx, fun, 0);
if (!result)
return false;
args.rval().setString(result);
@ -4833,14 +4834,14 @@ static const JSJitInfo dom_x_getterinfo = {
{ (JSJitGetterOp)dom_get_x },
0, /* protoID */
0, /* depth */
JSJitInfo::AliasNone, /* aliasSet */
JSJitInfo::Getter,
JSVAL_TYPE_UNKNOWN, /* returnType */
true, /* isInfallible. False in setters. */
true, /* isMovable */
false, /* isInSlot */
false, /* isTypedMethod */
0, /* slotIndex */
JSJitInfo::AliasNone /* aliasSet */
0 /* slotIndex */
};
static const JSJitInfo dom_x_setterinfo = {
@ -4848,13 +4849,13 @@ static const JSJitInfo dom_x_setterinfo = {
0, /* protoID */
0, /* depth */
JSJitInfo::Setter,
JSJitInfo::AliasEverything, /* aliasSet */
JSVAL_TYPE_UNKNOWN, /* returnType */
false, /* isInfallible. False in setters. */
false, /* isMovable. */
false, /* isInSlot */
false, /* isTypedMethod */
0, /* slotIndex */
JSJitInfo::AliasEverything /* aliasSet */
0 /* slotIndex */
};
static const JSJitInfo doFoo_methodinfo = {
@ -4862,13 +4863,13 @@ static const JSJitInfo doFoo_methodinfo = {
0, /* protoID */
0, /* depth */
JSJitInfo::Method,
JSJitInfo::AliasEverything, /* aliasSet */
JSVAL_TYPE_UNKNOWN, /* returnType */
false, /* isInfallible. False in setters. */
false, /* isMovable */
false, /* isInSlot */
false, /* isTypedMethod */
0, /* slotIndex */
JSJitInfo::AliasEverything /* aliasSet */
0 /* slotIndex */
};
static const JSPropertySpec dom_props[] = {
@ -4925,7 +4926,7 @@ dom_genericGetter(JSContext *cx, unsigned argc, JS::Value *vp)
JS::Value val = js::GetReservedSlot(obj, DOM_OBJECT_SLOT);
const JSJitInfo *info = FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, vp));
MOZ_ASSERT(info->type == JSJitInfo::Getter);
MOZ_ASSERT(info->type() == JSJitInfo::Getter);
JSJitGetterOp getter = info->getter;
return getter(cx, obj, val.toPrivate(), JSJitGetterCallArgs(args));
}
@ -4948,7 +4949,7 @@ dom_genericSetter(JSContext* cx, unsigned argc, JS::Value* vp)
JS::Value val = js::GetReservedSlot(obj, DOM_OBJECT_SLOT);
const JSJitInfo *info = FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, vp));
MOZ_ASSERT(info->type == JSJitInfo::Setter);
MOZ_ASSERT(info->type() == JSJitInfo::Setter);
JSJitSetterOp setter = info->setter;
if (!setter(cx, obj, val.toPrivate(), JSJitSetterCallArgs(args)))
return false;
@ -4972,7 +4973,7 @@ dom_genericMethod(JSContext* cx, unsigned argc, JS::Value *vp)
JS::Value val = js::GetReservedSlot(obj, DOM_OBJECT_SLOT);
const JSJitInfo *info = FUNCTION_VALUE_TO_JITINFO(JS_CALLEE(cx, vp));
MOZ_ASSERT(info->type == JSJitInfo::Method);
MOZ_ASSERT(info->type() == JSJitInfo::Method);
JSJitMethodOp method = info->method;
return method(cx, obj, val.toPrivate(), JSJitMethodCallArgs(args));
}

View File

@ -14,6 +14,9 @@ namespace js {
class ArrayObject : public JSObject
{
public:
// Array(x) eagerly allocates dense elements if x <= this value.
static const uint32_t EagerAllocationMaxLength = 2048;
static const Class class_;
bool lengthIsWritable() const {

127
js/src/vm/Compression.cpp Normal file
View File

@ -0,0 +1,127 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "vm/Compression.h"
#include "js/Utility.h"
using namespace js;
#if USE_ZLIB
static void *
zlib_alloc(void *cx, uInt items, uInt size)
{
return js_calloc(items, size);
}
static void
zlib_free(void *cx, void *addr)
{
js_free(addr);
}
Compressor::Compressor(const unsigned char *inp, size_t inplen)
: inp(inp),
inplen(inplen),
outbytes(0)
{
JS_ASSERT(inplen > 0);
zs.opaque = nullptr;
zs.next_in = (Bytef *)inp;
zs.avail_in = 0;
zs.next_out = nullptr;
zs.avail_out = 0;
zs.zalloc = zlib_alloc;
zs.zfree = zlib_free;
}
Compressor::~Compressor()
{
int ret = deflateEnd(&zs);
if (ret != Z_OK) {
// If we finished early, we can get a Z_DATA_ERROR.
JS_ASSERT(ret == Z_DATA_ERROR);
JS_ASSERT(uInt(zs.next_in - inp) < inplen || !zs.avail_out);
}
}
bool
Compressor::init()
{
if (inplen >= UINT32_MAX)
return false;
// zlib is slow and we'd rather be done compression sooner
// even if it means decompression is slower which penalizes
// Function.toString()
int ret = deflateInit(&zs, Z_BEST_SPEED);
if (ret != Z_OK) {
JS_ASSERT(ret == Z_MEM_ERROR);
return false;
}
return true;
}
void
Compressor::setOutput(unsigned char *out, size_t outlen)
{
JS_ASSERT(outlen > outbytes);
zs.next_out = out + outbytes;
zs.avail_out = outlen - outbytes;
}
Compressor::Status
Compressor::compressMore()
{
JS_ASSERT(zs.next_out);
uInt left = inplen - (zs.next_in - inp);
bool done = left <= CHUNKSIZE;
if (done)
zs.avail_in = left;
else if (zs.avail_in == 0)
zs.avail_in = CHUNKSIZE;
Bytef *oldout = zs.next_out;
int ret = deflate(&zs, done ? Z_FINISH : Z_NO_FLUSH);
outbytes += zs.next_out - oldout;
if (ret == Z_MEM_ERROR) {
zs.avail_out = 0;
return OOM;
}
if (ret == Z_BUF_ERROR || (done && ret == Z_OK)) {
JS_ASSERT(zs.avail_out == 0);
return MOREOUTPUT;
}
JS_ASSERT_IF(!done, ret == Z_OK);
JS_ASSERT_IF(done, ret == Z_STREAM_END);
return done ? DONE : CONTINUE;
}
bool
js::DecompressString(const unsigned char *inp, size_t inplen, unsigned char *out, size_t outlen)
{
JS_ASSERT(inplen <= UINT32_MAX);
z_stream zs;
zs.zalloc = zlib_alloc;
zs.zfree = zlib_free;
zs.opaque = nullptr;
zs.next_in = (Bytef *)inp;
zs.avail_in = inplen;
zs.next_out = out;
JS_ASSERT(outlen);
zs.avail_out = outlen;
int ret = inflateInit(&zs);
if (ret != Z_OK) {
JS_ASSERT(ret == Z_MEM_ERROR);
return false;
}
ret = inflate(&zs, Z_FINISH);
JS_ASSERT(ret == Z_STREAM_END);
ret = inflateEnd(&zs);
JS_ASSERT(ret == Z_OK);
return true;
}
#endif /* USE_ZLIB */

54
js/src/vm/Compression.h Normal file
View File

@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sts=4 et sw=4 tw=99:
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef vm_Compression_h
#define vm_Compression_h
#ifdef USE_ZLIB
#include <zlib.h>
#include "jstypes.h"
namespace js {
class Compressor
{
/* Number of bytes we should hand to zlib each compressMore() call. */
static const size_t CHUNKSIZE = 2048;
z_stream zs;
const unsigned char *inp;
size_t inplen;
size_t outbytes;
public:
enum Status {
MOREOUTPUT,
DONE,
CONTINUE,
OOM
};
Compressor(const unsigned char *inp, size_t inplen);
~Compressor();
bool init();
void setOutput(unsigned char *out, size_t outlen);
size_t outWritten() const { return outbytes; }
/* Compress some of the input. Return true if it should be called again. */
Status compressMore();
};
/*
* Decompress a string. The caller must know the length of the output and
* allocate |out| to a string of that length.
*/
bool DecompressString(const unsigned char *inp, size_t inplen,
unsigned char *out, size_t outlen);
} /* namespace js */
#endif /* USE_ZLIB */
#endif /* vm_Compression_h */

View File

@ -2737,7 +2737,7 @@ Debugger::findAllGlobals(JSContext *cx, unsigned argc, Value *vp)
RootedValue globalValue(cx, ObjectValue(*global));
if (!dbg->wrapDebuggeeValue(cx, &globalValue))
return false;
if (!js_NewbornArrayPush(cx, result, globalValue))
if (!NewbornArrayPush(cx, result, globalValue))
return false;
}
}
@ -3028,7 +3028,7 @@ DebuggerScript_getChildScripts(JSContext *cx, unsigned argc, Value *vp)
if (!funScript)
return false;
s = dbg->wrapScript(cx, funScript);
if (!s || !js_NewbornArrayPush(cx, result, ObjectValue(*s)))
if (!s || !NewbornArrayPush(cx, result, ObjectValue(*s)))
return false;
}
}
@ -3360,7 +3360,7 @@ DebuggerScript_getAllOffsets(JSContext *cx, unsigned argc, Value *vp)
}
/* Append the current offset to the offsets array. */
if (!js_NewbornArrayPush(cx, offsets, NumberValue(offset)))
if (!NewbornArrayPush(cx, offsets, NumberValue(offset)))
return false;
}
}
@ -3413,7 +3413,7 @@ DebuggerScript_getAllColumnOffsets(JSContext *cx, unsigned argc, Value *vp)
if (!JSObject::defineGeneric(cx, entry, id, value))
return false;
if (!js_NewbornArrayPush(cx, result, ObjectValue(*entry)))
if (!NewbornArrayPush(cx, result, ObjectValue(*entry)))
return false;
}
}
@ -3462,7 +3462,7 @@ DebuggerScript_getLineOffsets(JSContext *cx, unsigned argc, Value *vp)
!flowData[offset].hasNoEdges() &&
flowData[offset].lineno() != lineno)
{
if (!js_NewbornArrayPush(cx, result, NumberValue(offset)))
if (!NewbornArrayPush(cx, result, NumberValue(offset)))
return false;
}
}
@ -3575,7 +3575,7 @@ DebuggerScript_getBreakpoints(JSContext *cx, unsigned argc, Value *vp)
if (site && (!pc || site->pc == pc)) {
for (Breakpoint *bp = site->firstBreakpoint(); bp; bp = bp->nextInSite()) {
if (bp->debugger == dbg &&
!js_NewbornArrayPush(cx, arr, ObjectValue(*bp->getHandler())))
!NewbornArrayPush(cx, arr, ObjectValue(*bp->getHandler())))
{
return false;
}
@ -5649,7 +5649,7 @@ DebuggerEnv_names(JSContext *cx, unsigned argc, Value *vp)
if (JSID_IS_ATOM(id) && IsIdentifier(JSID_TO_ATOM(id))) {
if (!cx->compartment()->wrapId(cx, id.address()))
return false;
if (!js_NewbornArrayPush(cx, arr, StringValue(JSID_TO_STRING(id))))
if (!NewbornArrayPush(cx, arr, StringValue(JSID_TO_STRING(id))))
return false;
}
}

View File

@ -3395,14 +3395,11 @@ CASE(JSOP_YIELD)
CASE(JSOP_ARRAYPUSH)
{
uint32_t slot = GET_LOCALNO(REGS.pc);
JS_ASSERT(script->nfixed() <= slot);
JS_ASSERT(slot < script->nslots());
RootedObject &obj = rootObject0;
obj = &REGS.fp()->unaliasedLocal(slot).toObject();
if (!js_NewbornArrayPush(cx, obj, REGS.sp[-1]))
obj = &REGS.sp[-1].toObject();
if (!NewbornArrayPush(cx, obj, REGS.sp[-2]))
goto error;
REGS.sp--;
REGS.sp -= 2;
}
END_CASE(JSOP_ARRAYPUSH)

View File

@ -17,6 +17,7 @@
#include "builtin/Intl.h"
#include "builtin/TypedObject.h"
#include "gc/Marking.h"
#include "vm/Compression.h"
#include "vm/ForkJoin.h"
#include "vm/Interpreter.h"

View File

@ -22,7 +22,7 @@ namespace js {
* and saved versions. If deserialization fails, the data should be
* invalidated if possible.
*/
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 162);
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 163);
class XDRBuffer {
public:

View File

@ -1295,7 +1295,7 @@ mozJSComponentLoader::ImportInto(const nsACString &aLocation,
for (uint32_t i = 0; i < symbolCount; ++i) {
if (!JS_GetElement(mContext, symbolsObj, i, &value) ||
!value.isString() ||
!JS_ValueToId(mContext, value, symbolId.address())) {
!JS_ValueToId(mContext, value, &symbolId)) {
return ReportOnCaller(cxhelper, ERROR_ARRAY_ELEMENT,
PromiseFlatCString(aLocation).get(), i);
}

View File

@ -170,7 +170,7 @@ SandboxImport(JSContext *cx, unsigned argc, Value *vp)
}
RootedId id(cx);
if (!JS_ValueToId(cx, StringValue(funname), id.address()))
if (!JS_ValueToId(cx, StringValue(funname), &id))
return false;
// We need to resolve the this object, because this function is used
@ -294,7 +294,7 @@ ExportFunction(JSContext *cx, HandleValue vfunction, HandleValue vscope, HandleV
RootedValue vname(cx);
vname.setString(funName);
if (!JS_ValueToId(cx, vname, id.address()))
if (!JS_ValueToId(cx, vname, &id))
return false;
}
MOZ_ASSERT(JSID_IS_STRING(id));
@ -1447,7 +1447,7 @@ OptionsBase::ParseId(const char *name, MutableHandleId prop)
if (!found)
return true;
return JS_ValueToId(mCx, value, prop.address());
return JS_ValueToId(mCx, value, prop);
}
/*

View File

@ -263,9 +263,11 @@ nsXPCComponents_Interfaces::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
JSString* idstr;
const char* name;
JS::Rooted<jsid> id(cx);
if (NS_SUCCEEDED(interface->GetNameShared(&name)) && name &&
nullptr != (idstr = JS_NewStringCopyZ(cx, name)) &&
JS_ValueToId(cx, STRING_TO_JSVAL(idstr), idp)) {
JS_ValueToId(cx, StringValue(idstr), &id)) {
*idp = id;
return NS_OK;
}
}
@ -512,7 +514,9 @@ nsXPCComponents_InterfacesByID::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
if (NS_SUCCEEDED(interface->GetIIDShared(&iid))) {
iid->ToProvidedString(idstr);
jsstr = JS_NewStringCopyZ(cx, idstr);
if (jsstr && JS_ValueToId(cx, STRING_TO_JSVAL(jsstr), idp)) {
JS::Rooted<jsid> id(cx);
if (jsstr && JS_ValueToId(cx, StringValue(jsstr), &id)) {
*idp = id;
return NS_OK;
}
}
@ -766,8 +770,10 @@ nsXPCComponents_Classes::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
nsAutoCString name;
if (NS_SUCCEEDED(holder->GetData(name))) {
JSString* idstr = JS_NewStringCopyN(cx, name.get(), name.Length());
JS::Rooted<jsid> id(cx);
if (idstr &&
JS_ValueToId(cx, STRING_TO_JSVAL(idstr), idp)) {
JS_ValueToId(cx, StringValue(idstr), &id)) {
*idp = id;
return NS_OK;
}
}
@ -1006,8 +1012,10 @@ nsXPCComponents_ClassesByID::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
if (NS_SUCCEEDED(holder->ToString(&name)) && name) {
JSString* idstr = JS_NewStringCopyZ(cx, name);
nsMemory::Free(name);
JS::Rooted<jsid> id(cx);
if (idstr &&
JS_ValueToId(cx, STRING_TO_JSVAL(idstr), idp)) {
JS_ValueToId(cx, StringValue(idstr), &id)) {
*idp = id;
return NS_OK;
}
}
@ -1258,8 +1266,11 @@ nsXPCComponents_Results::NewEnumerate(nsIXPConnectWrappedNative *wrapper,
iter = (const void**) JSVAL_TO_PRIVATE(*statep);
if (nsXPCException::IterateNSResults(nullptr, &name, nullptr, iter)) {
JSString* idstr = JS_NewStringCopyZ(cx, name);
if (idstr && JS_ValueToId(cx, STRING_TO_JSVAL(idstr), idp))
JS::Rooted<jsid> id(cx);
if (idstr && JS_ValueToId(cx, StringValue(idstr), &id)) {
*idp = id;
return NS_OK;
}
}
// else... FALL THROUGH
}
@ -2399,7 +2410,7 @@ nsXPCComponents_Constructor::CallOrConstruct(nsIXPConnectWrappedNative *wrapper,
RootedString str(cx, ToString(cx, args[1]));
RootedId id(cx);
if (!str || !JS_ValueToId(cx, StringValue(str), id.address()))
if (!str || !JS_ValueToId(cx, StringValue(str), &id))
return ThrowAndFail(NS_ERROR_XPC_BAD_CONVERT_JS, cx, _retval);
RootedValue val(cx);
@ -2447,7 +2458,7 @@ nsXPCComponents_Constructor::CallOrConstruct(nsIXPConnectWrappedNative *wrapper,
RootedString str(cx, ToString(cx, args[0]));
RootedId id(cx);
if (!str || !JS_ValueToId(cx, StringValue(str), id.address()))
if (!str || !JS_ValueToId(cx, StringValue(str), &id))
return ThrowAndFail(NS_ERROR_XPC_BAD_CONVERT_JS, cx, _retval);
RootedValue val(cx);

View File

@ -610,7 +610,7 @@ PropertyOpForwarder(JSContext *cx, unsigned argc, jsval *vp)
JS::RootedValue argval(cx, (argc > 0) ? args.get(0) : JSVAL_VOID);
JS::RootedId id(cx);
if (!JS_ValueToId(cx, v, id.address()))
if (!JS_ValueToId(cx, v, &id))
return false;
args.rval().set(argval);
return ApplyPropertyOp<Op>(cx, *popp, obj, id, args.rval());

View File

@ -731,7 +731,7 @@ env_setProperty(JSContext *cx, HandleObject obj, HandleId id, bool strict, Mutab
int rv;
RootedValue idval(cx);
if (!JS_IdToValue(cx, id, idval.address()))
if (!JS_IdToValue(cx, id, &idval))
return false;
idstr = ToString(cx, idval);
@ -814,7 +814,7 @@ env_resolve(JSContext *cx, HandleObject obj, HandleId id, unsigned flags,
JSString *idstr, *valstr;
RootedValue idval(cx);
if (!JS_IdToValue(cx, id, idval.address()))
if (!JS_IdToValue(cx, id, &idval))
return false;
idstr = ToString(cx, idval);

View File

@ -335,7 +335,7 @@ nsXPCWrappedJSClass::GetNamedPropertyAsVariant(XPCCallContext& ccx,
RootedId id(cx);
nsresult rv = NS_OK;
if (!JS_ValueToId(cx, value, id.address()) ||
if (!JS_ValueToId(cx, value, &id) ||
!GetNamedPropertyAsVariantRaw(ccx, aJSObj, id, aResult, &rv)) {
if (NS_FAILED(rv))
return rv;
@ -378,7 +378,7 @@ nsXPCWrappedJSClass::BuildPropertyEnumerator(XPCCallContext& ccx,
}
RootedValue jsvalName(cx);
if (!JS_IdToValue(cx, idName, jsvalName.address()))
if (!JS_IdToValue(cx, idName, &jsvalName))
return NS_ERROR_FAILURE;
JSString* name = ToString(cx, jsvalName);

View File

@ -3818,8 +3818,9 @@ ContainerState::SetupMaskLayer(Layer *aLayer, const DisplayItemClip& aClip,
nsRefPtr<Image> image = container->CreateImage(&format, 1);
NS_ASSERTION(image, "Could not create image container for mask layer.");
CairoImage::Data data;
data.mSurface = surface;
data.mDeprecatedSurface = surface;
data.mSize = surfaceSizeInt;
data.mSourceSurface = gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface);
static_cast<CairoImage*>(image.get())->SetData(data);
container->SetCurrentImageInTransaction(image);

View File

@ -623,7 +623,11 @@ RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList)
if ((hint & nsChangeHint_AddOrRemoveTransform) && frame &&
!(hint & nsChangeHint_ReconstructFrame)) {
if (NeedToReframeForAddingOrRemovingTransform(frame)) {
if (NeedToReframeForAddingOrRemovingTransform(frame) ||
frame->GetType() == nsGkAtoms::fieldSetFrame ||
frame->GetContentInsertionFrame() != frame) {
// The frame has positioned children that need to be reparented, or
// it can't easily be converted to/from being an abs-pos container correctly.
NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
} else {
for (nsIFrame *cont = frame; cont;

View File

@ -68,6 +68,7 @@
#include "nsPageContentFrame.h"
#include "RestyleManager.h"
#include "StickyScrollContainer.h"
#include "nsFieldSetFrame.h"
#ifdef MOZ_XUL
#include "nsIRootBox.h"
@ -5650,21 +5651,32 @@ nsCSSFrameConstructor::GetAbsoluteContainingBlock(nsIFrame* aFrame,
(aType == FIXED_POS && !frame->StyleDisplay()->HasTransform(frame))) {
continue;
}
nsIFrame* absPosCBCandidate = nullptr;
if (frame->GetType() == nsGkAtoms::scrollFrame) {
nsIScrollableFrame* scrollFrame = do_QueryFrame(frame);
absPosCBCandidate = scrollFrame->GetScrolledFrame();
} else {
// Only first continuations can be containing blocks.
absPosCBCandidate = frame->FirstContinuation();
nsIFrame* absPosCBCandidate = frame;
nsIAtom* type = absPosCBCandidate->GetType();
if (type == nsGkAtoms::fieldSetFrame) {
absPosCBCandidate = static_cast<nsFieldSetFrame*>(absPosCBCandidate)->GetInner();
if (!absPosCBCandidate) {
continue;
}
type = absPosCBCandidate->GetType();
}
if (type == nsGkAtoms::scrollFrame) {
nsIScrollableFrame* scrollFrame = do_QueryFrame(absPosCBCandidate);
absPosCBCandidate = scrollFrame->GetScrolledFrame();
if (!absPosCBCandidate) {
continue;
}
type = absPosCBCandidate->GetType();
}
// Only first continuations can be containing blocks.
absPosCBCandidate = absPosCBCandidate->FirstContinuation();
// Is the frame really an absolute container?
if (!absPosCBCandidate || !absPosCBCandidate->IsAbsoluteContainer()) {
if (!absPosCBCandidate->IsAbsoluteContainer()) {
continue;
}
// For tables, skip the inner frame and consider the outer table frame.
if (absPosCBCandidate->GetType() == nsGkAtoms::tableFrame) {
if (type == nsGkAtoms::tableFrame) {
continue;
}
// For outer table frames, we can just return absPosCBCandidate.

View File

@ -1735,6 +1735,12 @@ nsCSSRendering::DetermineBackgroundColor(nsPresContext* aPresContext,
bool& aDrawBackgroundImage,
bool& aDrawBackgroundColor)
{
if (aFrame->IsThemed()) {
aDrawBackgroundColor = false;
aDrawBackgroundImage = false;
return NS_RGBA(0,0,0,0);
}
aDrawBackgroundImage = true;
aDrawBackgroundColor = true;

View File

@ -1055,7 +1055,8 @@ nsPresContext::Init(nsDeviceContext* aDeviceContext)
// Initialise refresh tick counters for OMTA
mLastStyleUpdateForAllAnimations =
mLastUpdateThrottledStyle = mRefreshDriver->MostRecentRefresh();
mLastUpdateThrottledAnimationStyle =
mLastUpdateThrottledTransitionStyle = mRefreshDriver->MostRecentRefresh();
mLangService = do_GetService(NS_LANGUAGEATOMSERVICE_CONTRACTID);
@ -1579,15 +1580,29 @@ nsPresContext::GetDocShell() const
}
bool
nsPresContext::ThrottledStyleIsUpToDate() const
nsPresContext::ThrottledTransitionStyleIsUpToDate() const
{
return mLastUpdateThrottledStyle == mRefreshDriver->MostRecentRefresh();
return
mLastUpdateThrottledTransitionStyle == mRefreshDriver->MostRecentRefresh();
}
void
nsPresContext::TickLastUpdateThrottledStyle()
nsPresContext::TickLastUpdateThrottledTransitionStyle()
{
mLastUpdateThrottledStyle = mRefreshDriver->MostRecentRefresh();
mLastUpdateThrottledTransitionStyle = mRefreshDriver->MostRecentRefresh();
}
bool
nsPresContext::ThrottledAnimationStyleIsUpToDate() const
{
return
mLastUpdateThrottledAnimationStyle == mRefreshDriver->MostRecentRefresh();
}
void
nsPresContext::TickLastUpdateThrottledAnimationStyle()
{
mLastUpdateThrottledAnimationStyle = mRefreshDriver->MostRecentRefresh();
}
bool

View File

@ -664,8 +664,10 @@ public:
/**
* Getter and setter for OMTA time counters
*/
bool ThrottledStyleIsUpToDate() const;
void TickLastUpdateThrottledStyle();
bool ThrottledTransitionStyleIsUpToDate() const;
void TickLastUpdateThrottledTransitionStyle();
bool ThrottledAnimationStyleIsUpToDate() const;
void TickLastUpdateThrottledAnimationStyle();
bool StyleUpdateForAllAnimationsIsUpToDate();
void TickLastStyleUpdateForAllAnimations();
@ -1240,8 +1242,10 @@ protected:
mozilla::TimeStamp mReflowStartTime;
// last time animations/transition styles were flushed to their primary frames
mozilla::TimeStamp mLastUpdateThrottledStyle;
// last time animations styles were flushed to their primary frames
mozilla::TimeStamp mLastUpdateThrottledAnimationStyle;
// last time transition styles were flushed to their primary frames
mozilla::TimeStamp mLastUpdateThrottledTransitionStyle;
// last time we did a full style flush
mozilla::TimeStamp mLastStyleUpdateForAllAnimations;

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