diff --git a/browser/app/blocklist.xml b/browser/app/blocklist.xml index c61a1c000927..06e39b889cc2 100644 --- a/browser/app/blocklist.xml +++ b/browser/app/blocklist.xml @@ -1,5 +1,5 @@ - + @@ -28,7 +28,7 @@ - + @@ -215,6 +215,10 @@ + + + + @@ -328,7 +332,7 @@ - + diff --git a/content/events/src/nsEventListenerManager.cpp b/content/events/src/nsEventListenerManager.cpp index 1e9422de3ffc..c260cc92b676 100644 --- a/content/events/src/nsEventListenerManager.cpp +++ b/content/events/src/nsEventListenerManager.cpp @@ -40,7 +40,7 @@ #include "nsMutationEvent.h" #include "nsIXPConnect.h" #include "nsDOMCID.h" -#include "nsIScriptObjectOwner.h" // for nsIScriptEventHandlerOwner +#include "nsIScriptEventHandlerOwner.h" #include "nsFocusManager.h" #include "nsIDOMElement.h" #include "nsContentUtils.h" diff --git a/content/xul/content/src/nsXULElement.h b/content/xul/content/src/nsXULElement.h index 6230367519cc..a89f5db11b04 100644 --- a/content/xul/content/src/nsXULElement.h +++ b/content/xul/content/src/nsXULElement.h @@ -25,7 +25,7 @@ #include "nsEventListenerManager.h" #include "nsIRDFCompositeDataSource.h" #include "nsIRDFResource.h" -#include "nsIScriptObjectOwner.h" +#include "nsIScriptEventHandlerOwner.h" #include "nsBindingManager.h" #include "nsIURI.h" #include "nsIXULTemplateBuilder.h" diff --git a/dom/base/Makefile.in b/dom/base/Makefile.in index 47eadd9490cc..ad87f9ec459f 100644 --- a/dom/base/Makefile.in +++ b/dom/base/Makefile.in @@ -56,7 +56,7 @@ EXPORTS = \ nsIScriptGlobalObject.h \ nsIScriptGlobalObjectOwner.h \ nsIScriptNameSpaceManager.h \ - nsIScriptObjectOwner.h \ + nsIScriptEventHandlerOwner.h \ nsIScriptObjectPrincipal.h \ nsIScriptRuntime.h \ nsIScriptTimeoutHandler.h \ diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 2a92ef40d815..d33b9b97be7a 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -85,7 +85,7 @@ #include "nsIInterfaceRequestor.h" #include "nsIInterfaceRequestorUtils.h" #include "nsScriptNameSpaceManager.h" -#include "nsIScriptObjectOwner.h" +#include "nsIScriptEventHandlerOwner.h" #include "nsIJSNativeInitializer.h" #include "nsJSEnvironment.h" @@ -5799,23 +5799,6 @@ BaseStubConstructor(nsIWeakReference* aWeakOwner, } } - nsCOMPtr owner(do_QueryInterface(native)); - if (owner) { - nsIScriptContext *context = nsJSUtils::GetStaticScriptContext(cx, obj); - if (!context) { - return NS_ERROR_UNEXPECTED; - } - - JSObject* new_obj; - rv = owner->GetScriptObject(context, (void**)&new_obj); - - if (NS_SUCCEEDED(rv)) { - *rval = OBJECT_TO_JSVAL(new_obj); - } - - return rv; - } - return WrapNative(cx, obj, native, true, rval); } @@ -6950,23 +6933,10 @@ nsWindowSH::GlobalResolve(nsGlobalWindow *aWin, JSContext *cx, jsval prop_val = JSVAL_VOID; // Property value. nsCOMPtr holder; - nsCOMPtr owner(do_QueryInterface(native)); - if (owner) { - nsIScriptContext *context = nsJSUtils::GetStaticScriptContext(cx, obj); - NS_ENSURE_TRUE(context, NS_ERROR_UNEXPECTED); - - JSObject *prop_obj = nsnull; - rv = owner->GetScriptObject(context, (void**)&prop_obj); - NS_ENSURE_TRUE(NS_SUCCEEDED(rv) && prop_obj, NS_ERROR_UNEXPECTED); - - prop_val = OBJECT_TO_JSVAL(prop_obj); - } else { - nsCOMPtr gpi(do_QueryInterface(native)); - - if (gpi) { - rv = gpi->Init(aWin, &prop_val); - NS_ENSURE_SUCCESS(rv, rv); - } + nsCOMPtr gpi(do_QueryInterface(native)); + if (gpi) { + rv = gpi->Init(aWin, &prop_val); + NS_ENSURE_SUCCESS(rv, rv); } if (JSVAL_IS_PRIMITIVE(prop_val) && !JSVAL_IS_NULL(prop_val)) { diff --git a/dom/base/nsIJSEventListener.h b/dom/base/nsIJSEventListener.h index c8e4d0fab901..cc272556ee13 100644 --- a/dom/base/nsIJSEventListener.h +++ b/dom/base/nsIJSEventListener.h @@ -11,7 +11,6 @@ #include "xpcpublic.h" #include "nsIDOMEventListener.h" -class nsIScriptObjectOwner; class nsIAtom; #define NS_IJSEVENTLISTENER_IID \ diff --git a/dom/base/nsIScriptObjectOwner.h b/dom/base/nsIScriptEventHandlerOwner.h similarity index 57% rename from dom/base/nsIScriptObjectOwner.h rename to dom/base/nsIScriptEventHandlerOwner.h index b97661bd926d..28b91f567b83 100644 --- a/dom/base/nsIScriptObjectOwner.h +++ b/dom/base/nsIScriptEventHandlerOwner.h @@ -3,8 +3,8 @@ * 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 nsIScriptObjectOwner_h__ -#define nsIScriptObjectOwner_h__ +#ifndef nsIScriptEventHandlerOwner_h__ +#define nsIScriptEventHandlerOwner_h__ #include "nsISupports.h" #include "nsIScriptContext.h" @@ -12,53 +12,6 @@ template class nsScriptObjectHolder; -#define NS_ISCRIPTOBJECTOWNER_IID \ -{ /* 8f6bca7e-ce42-11d1-b724-00600891d8c9 */ \ -0x8f6bca7e, 0xce42, 0x11d1, \ - {0xb7, 0x24, 0x00, 0x60, 0x08, 0x91, 0xd8, 0xc9} } \ - -/** - * Creates a link between the script object and its native implementation - *

- * Every object that wants to be exposed in a script environment should - * implement this interface. This interface should guarantee that the same - * script object is returned in the context of the same script. - *

It does have a bit too much java script information now, that - * should be removed in a short time. Ideally this interface will be - * language neutral - */ -class nsIScriptObjectOwner : public nsISupports { -public: - NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTOBJECTOWNER_IID) - - /** - * Return the script object associated with this object. - * Create a script object if not present. - * - * @param aContext the context the script object has to be created in - * @param aScriptObject on return will contain the script object - * - * @return nsresult NS_OK if the script object is successfully returned - * - **/ - NS_IMETHOD GetScriptObject(nsIScriptContext *aContext, void** aScriptObject) = 0; - - /** - * Set the script object associated with this object. - * Often used to either reset the object to null or initially - * set it in cases where the object comes before the owner. - * - * @param aScriptObject the script object to set - * - * @return nsresult NS_OK if the script object is successfully set - * - **/ - NS_IMETHOD SetScriptObject(void* aScriptObject) = 0; -}; - -NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptObjectOwner, - NS_ISCRIPTOBJECTOWNER_IID) - class nsIAtom; #define NS_ISCRIPTEVENTHANDLEROWNER_IID \ @@ -108,4 +61,4 @@ public: NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptEventHandlerOwner, NS_ISCRIPTEVENTHANDLEROWNER_IID) -#endif // nsIScriptObjectOwner_h__ +#endif // nsIScriptEventHandlerOwner_h__ diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp index 6cf836409261..0e7fa6b50b3b 100644 --- a/dom/base/nsJSUtils.cpp +++ b/dom/base/nsJSUtils.cpp @@ -16,7 +16,6 @@ #include "jsdbgapi.h" #include "prprf.h" #include "nsIScriptContext.h" -#include "nsIScriptObjectOwner.h" #include "nsIScriptGlobalObject.h" #include "nsIServiceManager.h" #include "nsIXPConnect.h" diff --git a/js/xpconnect/idl/nsIXPConnect.idl b/js/xpconnect/idl/nsIXPConnect.idl index 23b0c9f43276..0f979ef1a14c 100644 --- a/js/xpconnect/idl/nsIXPConnect.idl +++ b/js/xpconnect/idl/nsIXPConnect.idl @@ -423,9 +423,6 @@ interface nsIXPConnect : nsISupports * as an nsIXPConnectWrappedNative. * 2) The xpcom object is in fact a nsIXPConnectWrappedJS and thus already * has an underlying JSObject. - * 3) The xpcom object implements nsIScriptObjectOwner; i.e. is an idlc - * style DOM object for which we can call GetScriptObject to get the - * JSObject it uses to represent itself into JavaScript. * * It *might* be possible to QueryInterface the nsIXPConnectJSObjectHolder * returned by the method into a nsIXPConnectWrappedNative or a diff --git a/mozglue/linker/CustomElf.cpp b/mozglue/linker/CustomElf.cpp index b21c148cfe41..9b3083d688d0 100644 --- a/mozglue/linker/CustomElf.cpp +++ b/mozglue/linker/CustomElf.cpp @@ -394,15 +394,30 @@ CustomElf::LoadSegment(const Phdr *pt_load) const ((pt_load->p_flags & PF_R) ? PROT_READ : 0); /* Mmap at page boundary */ - Addr page_offset = pt_load->p_vaddr & ~PAGE_MASK; - void *where = GetPtr(pt_load->p_vaddr - page_offset); - debug("%s: Loading segment @%p %c%c%c", GetPath(), where, - prot & PROT_READ ? 'r' : '-', - prot & PROT_WRITE ? 'w' : '-', - prot & PROT_EXEC ? 'x' : '-'); - void *mapped = mappable->mmap(where, pt_load->p_filesz + page_offset, - prot, MAP_PRIVATE | MAP_FIXED, - pt_load->p_offset - page_offset); + Addr align = PAGE_SIZE; + void *mapped, *where; + do { + Addr align_offset = pt_load->p_vaddr & (align - 1); + where = GetPtr(pt_load->p_vaddr - align_offset); + debug("%s: Loading segment @%p %c%c%c", GetPath(), where, + prot & PROT_READ ? 'r' : '-', + prot & PROT_WRITE ? 'w' : '-', + prot & PROT_EXEC ? 'x' : '-'); + mapped = mappable->mmap(where, pt_load->p_filesz + align_offset, + prot, MAP_PRIVATE | MAP_FIXED, + pt_load->p_offset - align_offset); + if ((mapped != MAP_FAILED) || (pt_load->p_vaddr == 0) || + (pt_load->p_align == align)) + break; + /* The virtual address space for the library is properly aligned at + * 16k on ARMv6 (see CustomElf::Load), and so is the first segment + * (p_vaddr == 0). But subsequent segments may not be 16k aligned + * and fail to mmap. In such case, try to mmap again at the p_align + * boundary instead of page boundary. */ + debug("%s: Failed to mmap, retrying"); + align = pt_load->p_align; + } while (1); + if (mapped != where) { if (mapped == MAP_FAILED) { log("%s: Failed to mmap", GetPath());