This commit is contained in:
Ryan VanderMeulen 2012-07-14 08:48:58 -04:00
Родитель aea56e73f2 ba65734702
Коммит d1492c8590
10 изменённых файлов: 42 добавлений и 105 удалений

Просмотреть файл

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1341001222000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1341959296000">
<emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*">
@ -28,7 +28,7 @@
</versionRange>
</emItem>
<emItem blockID="i107" os="WINNT" id="{ABDE892B-13A8-4d1b-88E6-365A6E755758}">
<versionRange minVersion="0" maxVersion="15.0.4" severity="1">
<versionRange minVersion="0" maxVersion="15.0.5" severity="1">
</versionRange>
</emItem>
<emItem blockID="i88" id="anttoolbar@ant.com">
@ -215,6 +215,10 @@
<versionRange minVersion="0" maxVersion="*">
</versionRange>
</emItem>
<emItem blockID="i111" os="WINNT" id="{C3949AC2-4B17-43ee-B4F1-D26B9D42404D}">
<versionRange minVersion="0" maxVersion="15.0.5" severity="1">
</versionRange>
</emItem>
<emItem blockID="i38" id="{B7082FAA-CB62-4872-9106-E42DD88EDE45}">
<versionRange minVersion="0.1" maxVersion="3.3.0.*">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
@ -328,7 +332,7 @@
</versionRange>
</emItem>
<emItem blockID="i106" os="WINNT" id="{97E22097-9A2F-45b1-8DAF-36AD648C7EF4}">
<versionRange minVersion="0" maxVersion="15.0.4" severity="1">
<versionRange minVersion="0" maxVersion="15.0.5" severity="1">
</versionRange>
</emItem>
<emItem blockID="i11" id="yslow@yahoo-inc.com">

Просмотреть файл

@ -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"

Просмотреть файл

@ -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"

Просмотреть файл

@ -56,7 +56,7 @@ EXPORTS = \
nsIScriptGlobalObject.h \
nsIScriptGlobalObjectOwner.h \
nsIScriptNameSpaceManager.h \
nsIScriptObjectOwner.h \
nsIScriptEventHandlerOwner.h \
nsIScriptObjectPrincipal.h \
nsIScriptRuntime.h \
nsIScriptTimeoutHandler.h \

Просмотреть файл

@ -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<nsIScriptObjectOwner> 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<nsIXPConnectJSObjectHolder> holder;
nsCOMPtr<nsIScriptObjectOwner> 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<nsIDOMGlobalPropertyInitializer> gpi(do_QueryInterface(native));
if (gpi) {
rv = gpi->Init(aWin, &prop_val);
NS_ENSURE_SUCCESS(rv, rv);
}
nsCOMPtr<nsIDOMGlobalPropertyInitializer> 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)) {

Просмотреть файл

@ -11,7 +11,6 @@
#include "xpcpublic.h"
#include "nsIDOMEventListener.h"
class nsIScriptObjectOwner;
class nsIAtom;
#define NS_IJSEVENTLISTENER_IID \

Просмотреть файл

@ -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> 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
*<P>
* 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.
* <P><I>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</I>
*/
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__

Просмотреть файл

@ -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"

Просмотреть файл

@ -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

Просмотреть файл

@ -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());