зеркало из https://github.com/mozilla/gecko-dev.git
Straight revert of layout/* to its mozilla-central state, and removal of testshell which depends on PContentProcess.
--HG-- branch : electrolysis-plugins-only
This commit is contained in:
Родитель
c23e173ce0
Коммит
ac629122ec
|
@ -1,74 +0,0 @@
|
|||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License Version
|
||||
# 1.1 (the "License"); you may not use this file except in compliance with
|
||||
# the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
# for the specific language governing rights and limitations under the
|
||||
# License.
|
||||
#
|
||||
# The Original Code is Mozilla IPCShell.
|
||||
#
|
||||
# The Initial Developer of the Original Code is
|
||||
# Ben Turner <bent.mozilla@gmail.com>.
|
||||
# Portions created by the Initial Developer are Copyright (C) 2009
|
||||
# the Initial Developer. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
#
|
||||
# Alternatively, the contents of this file may be used under the terms of
|
||||
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
# in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
# of those above. If you wish to allow use of your version of this file only
|
||||
# under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
# use your version of this file under the terms of the MPL, indicate your
|
||||
# decision by deleting the provisions above and replace them with the notice
|
||||
# and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
# the provisions above, a recipient may use your version of this file under
|
||||
# the terms of any one of the MPL, the GPL or the LGPL.
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../..
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = ipcshell
|
||||
LIBRARY_NAME = ipcshell_s
|
||||
FORCE_STATIC_LIB = 1
|
||||
LIBXUL_LIBRARY = 1
|
||||
EXPORT_LIBRARY = 1
|
||||
|
||||
EXPORTS_NAMESPACES = mozilla/ipc
|
||||
|
||||
EXPORTS_mozilla/ipc = \
|
||||
TestShellChild.h \
|
||||
TestShellParent.h \
|
||||
XPCShellEnvironment.h \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS += \
|
||||
TestShellChild.cpp \
|
||||
TestShellParent.cpp \
|
||||
XPCShellEnvironment.cpp \
|
||||
$(NULL)
|
||||
|
||||
# For xpcshell error messages and nsDependentJSString
|
||||
LOCAL_INCLUDES += \
|
||||
-I$(topsrcdir)/js/src/xpconnect/shell \
|
||||
-I$(topsrcdir)/dom/base \
|
||||
$(NULL)
|
||||
|
||||
XPCSHELL_TESTS = tests
|
||||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
include $(topsrcdir)/ipc/chromium/chromium-config.mk
|
||||
include $(topsrcdir)/config/rules.mk
|
|
@ -1,60 +0,0 @@
|
|||
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla IPCShell.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ben Turner <bent.mozilla@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
include protocol "PContentProcess.ipdl";
|
||||
include protocol "PTestShellCommand.ipdl";
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
protocol PTestShell
|
||||
{
|
||||
manager PContentProcess;
|
||||
|
||||
manages PTestShellCommand;
|
||||
|
||||
child:
|
||||
ExecuteCommand(nsString aCommand);
|
||||
|
||||
PTestShellCommand(nsString aCommand);
|
||||
|
||||
parent:
|
||||
~PTestShellCommand(nsString aResponse);
|
||||
};
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
|
@ -1,49 +0,0 @@
|
|||
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla IPCShell.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ben Turner <bent.mozilla@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
include protocol "PTestShell.ipdl";
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
protocol PTestShellCommand
|
||||
{
|
||||
manager PTestShell;
|
||||
};
|
||||
|
||||
} // namespace ipc
|
||||
} // namespace mozilla
|
|
@ -1,88 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla IPCShell.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ben Turner <bent.mozilla@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "TestShellChild.h"
|
||||
|
||||
using mozilla::ipc::TestShellChild;
|
||||
using mozilla::ipc::PTestShellCommandChild;
|
||||
using mozilla::ipc::XPCShellEnvironment;
|
||||
|
||||
TestShellChild::TestShellChild()
|
||||
: mXPCShell(XPCShellEnvironment::CreateEnvironment())
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
TestShellChild::RecvExecuteCommand(const nsString& aCommand)
|
||||
{
|
||||
if (mXPCShell->IsQuitting()) {
|
||||
NS_WARNING("Commands sent after quit command issued!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return mXPCShell->EvaluateString(aCommand);
|
||||
}
|
||||
|
||||
PTestShellCommandChild*
|
||||
TestShellChild::AllocPTestShellCommand(const nsString& aCommand)
|
||||
{
|
||||
return new PTestShellCommandChild();
|
||||
}
|
||||
|
||||
bool
|
||||
TestShellChild::DeallocPTestShellCommand(PTestShellCommandChild* aCommand,
|
||||
const nsString& aResponse)
|
||||
{
|
||||
delete aCommand;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TestShellChild::RecvPTestShellCommandConstructor(PTestShellCommandChild* aActor,
|
||||
const nsString& aCommand)
|
||||
{
|
||||
if (mXPCShell->IsQuitting()) {
|
||||
NS_WARNING("Commands sent after quit command issued!");
|
||||
return false;
|
||||
}
|
||||
|
||||
nsString response;
|
||||
if (!mXPCShell->EvaluateString(aCommand, &response)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return SendPTestShellCommandDestructor(aActor, response);
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla IPCShell.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ben Turner <bent.mozilla@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef ipc_testshell_TestShellChild_h
|
||||
#define ipc_testshell_TestShellChild_h 1
|
||||
|
||||
#include "mozilla/ipc/PTestShellChild.h"
|
||||
#include "mozilla/ipc/PTestShellCommandChild.h"
|
||||
#include "mozilla/ipc/XPCShellEnvironment.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
class XPCShellEnvironment;
|
||||
|
||||
class TestShellChild : public PTestShellChild
|
||||
{
|
||||
public:
|
||||
TestShellChild();
|
||||
|
||||
bool
|
||||
RecvExecuteCommand(const nsString& aCommand);
|
||||
|
||||
PTestShellCommandChild*
|
||||
AllocPTestShellCommand(const nsString& aCommand);
|
||||
|
||||
bool
|
||||
RecvPTestShellCommandConstructor(PTestShellCommandChild* aActor,
|
||||
const nsString& aCommand);
|
||||
|
||||
bool
|
||||
DeallocPTestShellCommand(PTestShellCommandChild* aCommand,
|
||||
const nsString& aResponse);
|
||||
|
||||
void SetXPCShell(XPCShellEnvironment* aXPCShell) {
|
||||
mXPCShell = aXPCShell;
|
||||
}
|
||||
|
||||
private:
|
||||
nsAutoPtr<XPCShellEnvironment> mXPCShell;
|
||||
};
|
||||
|
||||
} /* namespace ipc */
|
||||
} /* namespace mozilla */
|
||||
|
||||
#endif /* ipc_testshell_TestShellChild_h */
|
|
@ -1,113 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla IPCShell.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ben Turner <bent.mozilla@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "TestShellParent.h"
|
||||
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
using mozilla::ipc::TestShellParent;
|
||||
using mozilla::ipc::TestShellCommandParent;
|
||||
using mozilla::ipc::PTestShellCommandParent;
|
||||
|
||||
PTestShellCommandParent*
|
||||
TestShellParent::AllocPTestShellCommand(const nsString& aCommand)
|
||||
{
|
||||
return new TestShellCommandParent();
|
||||
}
|
||||
|
||||
bool
|
||||
TestShellParent::DeallocPTestShellCommand(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse)
|
||||
{
|
||||
delete aActor;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TestShellParent::RecvPTestShellCommandDestructor(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse)
|
||||
{
|
||||
TestShellCommandParent* command =
|
||||
reinterpret_cast<TestShellCommandParent*>(aActor);
|
||||
|
||||
JSBool ok = command->RunCallback(aResponse);
|
||||
command->ReleaseCallback();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
JSBool
|
||||
TestShellCommandParent::SetCallback(JSContext* aCx,
|
||||
jsval aCallback)
|
||||
{
|
||||
if (!mCallback.Hold(aCx)) {
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
mCallback = aCallback;
|
||||
mCx = aCx;
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
JSBool
|
||||
TestShellCommandParent::RunCallback(const nsString& aResponse)
|
||||
{
|
||||
NS_ENSURE_TRUE(mCallback && mCx, JS_FALSE);
|
||||
|
||||
JSAutoRequest ar(mCx);
|
||||
|
||||
JSObject* global = JS_GetGlobalObject(mCx);
|
||||
NS_ENSURE_TRUE(global, JS_FALSE);
|
||||
|
||||
JSString* str = JS_NewUCStringCopyN(mCx, aResponse.get(), aResponse.Length());
|
||||
NS_ENSURE_TRUE(str, JS_FALSE);
|
||||
|
||||
jsval argv[] = { STRING_TO_JSVAL(str) };
|
||||
int argc = NS_ARRAY_LENGTH(argv);
|
||||
|
||||
jsval rval;
|
||||
JSBool ok = JS_CallFunctionValue(mCx, global, mCallback, argc, argv, &rval);
|
||||
NS_ENSURE_TRUE(ok, JS_FALSE);
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
TestShellCommandParent::ReleaseCallback()
|
||||
{
|
||||
mCallback.Release();
|
||||
}
|
|
@ -1,85 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla IPCShell.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ben Turner <bent.mozilla@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef ipc_testshell_TestShellParent_h
|
||||
#define ipc_testshell_TestShellParent_h 1
|
||||
|
||||
#include "mozilla/ipc/PTestShellParent.h"
|
||||
#include "mozilla/ipc/PTestShellCommandParent.h"
|
||||
|
||||
#include "jsapi.h"
|
||||
#include "nsAutoJSValHolder.h"
|
||||
#include "nsStringGlue.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
class TestShellCommandParent : public PTestShellCommandParent
|
||||
{
|
||||
public:
|
||||
TestShellCommandParent() : mCx(NULL) { }
|
||||
|
||||
JSBool SetCallback(JSContext* aCx,
|
||||
jsval aCallback);
|
||||
|
||||
JSBool RunCallback(const nsString& aResponse);
|
||||
|
||||
void ReleaseCallback();
|
||||
|
||||
private:
|
||||
JSContext* mCx;
|
||||
nsAutoJSValHolder mCallback;
|
||||
};
|
||||
|
||||
class TestShellParent : public PTestShellParent
|
||||
{
|
||||
public:
|
||||
PTestShellCommandParent*
|
||||
AllocPTestShellCommand(const nsString& aCommand);
|
||||
|
||||
bool
|
||||
DeallocPTestShellCommand(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse);
|
||||
|
||||
bool
|
||||
RecvPTestShellCommandDestructor(PTestShellCommandParent* aActor,
|
||||
const nsString& aResponse);
|
||||
};
|
||||
|
||||
} /* namespace ipc */
|
||||
} /* namespace mozilla */
|
||||
|
||||
#endif /* ipc_testshell_TestShellParent_h */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,132 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is Mozilla IPCShell.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Ben Turner <bent.mozilla@gmail.com>.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef _IPC_TESTSHELL_XPCSHELLENVIRONMENT_H_
|
||||
#define _IPC_TESTSHELL_XPCSHELLENVIRONMENT_H_
|
||||
|
||||
#include "base/basictypes.h"
|
||||
|
||||
#include <string>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "nsAutoJSValHolder.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsDebug.h"
|
||||
#include "nsStringGlue.h"
|
||||
|
||||
struct JSContext;
|
||||
struct JSObject;
|
||||
struct JSPrincipals;
|
||||
|
||||
class nsIJSContextStack;
|
||||
|
||||
namespace mozilla {
|
||||
namespace ipc {
|
||||
|
||||
class XPCShellEnvironment
|
||||
{
|
||||
public:
|
||||
static XPCShellEnvironment* CreateEnvironment();
|
||||
~XPCShellEnvironment();
|
||||
|
||||
bool EvaluateString(const nsString& aString,
|
||||
nsString* aResult = nsnull);
|
||||
|
||||
JSPrincipals* GetPrincipal() {
|
||||
return mJSPrincipals;
|
||||
}
|
||||
|
||||
JSObject* GetGlobalObject() {
|
||||
return mGlobalHolder.ToJSObject();
|
||||
}
|
||||
|
||||
void SetExitCode(int aExitCode) {
|
||||
mExitCode = aExitCode;
|
||||
}
|
||||
int ExitCode() {
|
||||
return mExitCode;
|
||||
}
|
||||
|
||||
void SetIsQuitting() {
|
||||
mQuitting = JS_TRUE;
|
||||
}
|
||||
JSBool IsQuitting() {
|
||||
return mQuitting;
|
||||
}
|
||||
|
||||
void SetShouldReportWarnings(JSBool aReportWarnings) {
|
||||
mReportWarnings = aReportWarnings;
|
||||
}
|
||||
JSBool ShouldReportWarnings() {
|
||||
return mReportWarnings;
|
||||
}
|
||||
|
||||
void SetShouldCompoleOnly(JSBool aCompileOnly) {
|
||||
mCompileOnly = aCompileOnly;
|
||||
}
|
||||
JSBool ShouldCompileOnly() {
|
||||
return mCompileOnly;
|
||||
}
|
||||
|
||||
class AutoContextPusher
|
||||
{
|
||||
public:
|
||||
AutoContextPusher(XPCShellEnvironment* aEnv);
|
||||
~AutoContextPusher();
|
||||
private:
|
||||
XPCShellEnvironment* mEnv;
|
||||
};
|
||||
|
||||
protected:
|
||||
XPCShellEnvironment();
|
||||
bool Init();
|
||||
|
||||
private:
|
||||
JSContext* mCx;
|
||||
nsAutoJSValHolder mGlobalHolder;
|
||||
nsCOMPtr<nsIJSContextStack> mCxStack;
|
||||
JSPrincipals* mJSPrincipals;
|
||||
|
||||
int mExitCode;
|
||||
JSBool mQuitting;
|
||||
JSBool mReportWarnings;
|
||||
JSBool mCompileOnly;
|
||||
};
|
||||
|
||||
} /* namespace ipc */
|
||||
} /* namespace mozilla */
|
||||
|
||||
#endif /* _IPC_TESTSHELL_XPCSHELLENVIRONMENT_H_ */
|
|
@ -1,4 +0,0 @@
|
|||
IPDLSRCS = \
|
||||
PTestShell.ipdl \
|
||||
PTestShellCommand.ipdl \
|
||||
$(NULL)
|
|
@ -1,15 +0,0 @@
|
|||
function callback(result) {
|
||||
do_check_eq(result, Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT);
|
||||
do_test_finished();
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
do_test_pending();
|
||||
|
||||
do_check_eq(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
|
||||
|
||||
sendCommand("load('test_ipcshell_child.js');");
|
||||
sendCommand("runtime.processType;", callback);
|
||||
}
|
||||
load('test_ipcshell_child.js');
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
const Cc = Components.classes;
|
||||
const Ci = Components.interfaces;
|
||||
|
||||
const runtime = Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime);
|
||||
|
||||
if (typeof(run_test) == "undefined") {
|
||||
run_test = function() {
|
||||
do_check_eq(runtime.processType, Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT);
|
||||
}
}
|
|
@ -181,7 +181,6 @@ public:
|
|||
NS_IMETHOD GetDocShell(nsIDocShell **aDocShell);
|
||||
NS_IMETHOD BeginSwapDocShells(nsIFrame* aOther);
|
||||
virtual void EndSwapDocShells(nsIFrame* aOther);
|
||||
virtual nsIFrame* GetFrame() { return this; }
|
||||
|
||||
// nsIReflowCallback
|
||||
virtual PRBool ReflowFinished();
|
||||
|
@ -627,16 +626,52 @@ nsSubDocumentFrame::Reflow(nsPresContext* aPresContext,
|
|||
PRBool
|
||||
nsSubDocumentFrame::ReflowFinished()
|
||||
{
|
||||
if (mFrameLoader) {
|
||||
nsCOMPtr<nsIDocShell> docShell;
|
||||
GetDocShell(getter_AddRefs(docShell));
|
||||
|
||||
nsCOMPtr<nsIBaseWindow> baseWindow(do_QueryInterface(docShell));
|
||||
|
||||
// resize the sub document
|
||||
if (baseWindow) {
|
||||
PRInt32 x = 0;
|
||||
PRInt32 y = 0;
|
||||
|
||||
nsWeakFrame weakFrame(this);
|
||||
|
||||
nsPresContext* presContext = PresContext();
|
||||
baseWindow->GetPositionAndSize(&x, &y, nsnull, nsnull);
|
||||
|
||||
mFrameLoader->UpdatePositionAndSize(this);
|
||||
|
||||
if (weakFrame.IsAlive()) {
|
||||
// Make sure that we can post a reflow callback in the future.
|
||||
mPostedReflowCallback = PR_FALSE;
|
||||
if (!weakFrame.IsAlive()) {
|
||||
// GetPositionAndSize() killed us
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// GetPositionAndSize might have resized us. So now is the time to
|
||||
// get our size.
|
||||
mPostedReflowCallback = PR_FALSE;
|
||||
|
||||
nsSize innerSize(GetSize());
|
||||
if (IsInline()) {
|
||||
nsMargin usedBorderPadding = GetUsedBorderAndPadding();
|
||||
|
||||
// Sadly, XUL smacks the frame size without changing the used
|
||||
// border and padding, so we can't trust those. Subtracting
|
||||
// them might make things negative.
|
||||
innerSize.width -= usedBorderPadding.LeftRight();
|
||||
innerSize.width = NS_MAX(innerSize.width, 0);
|
||||
|
||||
innerSize.height -= usedBorderPadding.TopBottom();
|
||||
innerSize.height = NS_MAX(innerSize.height, 0);
|
||||
}
|
||||
|
||||
PRInt32 cx = presContext->AppUnitsToDevPixels(innerSize.width);
|
||||
PRInt32 cy = presContext->AppUnitsToDevPixels(innerSize.height);
|
||||
baseWindow->SetPositionAndSize(x, y, cx, cy, PR_FALSE);
|
||||
} else {
|
||||
// Make sure that we can post a reflow callback in the future.
|
||||
mPostedReflowCallback = PR_FALSE;
|
||||
}
|
||||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,8 +65,6 @@ public:
|
|||
* The frameloader informs us what kind of widget to create during Show()
|
||||
*/
|
||||
virtual nsIView* CreateViewAndWidget(nsContentType aContentType) = 0;
|
||||
|
||||
virtual nsIFrame* GetFrame() = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче