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, // when the |app.update.cert.checkAttributes| preference is set to false. Also,
// the |app.update.url.override| preference should ONLY be used for testing. // 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 // 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.issuerName", "CN=DigiCert Secure Server CA,O=DigiCert Inc,C=US");
pref("app.update.certs.1.commonName", "aus3.mozilla.org"); 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.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 // Whether or not app updates are enabled
pref("app.update.enabled", true); pref("app.update.enabled", true);
@ -162,7 +162,7 @@ pref("app.update.silent", false);
pref("app.update.staging.enabled", true); pref("app.update.staging.enabled", true);
// Update service URL: // 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.manual is in branding section
// app.update.url.details 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); pref("app.update.staging.enabled", true);
// Update service URL: // 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 // Show the Update Checking/Ready UI when the user was idle for x seconds
pref("app.update.idletime", 60); 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, // when the |app.update.cert.checkAttributes| preference is set to false. Also,
// the |app.update.url.override| preference should ONLY be used for testing. // 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 // 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.issuerName", "CN=DigiCert Secure Server CA,O=DigiCert Inc,C=US");
pref("app.update.certs.1.commonName", "aus3.mozilla.org"); 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.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. // User-settable override to app.update.url for testing purposes.
//pref("app.update.url.override", ""); //pref("app.update.url.override", "");

View File

@ -24,8 +24,9 @@
# their primary interface (and hence whose prototype is this # their primary interface (and hence whose prototype is this
# interface's prototype object). Always False for callback # interface's prototype object). Always False for callback
# interfaces. Defaults to True otherwise. # interfaces. Defaults to True otherwise.
# * workers - Indicates whether the descriptor is intended to be used for # * workers - Indicates whether the descriptor is intended to be used solely
# worker threads (defaults to false). # 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 # * customTrace - The native class will use a custom trace hook (defaults to
# true for workers, false otherwise). # true for workers, false otherwise).
# * customFinalize - The native class will use a custom finalize hook # * customFinalize - The native class will use a custom finalize hook
@ -59,7 +60,7 @@
# call delete through XPConnect's deferred finalization # call delete through XPConnect's deferred finalization
# mechanism, for a refcounted object it'll call Release # mechanism, for a refcounted object it'll call Release
# through XPConnect's deferred finalization mechanism. # through XPConnect's deferred finalization mechanism.
# Always 'worker' for worker descriptors. Defaults to # 'worker' opts into old style worker models. Defaults to
# 'refcounted'. # 'refcounted'.
# #
# The following fields are either a string, an array (defaults to an empty # The following fields are either a string, an array (defaults to an empty
@ -387,7 +388,14 @@ DOMInterfaces = {
}, },
{ {
'workers': True, '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': { 'Exception': {
@ -414,6 +422,7 @@ DOMInterfaces = {
'FileReaderSync': { 'FileReaderSync': {
'workers': True, 'workers': True,
'wrapperCache': False,
}, },
'FileRequest': { 'FileRequest': {
@ -1245,6 +1254,7 @@ DOMInterfaces = {
}, },
{ {
'workers': True, 'workers': True,
'nativeOwnership': 'worker',
}], }],
'VTTCue': { 'VTTCue': {
@ -1425,13 +1435,11 @@ DOMInterfaces = {
'WorkerLocation': { 'WorkerLocation': {
'headerFile': 'mozilla/dom/workers/bindings/Location.h', 'headerFile': 'mozilla/dom/workers/bindings/Location.h',
'castable': True,
'workers': True, 'workers': True,
}, },
'WorkerNavigator': { 'WorkerNavigator': {
'headerFile': 'mozilla/dom/workers/bindings/Navigator.h', 'headerFile': 'mozilla/dom/workers/bindings/Navigator.h',
'castable': True,
'workers': True, 'workers': True,
}, },
@ -1443,6 +1451,13 @@ DOMInterfaces = {
}, },
{ {
'workers': True, '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': [ 'XMLHttpRequestEventTarget': [
@ -1453,6 +1468,7 @@ DOMInterfaces = {
}, },
{ {
'workers': True, 'workers': True,
'nativeOwnership': 'worker',
'concrete': False, 'concrete': False,
}], }],
@ -1463,6 +1479,7 @@ DOMInterfaces = {
}, },
{ {
'workers': True, 'workers': True,
'nativeOwnership': 'worker',
}], }],
'XMLSerializer': { 'XMLSerializer': {

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -268,7 +268,12 @@ private:
return false; 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]); aArgs.rval().set(scope->mSlots[SLOT_location]);
@ -418,7 +423,12 @@ private:
return false; 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]); aArgs.rval().set(scope->mSlots[SLOT_navigator]);

View File

@ -7,6 +7,7 @@
#include "DrawTargetCG.h" #include "DrawTargetCG.h"
#include "QuartzSupport.h" #include "QuartzSupport.h"
#include "Tools.h"
namespace mozilla { namespace mozilla {
namespace gfx { namespace gfx {
@ -127,7 +128,9 @@ SourceSurfaceCG::InitFromData(unsigned char *aData,
assert(aSize.width >= 0 && aSize.height >= 0); assert(aSize.width >= 0 && aSize.height >= 0);
void *data = malloc(aStride * aSize.height); 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; mFormat = aFormat;
mImage = CreateCGImage(data, data, aSize, aStride, aFormat); mImage = CreateCGImage(data, data, aSize, aStride, aFormat);
@ -162,7 +165,7 @@ DataSourceSurfaceCG::InitFromData(unsigned char *aData,
} }
void *data = malloc(aStride * aSize.height); 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; mFormat = aFormat;
mImage = CreateCGImage(data, data, aSize, aStride, aFormat); mImage = CreateCGImage(data, data, aSize, aStride, aFormat);

View File

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

View File

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

View File

@ -25,6 +25,7 @@
#include "mozilla/gfx/BasePoint.h" // for BasePoint #include "mozilla/gfx/BasePoint.h" // for BasePoint
#include "mozilla/gfx/BaseRect.h" // for BaseRect #include "mozilla/gfx/BaseRect.h" // for BaseRect
#include "mozilla/gfx/BaseSize.h" // for BaseSize #include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/gfx/2D.h" // for DrawTarget, etc
#include "mozilla/mozalloc.h" // for operator new #include "mozilla/mozalloc.h" // for operator new
#include "nsCOMPtr.h" // for already_AddRefed #include "nsCOMPtr.h" // for already_AddRefed
#include "nsDebug.h" // for NS_ASSERTION, etc #include "nsDebug.h" // for NS_ASSERTION, etc
@ -35,6 +36,9 @@
#include "LayerManagerOGLProgram.h" // for ShaderProgramOGL, etc #include "LayerManagerOGLProgram.h" // for ShaderProgramOGL, etc
#include "gfx2DGlue.h" #include "gfx2DGlue.h"
using namespace mozilla;
using namespace mozilla::gfx;
namespace mozilla { namespace mozilla {
namespace layers { namespace layers {
@ -73,14 +77,25 @@ CreateClampOrRepeatTextureImage(GLContext *aGl,
static void static void
SetAntialiasingFlags(Layer* aLayer, gfxContext* aTarget) SetAntialiasingFlags(Layer* aLayer, gfxContext* aTarget)
{ {
nsRefPtr<gfxASurface> surface = aTarget->CurrentSurface(); if (aTarget->IsCairo()) {
if (surface->GetContentType() != GFX_CONTENT_COLOR_ALPHA) { nsRefPtr<gfxASurface> surface = aTarget->CurrentSurface();
// Destination doesn't have alpha channel; no need to set any special flags if (surface->GetContentType() != GFX_CONTENT_COLOR_ALPHA) {
return; // Destination doesn't have alpha channel; no need to set any special flags
} return;
}
surface->SetSubpixelAntialiasingEnabled( surface->SetSubpixelAntialiasingEnabled(
!(aLayer->GetContentFlags() & Layer::CONTENT_COMPONENT_ALPHA)); !(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 class ThebesLayerBufferOGL
@ -761,31 +776,40 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
"BeginUpdate should always modify the draw region in the same way!"); "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(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)); FillSurface(onWhite, result.mRegionToDraw, nsIntPoint(0,0), gfxRGBA(1.0, 1.0, 1.0, 1.0));
gfxASurface* surfaces[2] = { onBlack, onWhite }; if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(BACKEND_COREGRAPHICS)) {
nsRefPtr<gfxTeeSurface> surf = new gfxTeeSurface(surfaces, ArrayLength(surfaces)); 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));
// XXX If the device offset is set on the individual surfaces instead of on // XXX If the device offset is set on the individual surfaces instead of on
// the tee surface, we render in the wrong place. Why? // the tee surface, we render in the wrong place. Why?
gfxPoint deviceOffset = onBlack->GetDeviceOffset(); gfxPoint deviceOffset = onBlack->GetDeviceOffset();
onBlack->SetDeviceOffset(gfxPoint(0, 0)); onBlack->SetDeviceOffset(gfxPoint(0, 0));
onWhite->SetDeviceOffset(gfxPoint(0, 0)); onWhite->SetDeviceOffset(gfxPoint(0, 0));
surf->SetDeviceOffset(deviceOffset); surf->SetDeviceOffset(deviceOffset);
// Using this surface as a source will likely go horribly wrong, since // Using this surface as a source will likely go horribly wrong, since
// only the onBlack surface will really be used, so alpha information will // only the onBlack surface will really be used, so alpha information will
// be incorrect. // be incorrect.
surf->SetAllowUseAsSource(false); surf->SetAllowUseAsSource(false);
result.mContext = new gfxContext(surf); result.mContext = new gfxContext(surf);
}
} else { } else {
result.mContext = nullptr; result.mContext = nullptr;
} }
} else { } else {
result.mContext = new gfxContext(mTexImage->BeginUpdate(result.mRegionToDraw)); nsRefPtr<gfxASurface> surf = mTexImage->BeginUpdate(result.mRegionToDraw);
if (mTexImage->GetContentType() == GFX_CONTENT_COLOR_ALPHA) { if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(BACKEND_COREGRAPHICS)) {
gfxUtils::ClipToRegion(result.mContext, result.mRegionToDraw); RefPtr<DrawTarget> dt = gfxPlatform::GetPlatform()->CreateDrawTargetForUpdateSurface(surf, surf->GetSize());
result.mContext->SetOperator(gfxContext::OPERATOR_CLEAR); result.mContext = new gfxContext(dt);
result.mContext->Paint(); result.mContext->Translate(surf->GetDeviceOffset());
result.mContext->SetOperator(gfxContext::OPERATOR_OVER); } else {
result.mContext = new gfxContext(surf);
} }
} }
if (!result.mContext) { if (!result.mContext) {
@ -806,6 +830,12 @@ BasicBufferOGL::BeginPaint(ContentType aContentType,
// clip and draw regions. // clip and draw regions.
gfxUtils::ClipToRegion(result.mContext, result.mRegionToDraw); 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; 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_LESS: res = -1; break;
case UCOL_EQUAL: res = 0; break; case UCOL_EQUAL: res = 0; break;
case UCOL_GREATER: res = 1; break; case UCOL_GREATER: res = 1; break;
default: MOZ_ASSUME_UNREACHABLE("ucol_strcoll returned bad UCollationResult");
} }
result.setInt32(res); result.setInt32(res);
return true; 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 == linear-zero-length-1c.html linear-zero-length-1-ref.html
== nostops.html about:blank == nostops.html about:blank
== onestop.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,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,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,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,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-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-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-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 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-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 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 == 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 == 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-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 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-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-02.svg paint-order-02-ref.svg
pref(svg.paint-order.enabled,true) == paint-order-03.svg paint-order-03-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-02.svg pass.svg
== path-03.svg pass.svg == path-03.svg pass.svg
== path-04.svg pass.svg == path-04.svg pass.svg

View File

@ -1809,7 +1809,7 @@ CSS_PROP_FONT(
kFontStyleKTable, kFontStyleKTable,
offsetof(nsStyleFont, mFont.style), offsetof(nsStyleFont, mFont.style),
eStyleAnimType_EnumU8) eStyleAnimType_EnumU8)
CSS_PROP_FONT( CSS_PROP_FONT(
font-synthesis, font-synthesis,
font_synthesis, font_synthesis,
FontSynthesis, FontSynthesis,

View File

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

View File

@ -19,3 +19,4 @@ cp $1/src/*.cc ./
patch -p3 < add-mfbt-api-markers.patch patch -p3 < add-mfbt-api-markers.patch
patch -p3 < use-StandardInteger.patch patch -p3 < use-StandardInteger.patch
patch -p3 < use-mozilla-assertions.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. // another thus avoiding the warning.
template <class Dest, class Source> template <class Dest, class Source>
inline Dest BitCast(const Source& source) { inline Dest BitCast(const Source& source) {
// Compile time assertion: sizeof(Dest) == sizeof(Source) static_assert(sizeof(Dest) == sizeof(Source),
// A compile error here means your Dest and Source have different sizes. "BitCast's source and destination types must be the same size");
typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1];
Dest dest; Dest dest;
memmove(&dest, &source, sizeof(dest)); memmove(&dest, &source, sizeof(dest));

View File

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

View File

@ -2043,17 +2043,6 @@ nsChildView::PreRender(LayerManager* aManager)
[(ChildView*)mView preRender:glContext]; [(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 void
nsChildView::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect) nsChildView::DrawWindowOverlay(LayerManager* aManager, nsIntRect aRect)
{ {
@ -2896,17 +2885,6 @@ NSEvent* gLastDragMouseDownEvent = nil;
[aGLContext setView:self]; [aGLContext setView:self];
[aGLContext update]; [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; NS_OBJC_END_TRY_ABORT_BLOCK;
} }
@ -3245,7 +3223,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
[super lockFocus]; [super lockFocus];
if (mGLContext && !mUsingOMTCompositor) { if (mGLContext) {
if ([mGLContext view] != self) { if ([mGLContext view] != self) {
[mGLContext setView:self]; [mGLContext setView:self];
} }
@ -3389,11 +3367,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
targetSurface->SetAllowUseAsSource(false); targetSurface->SetAllowUseAsSource(false);
nsRefPtr<gfxContext> targetContext; nsRefPtr<gfxContext> targetContext;
if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(mozilla::gfx::BACKEND_CAIRO)) { if (gfxPlatform::GetPlatform()->SupportsAzureContentForType(gfx::BACKEND_CAIRO)) {
RefPtr<mozilla::gfx::DrawTarget> dt = RefPtr<gfx::DrawTarget> dt =
gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(targetSurface, gfxPlatform::GetPlatform()->CreateDrawTargetForSurface(targetSurface,
mozilla::gfx::IntSize(backingSize.width, gfx::IntSize(backingSize.width,
backingSize.height)); 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); targetContext = new gfxContext(dt);
} else { } else {
targetContext = new gfxContext(targetSurface); targetContext = new gfxContext(targetSurface);

View File

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

View File

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