Merge latest green b2g-inbound changeset and mozilla-central

This commit is contained in:
Ed Morley 2013-09-30 17:15:40 +01:00
commit ef55234c85
29 changed files with 241 additions and 218 deletions

View File

@ -128,11 +128,11 @@ pref("app.update.cert.maxErrors", 5);
// when the |app.update.cert.checkAttributes| preference is set to false. Also,
// the |app.update.url.override| preference should ONLY be used for testing.
// IMPORTANT! metro.js should also be updated for updates to certs.X.issuerName
pref("app.update.certs.1.issuerName", "OU=Equifax Secure Certificate Authority,O=Equifax,C=US");
pref("app.update.certs.1.commonName", "aus3.mozilla.org");
pref("app.update.certs.1.issuerName", "CN=DigiCert Secure Server CA,O=DigiCert Inc,C=US");
pref("app.update.certs.1.commonName", "aus4.mozilla.org");
pref("app.update.certs.2.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
pref("app.update.certs.2.commonName", "aus3.mozilla.org");
pref("app.update.certs.2.commonName", "aus4.mozilla.org");
// Whether or not app updates are enabled
pref("app.update.enabled", true);
@ -162,7 +162,7 @@ pref("app.update.silent", false);
pref("app.update.staging.enabled", true);
// Update service URL:
pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
// app.update.url.manual is in branding section
// app.update.url.details is in branding section

View File

@ -447,7 +447,7 @@ pref("app.update.silent", true);
pref("app.update.staging.enabled", true);
// Update service URL:
pref("app.update.url", "https://aus3.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
pref("app.update.url", "https://aus4.mozilla.org/update/3/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml");
// Show the Update Checking/Ready UI when the user was idle for x seconds
pref("app.update.idletime", 60);
@ -515,10 +515,10 @@ pref("app.update.cert.maxErrors", 5);
// when the |app.update.cert.checkAttributes| preference is set to false. Also,
// the |app.update.url.override| preference should ONLY be used for testing.
// IMPORTANT! firefox.js should also be updated for updates to certs.X.issuerName
pref("app.update.certs.1.issuerName", "OU=Equifax Secure Certificate Authority,O=Equifax,C=US");
pref("app.update.certs.1.commonName", "aus3.mozilla.org");
pref("app.update.certs.1.issuerName", "CN=DigiCert Secure Server CA,O=DigiCert Inc,C=US");
pref("app.update.certs.1.commonName", "aus4.mozilla.org");
pref("app.update.certs.2.issuerName", "CN=Thawte SSL CA,O=\"Thawte, Inc.\",C=US");
pref("app.update.certs.2.commonName", "aus3.mozilla.org");
pref("app.update.certs.2.commonName", "aus4.mozilla.org");
// User-settable override to app.update.url for testing purposes.
//pref("app.update.url.override", "");

View File

@ -24,8 +24,9 @@
# their primary interface (and hence whose prototype is this
# interface's prototype object). Always False for callback
# interfaces. Defaults to True otherwise.
# * workers - Indicates whether the descriptor is intended to be used for
# worker threads (defaults to false).
# * workers - Indicates whether the descriptor is intended to be used solely
# for worker threads (defaults to false). If true the interface
# will not be made available on the main thread.
# * customTrace - The native class will use a custom trace hook (defaults to
# true for workers, false otherwise).
# * customFinalize - The native class will use a custom finalize hook
@ -59,7 +60,7 @@
# call delete through XPConnect's deferred finalization
# mechanism, for a refcounted object it'll call Release
# through XPConnect's deferred finalization mechanism.
# Always 'worker' for worker descriptors. Defaults to
# 'worker' opts into old style worker models. Defaults to
# 'refcounted'.
#
# The following fields are either a string, an array (defaults to an empty
@ -387,7 +388,14 @@ DOMInterfaces = {
},
{
'workers': True,
'concrete': False
'nativeOwnership': 'worker',
'concrete': False,
# XXXkhuey ownerGlobal returns WindowProxy? which boils down to a JSObject*
# on a worker, and nsRefPtr<JSObject> fails in the expected way. This is
# ugly but it's all going away soon anyways.
'resultNotAddRefed': [
'ownerGlobal'
]
}],
'Exception': {
@ -414,6 +422,7 @@ DOMInterfaces = {
'FileReaderSync': {
'workers': True,
'wrapperCache': False,
},
'FileRequest': {
@ -1245,6 +1254,7 @@ DOMInterfaces = {
},
{
'workers': True,
'nativeOwnership': 'worker',
}],
'VTTCue': {
@ -1425,13 +1435,11 @@ DOMInterfaces = {
'WorkerLocation': {
'headerFile': 'mozilla/dom/workers/bindings/Location.h',
'castable': True,
'workers': True,
},
'WorkerNavigator': {
'headerFile': 'mozilla/dom/workers/bindings/Navigator.h',
'castable': True,
'workers': True,
},
@ -1443,6 +1451,13 @@ DOMInterfaces = {
},
{
'workers': True,
'nativeOwnership': 'worker',
# XXXkhuey responseXML returns Document? which boils down to a JSObject*
# on a worker, and nsRefPtr<JSObject> fails in the expected way. channel is
# similar. This is ugly but it's all going away soon anyways.
'resultNotAddRefed': [
'responseXML', 'channel'
]
}],
'XMLHttpRequestEventTarget': [
@ -1453,6 +1468,7 @@ DOMInterfaces = {
},
{
'workers': True,
'nativeOwnership': 'worker',
'concrete': False,
}],
@ -1463,6 +1479,7 @@ DOMInterfaces = {
},
{
'workers': True,
'nativeOwnership': 'worker',
}],
'XMLSerializer': {

View File

@ -147,7 +147,7 @@ def DOMClass(descriptor):
# padding.
protoList.extend(['prototypes::id::_ID_Count'] * (descriptor.config.maxProtoChainLength - len(protoList)))
prototypeChainString = ', '.join(protoList)
if descriptor.workers:
if descriptor.nativeOwnership == 'worker':
participant = "nullptr"
else:
participant = "GetCCParticipant<%s>::Get()" % descriptor.nativeType
@ -209,7 +209,7 @@ static const DOMJSClass Class = {
};
""" % (self.descriptor.interface.identifier.name,
classFlags,
ADDPROPERTY_HOOK_NAME if self.descriptor.concrete and not self.descriptor.workers and self.descriptor.wrapperCache else 'JS_PropertyStub',
ADDPROPERTY_HOOK_NAME if self.descriptor.concrete and not self.descriptor.nativeOwnership == 'worker' and self.descriptor.wrapperCache else 'JS_PropertyStub',
enumerateHook, newResolveHook, FINALIZE_HOOK_NAME, callHook, traceHook,
CGIndenter(CGGeneric(DOMClass(self.descriptor))).define())
@ -1027,7 +1027,7 @@ class CGAddPropertyHook(CGAbstractClassHook):
'bool', args)
def generate_code(self):
assert not self.descriptor.workers and self.descriptor.wrapperCache
assert not self.descriptor.nativeOwnership == 'worker' and self.descriptor.wrapperCache
return (" // We don't want to preserve if we don't have a wrapper.\n"
" if (self->GetWrapperPreserveColor()) {\n"
" PreserveWrapper(self);\n"
@ -1050,7 +1050,7 @@ def finalizeHook(descriptor, hookName, context):
finalize += "ClearWrapper(self, self);\n"
if descriptor.interface.getExtendedAttribute('OverrideBuiltins'):
finalize += "self->mExpandoAndGeneration.expando = JS::UndefinedValue();\n"
if descriptor.workers:
if descriptor.nativeOwnership == 'worker':
finalize += "self->Release();"
else:
finalize += ("AddForDeferredFinalization<%s, %s >(self);" %
@ -4459,9 +4459,8 @@ def getRetvalDeclarationForType(returnType, descriptorProvider,
raise TypeError("Don't know how to declare return value for %s" %
returnType)
def isResultAlreadyAddRefed(descriptor, extendedAttributes):
# Default to already_AddRefed on the main thread, raw pointer in workers
return not descriptor.workers and not 'resultNotAddRefed' in extendedAttributes
def isResultAlreadyAddRefed(extendedAttributes):
return not 'resultNotAddRefed' in extendedAttributes
def needCx(returnType, arguments, extendedAttributes, considerTypes):
return (considerTypes and
@ -4492,8 +4491,7 @@ class CGCallGenerator(CGThing):
isFallible = errorReport is not None
resultAlreadyAddRefed = isResultAlreadyAddRefed(descriptorProvider,
extendedAttributes)
resultAlreadyAddRefed = isResultAlreadyAddRefed(extendedAttributes)
(result, resultOutParam,
resultRooter, resultArgs) = getRetvalDeclarationForType(
returnType, descriptorProvider, resultAlreadyAddRefed)
@ -4860,14 +4858,13 @@ if (!${obj}) {
isCreator = memberIsCreator(self.idlNode)
if isCreator:
# We better be returning addrefed things!
assert(isResultAlreadyAddRefed(self.descriptor,
self.extendedAttributes) or
assert(isResultAlreadyAddRefed(self.extendedAttributes) or
# Creators can return raw pointers to owned objects
(self.returnType.isGeckoInterface() and
self.descriptor.getDescriptor(self.returnType.unroll().inner.identifier.name).nativeOwnership == 'owned') or
# Workers use raw pointers for new-object return
# values or something
self.descriptor.workers)
self.descriptor.getDescriptor(self.returnType.unroll().inner.identifier.name).nativeOwnership == 'worker')
resultTemplateValues = { 'jsvalRef': 'args.rval()',
'jsvalHandle': 'args.rval()',
@ -6083,10 +6080,6 @@ def getUnionAccessorSignatureType(type, descriptorProvider):
return CGGeneric(type.inner.identifier.name)
if type.isCallback():
if descriptorProvider.workers:
if type.nullable():
return CGGeneric("JSObject*")
return CGGeneric("JSObject&")
if type.nullable():
typeName = "%s*"
else:
@ -7987,7 +7980,7 @@ class CGDescriptor(CGThing):
cgThings.append(CGConstructNavigatorObject(descriptor))
if descriptor.concrete and not descriptor.proxy:
if not descriptor.workers and descriptor.wrapperCache:
if not descriptor.nativeOwnership == 'worker' and descriptor.wrapperCache:
cgThings.append(CGAddPropertyHook(descriptor))
# Always have a finalize hook, regardless of whether the class
@ -9029,8 +9022,7 @@ class CGNativeMember(ClassMethod):
self.descriptorProvider = descriptorProvider
self.member = member
self.extendedAttrs = extendedAttrs
self.resultAlreadyAddRefed = isResultAlreadyAddRefed(self.descriptorProvider,
self.extendedAttrs)
self.resultAlreadyAddRefed = isResultAlreadyAddRefed(self.extendedAttrs)
self.passJSBitsAsNeeded = passJSBitsAsNeeded
self.jsObjectsArePtr = jsObjectsArePtr
self.variadicIsSequence = variadicIsSequence

View File

@ -346,7 +346,7 @@ class Descriptor(DescriptorProvider):
iface = iface.parent
self.operations = operations
if self.workers and desc.get('nativeOwnership', 'worker') == 'worker':
if self.workers and desc.get('nativeOwnership', None) == 'worker':
self.nativeOwnership = "worker"
else:
self.nativeOwnership = desc.get('nativeOwnership', 'refcounted')
@ -354,8 +354,10 @@ class Descriptor(DescriptorProvider):
raise TypeError("Descriptor for %s has unrecognized value (%s) "
"for nativeOwnership" %
(self.interface.identifier.name, self.nativeOwnership))
self.customTrace = desc.get('customTrace', self.workers)
self.customFinalize = desc.get('customFinalize', self.workers)
self.customTrace = desc.get('customTrace', self.nativeOwnership == 'worker')
self.customFinalize = desc.get('customFinalize', self.nativeOwnership == 'worker')
if desc.get('wantsQI', None) != None:
self._wantsQI = desc.get('wantsQI', None)
self.wrapperCache = (not self.interface.isCallback() and
(self.nativeOwnership == 'worker' or
(self.nativeOwnership != 'owned' and

View File

@ -6,22 +6,16 @@
#ifndef mozilla_dom_workers_dombindinginlines_h__
#define mozilla_dom_workers_dombindinginlines_h__
#include "mozilla/dom/FileReaderSyncBinding.h"
#include "mozilla/dom/JSSlots.h"
#include "mozilla/dom/XMLHttpRequestBinding.h"
#include "mozilla/dom/XMLHttpRequestUploadBinding.h"
#include "mozilla/dom/WorkerLocationBinding.h"
#include "mozilla/dom/WorkerNavigatorBinding.h"
#include "mozilla/dom/URLBinding.h"
#include "jsfriendapi.h"
BEGIN_WORKERS_NAMESPACE
class FileReaderSync;
class XMLHttpRequest;
class XMLHttpRequestUpload;
class WorkerLocation;
class WorkerNavigator;
class URL;
namespace {
@ -51,11 +45,8 @@ struct WrapPrototypeTraits
} \
};
SPECIALIZE_PROTO_TRAITS(FileReaderSync)
SPECIALIZE_PROTO_TRAITS(XMLHttpRequest)
SPECIALIZE_PROTO_TRAITS(XMLHttpRequestUpload)
SPECIALIZE_PROTO_TRAITS(WorkerLocation)
SPECIALIZE_PROTO_TRAITS(WorkerNavigator)
SPECIALIZE_PROTO_TRAITS(URL)
#undef SPECIALIZE_PROTO_TRAITS

View File

@ -33,45 +33,25 @@ using namespace mozilla;
using mozilla::dom::Optional;
using mozilla::dom::GlobalObject;
NS_IMPL_ADDREF_INHERITED(FileReaderSync, DOMBindingBase)
NS_IMPL_RELEASE_INHERITED(FileReaderSync, DOMBindingBase)
NS_IMPL_ADDREF(FileReaderSync)
NS_IMPL_RELEASE(FileReaderSync)
NS_INTERFACE_MAP_BEGIN(FileReaderSync)
NS_INTERFACE_MAP_ENTRY(nsICharsetDetectionObserver)
NS_INTERFACE_MAP_END_INHERITING(DOMBindingBase)
FileReaderSync::FileReaderSync(JSContext* aCx)
: DOMBindingBase(aCx)
{
}
void
FileReaderSync::_trace(JSTracer* aTrc)
{
DOMBindingBase::_trace(aTrc);
}
void
FileReaderSync::_finalize(JSFreeOp* aFop)
{
DOMBindingBase::_finalize(aFop);
}
NS_INTERFACE_MAP_END
// static
FileReaderSync*
already_AddRefed<FileReaderSync>
FileReaderSync::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
{
nsRefPtr<FileReaderSync> frs = new FileReaderSync(aGlobal.GetContext());
nsRefPtr<FileReaderSync> frs = new FileReaderSync();
if (!Wrap(aGlobal.GetContext(), aGlobal.Get(), frs)) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
return frs;
return frs.forget();
}
JSObject*
FileReaderSync::ReadAsArrayBuffer(JSContext* aCx, JS::Handle<JSObject*> aBlob,
FileReaderSync::ReadAsArrayBuffer(JSContext* aCx,
JS::Handle<JSObject*> aScopeObj,
JS::Handle<JSObject*> aBlob,
ErrorResult& aRv)
{
nsIDOMBlob* blob = file::GetDOMBlobFromJSObject(aBlob);

View File

@ -8,11 +8,11 @@
#define mozilla_dom_workers_filereadersync_h__
#include "Workers.h"
#include "mozilla/dom/workers/bindings/DOMBindingBase.h"
#include "nsICharsetDetectionObserver.h"
#include "nsString.h"
#include "mozilla/Attributes.h"
#include "mozilla/dom/FileReaderSyncBinding.h"
class nsIInputStream;
class nsIDOMBlob;
@ -28,8 +28,7 @@ template<typename> class Optional;
BEGIN_WORKERS_NAMESPACE
class FileReaderSync MOZ_FINAL : public DOMBindingBase,
public nsICharsetDetectionObserver
class FileReaderSync MOZ_FINAL : public nsICharsetDetectionObserver
{
nsCString mCharset;
nsresult ConvertStream(nsIInputStream *aStream, const char *aCharset,
@ -37,20 +36,18 @@ class FileReaderSync MOZ_FINAL : public DOMBindingBase,
nsresult GuessCharset(nsIInputStream *aStream, nsACString &aCharset);
public:
virtual void
_trace(JSTracer* aTrc) MOZ_OVERRIDE;
virtual void
_finalize(JSFreeOp* aFop) MOZ_OVERRIDE;
static FileReaderSync*
static already_AddRefed<FileReaderSync>
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
NS_DECL_ISUPPORTS_INHERITED
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
return FileReaderSyncBinding_workers::Wrap(aCx, aScope, this);
}
FileReaderSync(JSContext* aCx);
NS_DECL_ISUPPORTS
JSObject* ReadAsArrayBuffer(JSContext* aCx, JS::Handle<JSObject*> aBlob,
JSObject* ReadAsArrayBuffer(JSContext* aCx, JS::Handle<JSObject*> aScopeObj,
JS::Handle<JSObject*> aBlob,
ErrorResult& aRv);
void ReadAsBinaryString(JS::Handle<JSObject*> aBlob, nsAString& aResult,
ErrorResult& aRv);

View File

@ -8,16 +8,21 @@
#include "DOMBindingInlines.h"
#include "nsTraceRefcnt.h"
#include "mozilla/dom/WorkerLocationBinding.h"
BEGIN_WORKERS_NAMESPACE
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WorkerLocation)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WorkerLocation, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WorkerLocation, Release)
/* static */ already_AddRefed<WorkerLocation>
WorkerLocation::Create(JSContext* aCx, JS::Handle<JSObject*> aGlobal,
WorkerPrivate::LocationInfo& aInfo)
{
nsRefPtr<WorkerLocation> location =
new WorkerLocation(aCx,
NS_ConvertUTF8toUTF16(aInfo.mHref),
new WorkerLocation(NS_ConvertUTF8toUTF16(aInfo.mHref),
NS_ConvertUTF8toUTF16(aInfo.mProtocol),
NS_ConvertUTF8toUTF16(aInfo.mHost),
NS_ConvertUTF8toUTF16(aInfo.mHostname),
@ -26,23 +31,13 @@ WorkerLocation::Create(JSContext* aCx, JS::Handle<JSObject*> aGlobal,
NS_ConvertUTF8toUTF16(aInfo.mSearch),
NS_ConvertUTF8toUTF16(aInfo.mHash));
if (!Wrap(aCx, aGlobal, location)) {
return nullptr;
}
return location.forget();
}
void
WorkerLocation::_trace(JSTracer* aTrc)
JSObject*
WorkerLocation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
DOMBindingBase::_trace(aTrc);
}
void
WorkerLocation::_finalize(JSFreeOp* aFop)
{
DOMBindingBase::_finalize(aFop);
return WorkerLocationBinding_workers::Wrap(aCx, aScope, this);
}
END_WORKERS_NAMESPACE

View File

@ -7,12 +7,12 @@
#define mozilla_dom_workers_location_h__
#include "Workers.h"
#include "DOMBindingBase.h"
#include "WorkerPrivate.h"
#include "nsWrapperCache.h"
BEGIN_WORKERS_NAMESPACE
class WorkerLocation MOZ_FINAL : public DOMBindingBase
class WorkerLocation MOZ_FINAL : public nsWrapperCache
{
nsString mHref;
nsString mProtocol;
@ -23,8 +23,7 @@ class WorkerLocation MOZ_FINAL : public DOMBindingBase
nsString mSearch;
nsString mHash;
WorkerLocation(JSContext* aCx,
const nsAString& aHref,
WorkerLocation(const nsAString& aHref,
const nsAString& aProtocol,
const nsAString& aHost,
const nsAString& aHostname,
@ -32,8 +31,7 @@ class WorkerLocation MOZ_FINAL : public DOMBindingBase
const nsAString& aPathname,
const nsAString& aSearch,
const nsAString& aHash)
: DOMBindingBase(aCx)
, mHref(aHref)
: mHref(aHref)
, mProtocol(aProtocol)
, mHost(aHost)
, mHostname(aHostname)
@ -42,23 +40,29 @@ class WorkerLocation MOZ_FINAL : public DOMBindingBase
, mSearch(aSearch)
, mHash(aHash)
{
MOZ_COUNT_CTOR(mozilla::dom::workers::WorkerLocation);
MOZ_COUNT_CTOR(WorkerLocation);
SetIsDOMBinding();
}
public:
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WorkerLocation)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WorkerLocation)
static already_AddRefed<WorkerLocation>
Create(JSContext* aCx, JS::Handle<JSObject*> aGlobal,
WorkerPrivate::LocationInfo& aInfo);
virtual void
_trace(JSTracer* aTrc) MOZ_OVERRIDE;
virtual JSObject*
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
virtual void
_finalize(JSFreeOp* aFop) MOZ_OVERRIDE;
nsISupports* GetParentObject() const {
return nullptr;
}
~WorkerLocation()
{
MOZ_COUNT_DTOR(mozilla::dom::workers::WorkerLocation);
MOZ_COUNT_DTOR(WorkerLocation);
}
void Stringify(nsString& aHref) const
@ -97,7 +101,6 @@ public:
{
aHash = mHash;
}
};
END_WORKERS_NAMESPACE

View File

@ -7,9 +7,15 @@
#include "DOMBindingInlines.h"
#include "RuntimeService.h"
#include "mozilla/dom/WorkerNavigatorBinding.h"
BEGIN_WORKERS_NAMESPACE
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WorkerNavigator)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WorkerNavigator, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WorkerNavigator, Release)
/* static */ already_AddRefed<WorkerNavigator>
WorkerNavigator::Create(JSContext* aCx, JS::Handle<JSObject*> aGlobal)
{
@ -20,26 +26,16 @@ WorkerNavigator::Create(JSContext* aCx, JS::Handle<JSObject*> aGlobal)
rts->GetNavigatorStrings();
nsRefPtr<WorkerNavigator> navigator =
new WorkerNavigator(aCx, strings.mAppName, strings.mAppVersion,
new WorkerNavigator(strings.mAppName, strings.mAppVersion,
strings.mPlatform, strings.mUserAgent);
if (!Wrap(aCx, aGlobal, navigator)) {
return nullptr;
}
return navigator.forget();
}
void
WorkerNavigator::_trace(JSTracer* aTrc)
JSObject*
WorkerNavigator::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope)
{
DOMBindingBase::_trace(aTrc);
}
void
WorkerNavigator::_finalize(JSFreeOp* aFop)
{
DOMBindingBase::_finalize(aFop);
return WorkerNavigatorBinding_workers::Wrap(aCx, aScope, this);
}
END_WORKERS_NAMESPACE

View File

@ -7,45 +7,49 @@
#define mozilla_dom_workers_navigator_h__
#include "Workers.h"
#include "mozilla/dom/workers/bindings/DOMBindingBase.h"
#include "nsString.h"
#include "nsWrapperCache.h"
BEGIN_WORKERS_NAMESPACE
class WorkerNavigator MOZ_FINAL : public DOMBindingBase
class WorkerNavigator MOZ_FINAL : public nsWrapperCache
{
nsString mAppName;
nsString mAppVersion;
nsString mPlatform;
nsString mUserAgent;
WorkerNavigator(JSContext* aCx,
const nsAString& aAppName,
WorkerNavigator(const nsAString& aAppName,
const nsAString& aAppVersion,
const nsAString& aPlatform,
const nsAString& aUserAgent)
: DOMBindingBase(aCx)
, mAppName(aAppName)
: mAppName(aAppName)
, mAppVersion(aAppVersion)
, mPlatform(aPlatform)
, mUserAgent(aUserAgent)
{
MOZ_COUNT_CTOR(mozilla::dom::workers::WorkerNavigator);
MOZ_COUNT_CTOR(WorkerNavigator);
SetIsDOMBinding();
}
public:
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WorkerNavigator)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WorkerNavigator)
static already_AddRefed<WorkerNavigator>
Create(JSContext* aCx, JS::Handle<JSObject*> aGlobal);
virtual void
_trace(JSTracer* aTrc) MOZ_OVERRIDE;
virtual JSObject*
WrapObject(JSContext* aCx, JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
virtual void
_finalize(JSFreeOp* aFop) MOZ_OVERRIDE;
nsISupports* GetParentObject() const {
return nullptr;
}
~WorkerNavigator()
{
MOZ_COUNT_DTOR(mozilla::dom::workers::WorkerNavigator);
MOZ_COUNT_DTOR(WorkerNavigator);
}
void GetAppName(nsString& aAppName) const
@ -64,8 +68,8 @@ public:
{
aUserAgent = mUserAgent;
}
};
END_WORKERS_NAMESPACE
#endif // mozilla_dom_workers_navigator_h__

View File

@ -268,7 +268,12 @@ private:
return false;
}
scope->mSlots[SLOT_location] = OBJECT_TO_JSVAL(location->GetJSObject());
JS::Rooted<JS::Value> val(aCx);
if (!WrapNewBindingObject(aCx, obj, location, &val)) {
return false;
}
scope->mSlots[SLOT_location] = val;
}
aArgs.rval().set(scope->mSlots[SLOT_location]);
@ -418,7 +423,12 @@ private:
return false;
}
scope->mSlots[SLOT_navigator] = OBJECT_TO_JSVAL(navigator->GetJSObject());
JS::Rooted<JS::Value> val(aCx);
if (!WrapNewBindingObject(aCx, obj, navigator, &val)) {
return false;
}
scope->mSlots[SLOT_navigator] = val;
}
aArgs.rval().set(scope->mSlots[SLOT_navigator]);

View File

@ -7,6 +7,7 @@
#include "DrawTargetCG.h"
#include "QuartzSupport.h"
#include "Tools.h"
namespace mozilla {
namespace gfx {
@ -127,7 +128,9 @@ SourceSurfaceCG::InitFromData(unsigned char *aData,
assert(aSize.width >= 0 && aSize.height >= 0);
void *data = malloc(aStride * aSize.height);
memcpy(data, aData, aStride * aSize.height);
// Copy all the data except the stride padding on the very last
// row since we can't guarantee that is readable.
memcpy(data, aData, aStride * (aSize.height - 1) + (aSize.width * BytesPerPixel(aFormat)));
mFormat = aFormat;
mImage = CreateCGImage(data, data, aSize, aStride, aFormat);
@ -162,7 +165,7 @@ DataSourceSurfaceCG::InitFromData(unsigned char *aData,
}
void *data = malloc(aStride * aSize.height);
memcpy(data, aData, aStride * aSize.height);
memcpy(data, aData, aStride * (aSize.height - 1) + (aSize.width * BytesPerPixel(aFormat)));
mFormat = aFormat;
mImage = CreateCGImage(data, data, aSize, aStride, aFormat);

View File

@ -541,8 +541,8 @@ GLContextProviderCGL::GetSharedHandleAsSurface(SharedTextureShareType shareType,
MacIOSurface* surf = reinterpret_cast<MacIOSurface*>(sharedHandle);
surf->Lock();
size_t bytesPerRow = surf->GetBytesPerRow();
size_t ioWidth = surf->GetWidth();
size_t ioHeight = surf->GetHeight();
size_t ioWidth = surf->GetDevicePixelWidth();
size_t ioHeight = surf->GetDevicePixelHeight();
unsigned char* ioData = (unsigned char*)surf->GetBaseAddress();

View File

@ -344,7 +344,6 @@ LayerManagerComposite::Render()
}
if (actualBounds.IsEmpty()) {
mCompositor->GetWidget()->PostRender(this);
return;
}
@ -370,8 +369,6 @@ LayerManagerComposite::Render()
PROFILER_LABEL("LayerManagerComposite", "EndFrame");
mCompositor->EndFrame();
}
mCompositor->GetWidget()->PostRender(this);
}
void

View File

@ -25,6 +25,7 @@
#include "mozilla/gfx/BasePoint.h" // for BasePoint
#include "mozilla/gfx/BaseRect.h" // for BaseRect
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/gfx/2D.h" // for DrawTarget, etc
#include "mozilla/mozalloc.h" // for operator new
#include "nsCOMPtr.h" // for already_AddRefed
#include "nsDebug.h" // for NS_ASSERTION, etc
@ -35,6 +36,9 @@
#include "LayerManagerOGLProgram.h" // for ShaderProgramOGL, etc
#include "gfx2DGlue.h"
using namespace mozilla;
using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
@ -73,6 +77,7 @@ CreateClampOrRepeatTextureImage(GLContext *aGl,
static void
SetAntialiasingFlags(Layer* aLayer, gfxContext* aTarget)
{
if (aTarget->IsCairo()) {
nsRefPtr<gfxASurface> surface = aTarget->CurrentSurface();
if (surface->GetContentType() != GFX_CONTENT_COLOR_ALPHA) {
// Destination doesn't have alpha channel; no need to set any special flags
@ -81,6 +86,16 @@ SetAntialiasingFlags(Layer* aLayer, gfxContext* aTarget)
surface->SetSubpixelAntialiasingEnabled(
!(aLayer->GetContentFlags() & Layer::CONTENT_COMPONENT_ALPHA));
} else {
RefPtr<DrawTarget> dt = aTarget->GetDrawTarget();
if (dt->GetFormat() != FORMAT_B8G8R8A8) {
return;
}
dt->SetPermitSubpixelAA(
!(aLayer->GetContentFlags() & Layer::CONTENT_COMPONENT_ALPHA));
}
}
class ThebesLayerBufferOGL
@ -761,6 +776,13 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
"BeginUpdate should always modify the draw region in the same way!");
FillSurface(onBlack, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(0.0, 0.0, 0.0, 1.0));
FillSurface(onWhite, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(1.0, 1.0, 1.0, 1.0));
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(BACKEND_COREGRAPHICS)) {
RefPtr<DrawTarget> onBlackDT = gfxPlatform::GetPlatform()->CreateDrawTargetForUpdateSurface(onBlack, onBlack->GetSize());
RefPtr<DrawTarget> onWhiteDT = gfxPlatform::GetPlatform()->CreateDrawTargetForUpdateSurface(onWhite, onWhite->GetSize());
RefPtr<DrawTarget> dt = Factory::CreateDualDrawTarget(onBlackDT, onWhiteDT);
result.mContext = new gfxContext(dt);
result.mContext->Translate(onBlack->GetDeviceOffset());
} else {
gfxASurface* surfaces[2] = { onBlack, onWhite };
nsRefPtr<gfxTeeSurface> surf = new gfxTeeSurface(surfaces, ArrayLength(surfaces));
@ -776,16 +798,18 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
// be incorrect.
surf->SetAllowUseAsSource(false);
result.mContext = new gfxContext(surf);
}
} else {
result.mContext = nullptr;
}
} else {
result.mContext = new gfxContext(mTexImage->BeginUpdate(result.mRegionToDraw));
if (mTexImage->GetContentType() == GFX_CONTENT_COLOR_ALPHA) {
gfxUtils::ClipToRegion(result.mContext, result.mRegionToDraw);
result.mContext->SetOperator(gfxContext::OPERATOR_CLEAR);
result.mContext->Paint();
result.mContext->SetOperator(gfxContext::OPERATOR_OVER);
nsRefPtr<gfxASurface> surf = mTexImage->BeginUpdate(result.mRegionToDraw);
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(BACKEND_COREGRAPHICS)) {
RefPtr<DrawTarget> dt = gfxPlatform::GetPlatform()->CreateDrawTargetForUpdateSurface(surf, surf->GetSize());
result.mContext = new gfxContext(dt);
result.mContext->Translate(surf->GetDeviceOffset());
} else {
result.mContext = new gfxContext(surf);
}
}
if (!result.mContext) {
@ -806,6 +830,12 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
// clip and draw regions.
gfxUtils::ClipToRegion(result.mContext, result.mRegionToDraw);
if (mTexImage->GetContentType() == GFX_CONTENT_COLOR_ALPHA) {
result.mContext->SetOperator(gfxContext::OPERATOR_CLEAR);
result.mContext->Paint();
result.mContext->SetOperator(gfxContext::OPERATOR_OVER);
}
return result;
}

View File

@ -970,6 +970,7 @@ intl_CompareStrings(JSContext *cx, UCollator *coll, HandleString str1, HandleStr
case UCOL_LESS: res = -1; break;
case UCOL_EQUAL: res = 0; break;
case UCOL_GREATER: res = 1; break;
default: MOZ_ASSUME_UNREACHABLE("ucol_strcoll returned bad UCollationResult");
}
result.setInt32(res);
return true;

View File

@ -50,9 +50,9 @@ fuzzy-if(!contentSameGfxBackendAsCanvas,1,88500) fuzzy-if(azureSkiaGL,2,89700) f
== linear-zero-length-1c.html linear-zero-length-1-ref.html
== nostops.html about:blank
== onestop.html about:blank
fuzzy-if(!contentSameGfxBackendAsCanvas,1,5884) fuzzy-if(cocoaWidget,9,87755) fuzzy-if(azureSkiaGL,2,88024) random-if(d2d) == radial-1a.html radial-1-ref.html
fuzzy-if(!contentSameGfxBackendAsCanvas,1,5884) fuzzy-if(cocoaWidget,9,87755) fuzzy-if(azureSkiaGL,2,88024) random-if(d2d) == radial-1b.html radial-1-ref.html
fuzzy-if(!contentSameGfxBackendAsCanvas,1,5884) fuzzy-if(cocoaWidget,9,87755) fuzzy-if(azureSkiaGL,2,88024) random-if(d2d) == radial-1c.html radial-1-ref.html
fuzzy-if(!contentSameGfxBackendAsCanvas,1,5884) fuzzy-if(cocoaWidget,9,87824) fuzzy-if(azureSkiaGL,2,88024) random-if(d2d) == radial-1a.html radial-1-ref.html
fuzzy-if(!contentSameGfxBackendAsCanvas,1,5884) fuzzy-if(cocoaWidget,9,87824) fuzzy-if(azureSkiaGL,2,88024) random-if(d2d) == radial-1b.html radial-1-ref.html
fuzzy-if(!contentSameGfxBackendAsCanvas,1,5884) fuzzy-if(cocoaWidget,9,87824) fuzzy-if(azureSkiaGL,2,88024) random-if(d2d) == radial-1c.html radial-1-ref.html
fuzzy(3,7860) fuzzy-if(cocoaWidget,5,89041) fuzzy-if(azureSkiaGL,2,90000) == radial-2a.html radial-2-ref.html
fuzzy(3,7860) fuzzy-if(cocoaWidget,5,89041) fuzzy-if(azureSkiaGL,2,90000) == radial-2b.html radial-2-ref.html
fuzzy(3,7860) fuzzy-if(cocoaWidget,5,89041) fuzzy-if(azureSkiaGL,2,90000) == radial-2c.html radial-2-ref.html
@ -68,7 +68,7 @@ fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) fuzzy-if(Android,17,3880
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) fuzzy-if(Android,17,3880) == radial-shape-closest-side-1b.html radial-shape-closest-side-1-ref.html
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),1,5) fuzzy-if(Android,17,3880) == radial-shape-closest-side-1c.html radial-shape-closest-side-1-ref.html
== radial-shape-farthest-corner-1a.html radial-shape-farthest-corner-1-ref.html
fails-if(cocoaWidget&&/x86-/.test(xulRuntime.XPCOMABI)||gtk2Widget&&/x86_64-/.test(xulRuntime.XPCOMABI)) fuzzy(1,1561) fuzzy-if(cocoaWidget,3,1082) fuzzy-if(azureQuartz,2,41171) fuzzy-if(azureQuartz&&OSX==10.6,3,1082) == radial-shape-farthest-corner-1b.html radial-shape-farthest-corner-1-ref.html
fails-if(cocoaWidget&&/x86-/.test(xulRuntime.XPCOMABI)||gtk2Widget&&/x86_64-/.test(xulRuntime.XPCOMABI)) fuzzy(1,1561) fuzzy-if(cocoaWidget,3,1082) fuzzy-if(azureQuartz,2,41171) == radial-shape-farthest-corner-1b.html radial-shape-farthest-corner-1-ref.html
== radial-shape-farthest-corner-1c.html radial-shape-farthest-corner-1-ref.html
fuzzy-if(Android,17,13320) == radial-shape-farthest-side-1a.html radial-shape-farthest-side-1-ref.html
fuzzy-if(Android,17,13320) == radial-shape-farthest-side-1b.html radial-shape-farthest-side-1-ref.html

View File

@ -229,7 +229,7 @@ fuzzy-if(Android&&AndroidVersion>=15,8,200) == outer-svg-border-and-padding-01.s
pref(svg.paint-order.enabled,true) == paint-order-01.svg paint-order-01-ref.svg
pref(svg.paint-order.enabled,true) == paint-order-02.svg paint-order-02-ref.svg
pref(svg.paint-order.enabled,true) == paint-order-03.svg paint-order-03-ref.svg
== path-01.svg path-01-ref.svg
fuzzy-if(azureQuartz,6,47) == path-01.svg path-01-ref.svg
== path-02.svg pass.svg
== path-03.svg pass.svg
== path-04.svg pass.svg

View File

@ -197,7 +197,7 @@ nsCSSProps::BuildShorthandsContainingTable()
for (const nsCSSProperty* subprops = SubpropertyEntryFor(shorthand);
*subprops != eCSSProperty_UNKNOWN;
++subprops) {
NS_ABORT_IF_FALSE(0 < *subprops &&
NS_ABORT_IF_FALSE(0 <= *subprops &&
*subprops < eCSSProperty_COUNT_no_shorthands,
"subproperty must be a longhand");
++occurrenceCounts[*subprops];

View File

@ -19,3 +19,4 @@ cp $1/src/*.cc ./
patch -p3 < add-mfbt-api-markers.patch
patch -p3 < use-StandardInteger.patch
patch -p3 < use-mozilla-assertions.patch
patch -p3 < use-static_assert.patch

View File

@ -0,0 +1,25 @@
diff --git a/mfbt/double-conversion/utils.h b/mfbt/double-conversion/utils.h
--- a/mfbt/double-conversion/utils.h
+++ b/mfbt/double-conversion/utils.h
@@ -275,19 +275,18 @@ class StringBuilder {
// There is an additional use for BitCast.
// Recent gccs will warn when they see casts that may result in breakage due to
// the type-based aliasing rule. If you have checked that there is no breakage
// you can use BitCast to cast one pointer type to another. This confuses gcc
// enough that it can no longer see that you have cast one pointer type to
// another thus avoiding the warning.
template <class Dest, class Source>
inline Dest BitCast(const Source& source) {
- // Compile time assertion: sizeof(Dest) == sizeof(Source)
- // A compile error here means your Dest and Source have different sizes.
- typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
+ static_assert(sizeof(Dest) == sizeof(Source),
+ "BitCast's source and destination types must be the same size");
Dest dest;
memmove(&dest, &source, sizeof(dest));
return dest;
}
template <class Dest, class Source>
inline Dest BitCast(Source* source) {

View File

@ -280,9 +280,8 @@ class StringBuilder {
// another thus avoiding the warning.
template <class Dest, class Source>
inline Dest BitCast(const Source& source) {
// Compile time assertion: sizeof(Dest) == sizeof(Source)
// A compile error here means your Dest and Source have different sizes.
typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
static_assert(sizeof(Dest) == sizeof(Source),
"BitCast's source and destination types must be the same size");
Dest dest;
memmove(&dest, &source, sizeof(dest));

View File

@ -334,7 +334,6 @@ typedef NSInteger NSEventGestureAxis;
- (void)setGLContext:(NSOpenGLContext *)aGLContext;
- (void)preRender:(NSOpenGLContext *)aGLContext;
- (void)postRender:(NSOpenGLContext *)aGLContext;
- (BOOL)isCoveringTitlebar;
@ -538,7 +537,6 @@ public:
virtual void PrepareWindowEffects() MOZ_OVERRIDE;
virtual void CleanupWindowEffects() MOZ_OVERRIDE;
virtual void PreRender(LayerManager* aManager) MOZ_OVERRIDE;
virtual void PostRender(LayerManager* aManager) MOZ_OVERRIDE;
virtual void DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect) MOZ_OVERRIDE;
virtual void UpdateThemeGeometries(const nsTArray<ThemeGeometry>& aThemeGeometries);

View File

@ -2043,17 +2043,6 @@ nsChildView::PreRender(LayerManager* aManager)
[(ChildView*)mView preRender:glContext];
}
void
nsChildView::PostRender(LayerManager* aManager)
{
nsAutoPtr<GLManager> manager(GLManager::CreateGLManager(aManager));
if (!manager) {
return;
}
NSOpenGLContext *glContext = (NSOpenGLContext *)manager->gl()->GetNativeData(GLContext::NativeGLContext);
[(ChildView*)mView postRender:glContext];
}
void
nsChildView::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect)
{
@ -2896,17 +2885,6 @@ NSEvent* gLastDragMouseDownEvent = nil;
[aGLContext setView:self];
[aGLContext update];
CGLLockContext((CGLContextObj)[aGLContext CGLContextObj]);
NS_OBJC_END_TRY_ABORT_BLOCK;
}
-(void)postRender:(NSOpenGLContext *)aGLContext
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
CGLUnlockContext((CGLContextObj)[aGLContext CGLContextObj]);
NS_OBJC_END_TRY_ABORT_BLOCK;
}
@ -3245,7 +3223,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
[super lockFocus];
if (mGLContext && !mUsingOMTCompositor) {
if (mGLContext) {
if ([mGLContext view] != self) {
[mGLContext setView:self];
}
@ -3389,10 +3367,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
targetSurface->SetAllowUseAsSource(false);
nsRefPtr<gfxContext> targetContext;
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(mozilla::gfx::BACKEND_CAIRO)) {
RefPtr<mozilla::gfx::DrawTarget> dt =
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(gfx::BACKEND_CAIRO)) {
RefPtr<gfx::DrawTarget> dt =
gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(targetSurface,
mozilla::gfx::IntSize(backingSize.width,
gfx::IntSize(backingSize.width,
backingSize.height));
targetContext = new gfxContext(dt);
} else if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(gfx::BACKEND_COREGRAPHICS)) {
RefPtr<gfx::DrawTarget> dt =
gfx::Factory::CreateDrawTargetForCairoCGContext(aContext,
gfx::IntSize(backingSize.width,
backingSize.height));
targetContext = new gfxContext(dt);
} else {

View File

@ -1216,7 +1216,6 @@ class nsIWidget : public nsISupports {
virtual void CleanupWindowEffects() = 0;
virtual void PreRender(LayerManager* aManager) = 0;
virtual void PostRender(LayerManager* aManager) = 0;
/**
* Called before the LayerManager draws the layer tree.

View File

@ -137,7 +137,6 @@ public:
virtual void PrepareWindowEffects() {}
virtual void CleanupWindowEffects() {}
virtual void PreRender(LayerManager* aManager) {}
virtual void PostRender(LayerManager* aManager) {}
virtual void DrawWindowUnderlay(LayerManager* aManager, nsIntRect aRect) {}
virtual void DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect) {}
virtual mozilla::TemporaryRef<mozilla::gfx::DrawTarget> StartRemoteDrawing();