Backout 949cb1977ef9 (bug 714861) for build bustage

This commit is contained in:
Ed Morley 2012-04-25 16:51:31 +01:00
Родитель 8746411d63
Коммит 8fa462d93e
11 изменённых файлов: 51 добавлений и 167 удалений

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

@ -425,10 +425,9 @@ pref("browser.link.open_newwindow", 3);
// 2: don't divert window.open with features
pref("browser.link.open_newwindow.restriction", 0);
// Enable browser frames, but not OOP.
// Enable browser frame
pref("dom.mozBrowserFramesEnabled", true);
pref("dom.mozBrowserFramesWhitelist", "http://homescreen.gaiamobile.org,http://browser.gaiamobile.org");
pref("dom.ipc.tabs.disabled", true);
// Temporary permission hack for WebSMS
pref("dom.sms.enabled", true);

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

@ -457,13 +457,8 @@ nsFrameLoader::ReallyStartLoadingInternal()
}
}
if (mRemoteBrowserShown || ShowRemoteFrame(nsIntSize(0, 0))) {
// FIXME get error codes from child
mRemoteBrowser->LoadURL(mURIToLoad);
} else {
NS_WARNING("[nsFrameLoader] ReallyStartLoadingInternal tried but couldn't show remote browser.\n");
}
// FIXME get error codes from child
mRemoteBrowser->LoadURL(mURIToLoad);
return NS_OK;
}
@ -917,18 +912,6 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size)
// cross-process layers; need to figure out what behavior we really
// want here. For now, hack.
if (!mRemoteBrowserShown) {
if (!mOwnerContent ||
!mOwnerContent->GetCurrentDoc()) {
return false;
}
nsRefPtr<layers::LayerManager> layerManager =
nsContentUtils::LayerManagerForDocument(mOwnerContent->GetCurrentDoc());
if (!layerManager) {
// This is just not going to work.
return false;
}
mRemoteBrowser->Show(size);
mRemoteBrowserShown = true;
@ -1372,27 +1355,19 @@ nsFrameLoader::SetOwnerContent(Element* aContent)
}
}
bool
nsFrameLoader::OwnerIsBrowserFrame()
{
nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(mOwnerContent);
bool isBrowser = false;
if (browserFrame) {
browserFrame->GetReallyIsBrowser(&isBrowser);
}
return isBrowser;
}
bool
nsFrameLoader::ShouldUseRemoteProcess()
{
// Check for *disabled* multi-process first: environment, pref
// Then check for *enabled* multi-process attribute
// Default is not-remote.
if (PR_GetEnv("MOZ_DISABLE_OOP_TABS") ||
Preferences::GetBool("dom.ipc.tabs.disabled", false)) {
return false;
}
return OwnerIsBrowserFrame() ||
(bool) mOwnerContent->AttrValueIs(kNameSpaceID_None,
return (bool) mOwnerContent->AttrValueIs(kNameSpaceID_None,
nsGkAtoms::Remote,
nsGkAtoms::_true,
eCaseMatters);
@ -1867,27 +1842,24 @@ nsFrameLoader::TryRemoteBrowser()
nsCOMPtr<nsIDocShellTreeItem> parentAsItem(do_QueryInterface(parentAsWebNav));
// <iframe mozbrowser> gets to skip these checks.
if (!OwnerIsBrowserFrame()) {
PRInt32 parentType;
parentAsItem->GetItemType(&parentType);
PRInt32 parentType;
parentAsItem->GetItemType(&parentType);
if (parentType != nsIDocShellTreeItem::typeChrome) {
return false;
}
if (parentType != nsIDocShellTreeItem::typeChrome) {
return false;
}
if (!mOwnerContent->IsXUL()) {
return false;
}
if (!mOwnerContent->IsXUL()) {
return false;
}
nsAutoString value;
mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
nsAutoString value;
mOwnerContent->GetAttr(kNameSpaceID_None, nsGkAtoms::type, value);
if (!value.LowerCaseEqualsLiteral("content") &&
!StringBeginsWith(value, NS_LITERAL_STRING("content-"),
nsCaseInsensitiveStringComparator())) {
return false;
}
if (!value.LowerCaseEqualsLiteral("content") &&
!StringBeginsWith(value, NS_LITERAL_STRING("content-"),
nsCaseInsensitiveStringComparator())) {
return false;
}
PRUint32 chromeFlags = 0;
@ -2159,19 +2131,6 @@ nsFrameLoader::GetRootContentView(nsIContentView** aContentView)
return NS_OK;
}
static already_AddRefed<nsIDocShell>
GetRootDocShell(nsIDocument *aDocument)
{
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aDocument->GetWindow());
nsCOMPtr<nsIDocShellTreeItem> treeItem = do_QueryInterface(webNav);
NS_ENSURE_TRUE(treeItem, NULL);
nsCOMPtr<nsIDocShellTreeItem> rootItem;
treeItem->GetRootTreeItem(getter_AddRefs(rootItem));
nsCOMPtr<nsIDocShell> rootDocShell = do_QueryInterface(rootItem);
return rootDocShell.forget();
}
nsresult
nsFrameLoader::EnsureMessageManager()
{
@ -2200,12 +2159,8 @@ nsFrameLoader::EnsureMessageManager()
NS_ENSURE_STATE(cx);
nsCOMPtr<nsIDOMChromeWindow> chromeWindow =
do_QueryInterface(OwnerDoc()->GetWindow());
if (!chromeWindow) {
nsCOMPtr<nsIDocShell> rootDocShell = GetRootDocShell(OwnerDoc());
nsCOMPtr<nsIDOMWindow> rootWindow = do_GetInterface(rootDocShell);
chromeWindow = do_GetInterface(rootWindow);
}
do_QueryInterface(mOwnerContent->OwnerDoc()->GetWindow());
NS_ENSURE_STATE(chromeWindow);
nsCOMPtr<nsIChromeFrameMessageManager> parentManager;
chromeWindow->GetMessageManager(getter_AddRefs(parentManager));

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

@ -295,12 +295,6 @@ private:
bool ShouldUseRemoteProcess();
/**
* Is this a frameloader for a bona fide <iframe mozbrowser>? (I.e., does
* the frame return true for nsIMozBrowserFrame::GetReallyIsBrowser()?)
*/
bool OwnerIsBrowserFrame();
/**
* If we are an IPC frame, set mRemoteFrame. Otherwise, create and
* initialize mDocShell.

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

@ -100,8 +100,6 @@
#include "nsIDOMUIEvent.h"
#include "nsDOMDragEvent.h"
#include "nsIDOMNSEditableElement.h"
#include "nsIDOMMozBrowserFrame.h"
#include "nsIMozBrowserFrame.h"
#include "nsCaret.h"
@ -1703,30 +1701,12 @@ nsEventStateManager::DispatchCrossProcessEvent(nsEvent* aEvent, nsIFrameLoader*
bool
nsEventStateManager::IsRemoteTarget(nsIContent* target) {
if (!target) {
return false;
}
// <browser/iframe remote=true> from XUL
if ((target->Tag() == nsGkAtoms::browser ||
target->Tag() == nsGkAtoms::iframe) &&
target->IsXUL() &&
target->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote,
nsGkAtoms::_true, eIgnoreCase)) {
return true;
}
// <frame/iframe mozbrowser>
nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(target);
if (browserFrame) {
bool isRemote = false;
browserFrame->GetReallyIsBrowser(&isRemote);
if (isRemote) {
return true;
}
}
return false;
return target &&
(target->Tag() == nsGkAtoms::browser ||
target->Tag() == nsGkAtoms::iframe) &&
target->IsXUL() &&
target->AttrValueIs(kNameSpaceID_None, nsGkAtoms::Remote,
nsGkAtoms::_true, eIgnoreCase);
}

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

@ -233,9 +233,9 @@ ConsoleListener::Observe(nsIConsoleMessage* aMessage)
ContentChild* ContentChild::sSingleton;
ContentChild::ContentChild()
: mID(PRUint64(-1))
#ifdef ANDROID
, mScreenSize(0, 0)
: mScreenSize(0, 0)
, mID(PRUint64(-1))
#endif
{
// This process is a content process, so it's clearly running in

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

@ -201,6 +201,8 @@ private:
gfxIntSize mScreenSize;
#endif
AppInfo mAppInfo;
/**
* An ID unique to the process containing our corresponding
* content parent.
@ -210,8 +212,6 @@ private:
*/
PRUint64 mID;
AppInfo mAppInfo;
static ContentChild* sSingleton;
DISALLOW_EVIL_CONSTRUCTORS(ContentChild);

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

@ -70,7 +70,6 @@
#include "nsIViewManager.h"
#include "mozilla/unused.h"
#include "nsDebug.h"
#include "nsPrintfCString.h"
using namespace mozilla::dom;
using namespace mozilla::ipc;
@ -94,7 +93,6 @@ TabParent::TabParent()
, mIMESeqno(0)
, mDPI(0)
, mActive(false)
, mShown(false)
{
}
@ -106,7 +104,13 @@ void
TabParent::SetOwnerElement(nsIDOMElement* aElement)
{
mFrameElement = aElement;
TryCacheDPI();
// Cache the DPI of the screen, since we may lose the element/widget later
if (aElement) {
nsCOMPtr<nsIWidget> widget = GetWidget();
NS_ABORT_IF_FALSE(widget, "Non-null OwnerElement must provide a widget!");
mDPI = widget->GetDPI();
}
}
void
@ -193,16 +197,6 @@ TabParent::AnswerCreateWindow(PBrowserParent** retval)
void
TabParent::LoadURL(nsIURI* aURI)
{
if (!mShown) {
nsCAutoString spec;
if (aURI) {
aURI->GetSpec(spec);
}
NS_WARNING(nsPrintfCString(1024, "TabParent::LoadURL(%s) called before "
"Show(). Ignoring LoadURL.\n", spec.get()).get());
return;
}
nsCString spec;
aURI->GetSpec(spec);
@ -213,7 +207,6 @@ void
TabParent::Show(const nsIntSize& size)
{
// sigh
mShown = true;
unused << SendShow(size);
}
@ -628,7 +621,6 @@ TabParent::RecvSetInputContext(const PRInt32& aIMEEnabled,
bool
TabParent::RecvGetDPI(float* aValue)
{
TryCacheDPI();
NS_ABORT_IF_FALSE(mDPI > 0,
"Must not ask for DPI before OwnerElement is received!");
*aValue = mDPI;
@ -856,19 +848,6 @@ TabParent::GetFrameLoader() const
return frameLoaderOwner ? frameLoaderOwner->GetFrameLoader() : nsnull;
}
void
TabParent::TryCacheDPI()
{
if (mDPI > 0) {
return;
}
nsCOMPtr<nsIWidget> widget = GetWidget();
if (widget) {
mDPI = widget->GetDPI();
}
}
already_AddRefed<nsIWidget>
TabParent::GetWidget() const
{
@ -880,8 +859,7 @@ TabParent::GetWidget() const
if (!frame)
return nsnull;
nsCOMPtr<nsIWidget> widget = frame->GetNearestWidget();
return widget.forget();
return nsCOMPtr<nsIWidget>(frame->GetNearestWidget()).forget();
}
} // namespace tabs

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

@ -233,12 +233,10 @@ protected:
float mDPI;
bool mActive;
bool mShown;
private:
already_AddRefed<nsFrameLoader> GetFrameLoader() const;
already_AddRefed<nsIWidget> GetWidget() const;
void TryCacheDPI();
};
} // namespace dom

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

@ -21,15 +21,6 @@ const browserFrameHelpers = {
}
},
'getOOPDisabledPref': function() {
try {
return SpecialPowers.getBoolPref('dom.ipc.tabs.disabled');
}
catch(e) {
return undefined;
}
},
'setEnabledPref': function(enabled) {
if (enabled !== undefined) {
SpecialPowers.setBoolPref('dom.mozBrowserFramesEnabled', enabled);
@ -48,15 +39,6 @@ const browserFrameHelpers = {
}
},
'setOOPDisabledPref': function(value) {
if (value !== undefined) {
SpecialPowers.setBoolPref('dom.ipc.tabs.disabled', value);
}
else {
SpecialPowers.clearUserPref('dom.ipc.tabs.disabled');
}
},
'addToWhitelist': function() {
var whitelist = browserFrameHelpers.getWhitelistPref();
whitelist += ', http://' + window.location.host + ', ';
@ -66,12 +48,10 @@ const browserFrameHelpers = {
'restoreOriginalPrefs': function() {
browserFrameHelpers.setEnabledPref(browserFrameHelpers.origEnabledPref);
browserFrameHelpers.setWhitelistPref(browserFrameHelpers.origWhitelistPref);
browserFrameHelpers.setOOPDisabledPref(browserFrameHelpers.origOOPDisabledPref);
},
'origEnabledPref': null,
'origWhitelistPref': null,
'origOOPDisabledPref': null,
// Two basically-empty pages from two different domains you can load.
'emptyPage1': 'http://example.com' +
@ -84,11 +64,6 @@ const browserFrameHelpers = {
browserFrameHelpers.origEnabledPref = browserFrameHelpers.getEnabledPref();
browserFrameHelpers.origWhitelistPref = browserFrameHelpers.getWhitelistPref();
browserFrameHelpers.origOOPDisabledPref = browserFrameHelpers.getOOPDisabledPref();
// Set OOPDisabledPref to true, because none of these tests pass with OOP
// browser frames, at the moment.
browserFrameHelpers.setOOPDisabledPref(true);
addEventListener('unload', function() {
browserFrameHelpers.restoreOriginalPrefs();

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

@ -52,7 +52,6 @@
#include "nsViewportFrame.h"
#include "nsSubDocumentFrame.h"
#include "nsIObserver.h"
#include "nsContentUtils.h"
typedef nsContentView::ViewConfig ViewConfig;
using namespace mozilla::layers;
@ -642,9 +641,7 @@ RenderFrameParent::AllocPLayers(LayerManager::LayersBackend* aBackendType)
*aBackendType = LayerManager::LAYERS_NONE;
return nsnull;
}
nsRefPtr<LayerManager> lm =
nsContentUtils::LayerManagerForDocument(mFrameLoader->OwnerDoc());
LayerManager* lm = GetLayerManager();
ShadowLayerManager* slm = lm->AsShadowManager();
if (!slm) {
*aBackendType = LayerManager::LAYERS_NONE;
@ -695,6 +692,13 @@ RenderFrameParent::BuildViewMap()
mContentViews = newContentViews;
}
LayerManager*
RenderFrameParent::GetLayerManager() const
{
nsIDocument* doc = mFrameLoader->OwnerDoc();
return doc->GetShell()->GetLayerManager();
}
ShadowLayersParent*
RenderFrameParent::GetShadowLayers() const
{

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

@ -111,6 +111,7 @@ protected:
private:
void BuildViewMap();
LayerManager* GetLayerManager() const;
ShadowLayersParent* GetShadowLayers() const;
ContainerLayer* GetRootLayer() const;