Bug 516522 - CPOW: Cross-Process (JavaScript) Object Wrapper. r=mrbkap r=bent sr=jst
This commit is contained in:
@@ -75,6 +75,8 @@
|
||||
#include "nsIDocShellLoadInfo.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIXPConnect.h"
|
||||
#include "nsIJSContextStack.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIScriptSecurityManager.h"
|
||||
@@ -123,6 +125,8 @@ using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
#endif
|
||||
|
||||
#include "jsapi.h"
|
||||
|
||||
class nsAsyncDocShellDestroyer : public nsRunnable
|
||||
{
|
||||
public:
|
||||
@@ -1594,6 +1598,24 @@ nsFrameLoader::SendCrossProcessKeyEvent(const nsAString& aType,
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsFrameLoader::GetCrossProcessObjectWrapper(nsIVariant** cpow)
|
||||
{
|
||||
nsIXPConnect* xpc;
|
||||
nsIThreadJSContextStack* stack;
|
||||
JSContext* cx;
|
||||
JSObject* global;
|
||||
|
||||
if ((xpc = nsContentUtils::XPConnect()) &&
|
||||
(stack = nsContentUtils::ThreadJSContextStack()) &&
|
||||
NS_SUCCEEDED(stack->Peek(&cx)) && cx &&
|
||||
mChildProcess->GetGlobalJSObject(cx, &global)) {
|
||||
return xpc->JSToVariant(cx, OBJECT_TO_JSVAL(global), cpow);
|
||||
}
|
||||
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsFrameLoader::CreateStaticClone(nsIFrameLoader* aDest)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user