Backed out changeset d87da7f7a3a9 (bug 693555) for android and b2g build bustage

This commit is contained in:
Wes Kocher 2014-07-01 15:50:08 -07:00
Родитель 995bc6046f
Коммит a135a30a9e
19 изменённых файлов: 35 добавлений и 301 удалений

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

@ -376,7 +376,7 @@
label="&spellCheckToggle.label;"
type="checkbox"
accesskey="&spellCheckToggle.accesskey;"
oncommand="InlineSpellCheckerUI.toggleEnabled(window);"/>
oncommand="InlineSpellCheckerUI.toggleEnabled();"/>
<menuitem id="spell-add-dictionaries-main"
label="&spellAddDictionaries.label;"
accesskey="&spellAddDictionaries.accesskey;"

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

@ -150,7 +150,6 @@
#include "mozilla/dom/telephony/PTelephonyChild.h"
#include "mozilla/dom/time/DateCacheCleaner.h"
#include "mozilla/net/NeckoMessageUtils.h"
#include "mozilla/RemoteSpellcheckEngineChild.h"
using namespace base;
using namespace mozilla;
@ -1052,20 +1051,6 @@ ContentChild::AllocPBlobChild(const BlobConstructorParams& aParams)
return nsIContentChild::AllocPBlobChild(aParams);
}
mozilla::PRemoteSpellcheckEngineChild *
ContentChild::AllocPRemoteSpellcheckEngineChild()
{
mozilla::RemoteSpellcheckEngineChild *child = new mozilla::RemoteSpellcheckEngineChild();
return child;
}
bool
ContentChild::DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild *child)
{
delete child;
return true;
}
bool
ContentChild::DeallocPBlobChild(PBlobChild* aActor)
{

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

@ -26,7 +26,6 @@ struct ResourceMapping;
struct OverrideMapping;
namespace mozilla {
class RemoteSpellcheckEngineChild;
namespace ipc {
class OptionalURIParams;
@ -238,8 +237,6 @@ public:
virtual mozilla::jsipc::PJavaScriptChild* AllocPJavaScriptChild() MOZ_OVERRIDE;
virtual bool DeallocPJavaScriptChild(mozilla::jsipc::PJavaScriptChild*) MOZ_OVERRIDE;
virtual PRemoteSpellcheckEngineChild* AllocPRemoteSpellcheckEngineChild() MOZ_OVERRIDE;
virtual bool DeallocPRemoteSpellcheckEngineChild(PRemoteSpellcheckEngineChild*) MOZ_OVERRIDE;
virtual bool RecvSetOffline(const bool& offline) MOZ_OVERRIDE;

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

@ -156,8 +156,6 @@ using namespace mozilla::system;
#include "JavaScriptParent.h"
#include "mozilla/RemoteSpellcheckEngineParent.h"
#ifdef MOZ_B2G_FM
#include "mozilla/dom/FMRadioParent.h"
#endif
@ -2661,20 +2659,6 @@ ContentParent::DeallocPBlobParent(PBlobParent* aActor)
return true;
}
mozilla::PRemoteSpellcheckEngineParent *
ContentParent::AllocPRemoteSpellcheckEngineParent()
{
mozilla::RemoteSpellcheckEngineParent *parent = new mozilla::RemoteSpellcheckEngineParent();
return parent;
}
bool
ContentParent::DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParent *parent)
{
delete parent;
return true;
}
void
ContentParent::KillHard()
{

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

@ -36,7 +36,6 @@ class nsIMemoryReporter;
class ParentIdleListener;
namespace mozilla {
class PRemoteSpellcheckEngineParent;
namespace ipc {
class OptionalURIParams;
@ -247,7 +246,6 @@ public:
RecvPJavaScriptConstructor(PJavaScriptParent* aActor) MOZ_OVERRIDE {
return PContentParent::RecvPJavaScriptConstructor(aActor);
}
virtual PRemoteSpellcheckEngineParent* AllocPRemoteSpellcheckEngineParent() MOZ_OVERRIDE;
virtual bool RecvRecordingDeviceEvents(const nsString& aRecordingStatus,
const nsString& aPageURL,
@ -391,7 +389,6 @@ private:
virtual bool DeallocPJavaScriptParent(mozilla::jsipc::PJavaScriptParent*) MOZ_OVERRIDE;
virtual bool DeallocPRemoteSpellcheckEngineParent(PRemoteSpellcheckEngineParent*) MOZ_OVERRIDE;
virtual PBrowserParent* AllocPBrowserParent(const IPCTabContext& aContext,
const uint32_t& aChromeFlags,
const uint64_t& aId,

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

@ -30,7 +30,6 @@ include protocol PStorage;
include protocol PTelephony;
include protocol PTestShell;
include protocol PJavaScript;
include protocol PRemoteSpellcheckEngine;
include DOMTypes;
include JavaScriptTypes;
include InputStreamParams;
@ -310,7 +309,6 @@ intr protocol PContent
manages PTelephony;
manages PTestShell;
manages PJavaScript;
manages PRemoteSpellcheckEngine;
both:
// Depending on exactly how the new browser is being created, it might be
@ -464,7 +462,6 @@ parent:
async PJavaScript();
sync PRemoteSpellcheckEngine();
PDeviceStorageRequest(DeviceStorageParams params);
PFileSystemRequest(FileSystemParams params);

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

@ -42,7 +42,6 @@
#include "nsString.h" // for nsAutoString, nsString, etc
#include "nsStringFwd.h" // for nsAFlatString
#include "nsStyleUtil.h" // for nsStyleUtil
#include "nsXULAppAPI.h" // for XRE_GetProcessType
using namespace mozilla;
@ -156,12 +155,6 @@ DictionaryFetcher::Fetch(nsIEditor* aEditor)
{
NS_ENSURE_ARG_POINTER(aEditor);
if (XRE_GetProcessType() == GeckoProcessType_Content) {
// ContentPrefs are currently broken under multiprocess firefox. Bug 1027898
// Skip this custom pref option for now in e10s
return NS_ERROR_FAILURE;
}
nsresult rv;
nsCOMPtr<nsIURI> docUri;
@ -712,10 +705,6 @@ nsEditorSpellCheck::UpdateCurrentDictionary(nsIEditorSpellCheckCallback* aCallba
NS_ENSURE_STATE(doc);
doc->GetContentLanguage(fetcher->mRootDocContentLang);
if (XRE_GetProcessType() == GeckoProcessType_Content) {
DictionaryFetched(nullptr);
}
rv = fetcher->Fetch(mEditor);
NS_ENSURE_SUCCESS(rv, rv);
@ -726,37 +715,38 @@ nsresult
nsEditorSpellCheck::DictionaryFetched(DictionaryFetcher* aFetcher)
{
nsRefPtr<nsEditorSpellCheck> kungFuDeathGrip = this;
nsAutoString dictName;
nsresult rv = NS_OK;
if (aFetcher) {
// Important: declare the holder after the callback caller so that the former
// is destructed first so that it's not active when the callback is called.
CallbackCaller callbackCaller(aFetcher->mCallback);
UpdateDictionnaryHolder holder(this);
if (aFetcher->mGroup < mDictionaryFetcherGroup) {
// SetCurrentDictionary was called after the fetch started. Don't overwrite
// that dictionary with the fetched one.
return NS_OK;
}
// Important: declare the holder after the callback caller so that the former
// is destructed first so that it's not active when the callback is called.
CallbackCaller callbackCaller(aFetcher->mCallback);
UpdateDictionnaryHolder holder(this);
mPreferredLang.Assign(aFetcher->mRootContentLang);
// If we successfully fetched a dictionary from content prefs, do not go
// further. Use this exact dictionary.
dictName.Assign(aFetcher->mDictionary);
if (!dictName.IsEmpty()) {
if (NS_FAILED(SetCurrentDictionary(dictName))) {
// may be dictionary was uninstalled ?
ClearCurrentDictionary(mEditor);
}
return NS_OK;
}
if (mPreferredLang.IsEmpty()) {
mPreferredLang.Assign(aFetcher->mRootDocContentLang);
}
if (aFetcher->mGroup < mDictionaryFetcherGroup) {
// SetCurrentDictionary was called after the fetch started. Don't overwrite
// that dictionary with the fetched one.
return NS_OK;
}
mPreferredLang.Assign(aFetcher->mRootContentLang);
// If we successfully fetched a dictionary from content prefs, do not go
// further. Use this exact dictionary.
nsAutoString dictName;
dictName.Assign(aFetcher->mDictionary);
if (!dictName.IsEmpty()) {
if (NS_FAILED(SetCurrentDictionary(dictName))) {
// may be dictionary was uninstalled ?
ClearCurrentDictionary(mEditor);
}
return NS_OK;
}
if (mPreferredLang.IsEmpty()) {
mPreferredLang.Assign(aFetcher->mRootDocContentLang);
}
// Then, try to use language computed from element
if (!mPreferredLang.IsEmpty()) {
dictName.Assign(mPreferredLang);

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

@ -1,20 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
include protocol PContent;
namespace mozilla {
sync protocol PRemoteSpellcheckEngine {
manager PContent;
parent:
__delete__();
sync CheckForMisspelling(nsString aWord) returns (bool isMisspelled);
sync SetDictionary(nsString aDictionary) returns (bool success);
};
} // namespace mozilla

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

@ -1,17 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "RemoteSpellcheckEngineChild.h"
namespace mozilla {
RemoteSpellcheckEngineChild::RemoteSpellcheckEngineChild()
{
}
RemoteSpellcheckEngineChild::~RemoteSpellcheckEngineChild()
{
}
} //namespace mozilla

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

@ -1,21 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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 RemoteSpellcheckEngineChild_h_
#define RemoteSpellcheckEngineChild_h_
#include "mozilla/PRemoteSpellcheckEngineChild.h"
namespace mozilla {
class RemoteSpellcheckEngineChild : public mozilla::PRemoteSpellcheckEngineChild
{
public:
RemoteSpellcheckEngineChild();
~RemoteSpellcheckEngineChild();
};
} //namespace mozilla
#endif // RemoteSpellcheckEngineChild_h_

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

@ -1,49 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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/. */
#include "RemoteSpellcheckEngineParent.h"
#include "mozISpellCheckingEngine.h"
#include "nsServiceManagerUtils.h"
#define DEFAULT_SPELL_CHECKER "@mozilla.org/spellchecker/engine;1"
namespace mozilla {
RemoteSpellcheckEngineParent::RemoteSpellcheckEngineParent()
{
mEngine = do_GetService(DEFAULT_SPELL_CHECKER);
}
RemoteSpellcheckEngineParent::~RemoteSpellcheckEngineParent()
{
}
bool
RemoteSpellcheckEngineParent::RecvSetDictionary(
const nsString& aDictionary,
bool* success)
{
nsresult rv = mEngine->SetDictionary(aDictionary.get());
*success = NS_SUCCEEDED(rv);
return true;
}
bool
RemoteSpellcheckEngineParent::RecvCheckForMisspelling(
const nsString& aWord,
bool* isMisspelled)
{
bool isCorrect = false;
mEngine->Check(aWord.get(), &isCorrect);
*isMisspelled = !isCorrect;
return true;
}
void
RemoteSpellcheckEngineParent::ActorDestroy(ActorDestroyReason aWhy)
{
}
} // namespace mozilla

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

@ -1,31 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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 RemoteSpellcheckEngineParent_h_
#define RemoteSpellcheckEngineParent_h_
#include "mozISpellCheckingEngine.h"
#include "mozilla/PRemoteSpellcheckEngineParent.h"
#include "nsCOMPtr.h"
namespace mozilla {
class RemoteSpellcheckEngineParent : public mozilla::PRemoteSpellcheckEngineParent {
public:
RemoteSpellcheckEngineParent();
~RemoteSpellcheckEngineParent();
virtual void ActorDestroy(ActorDestroyReason aWhy);
bool RecvSetDictionary(const nsString& aDictionary, bool* success);
bool RecvCheckForMisspelling( const nsString& aWord, bool* isMisspelled);
private:
nsCOMPtr<mozISpellCheckingEngine> mEngine;
};
}
#endif

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

@ -4,11 +4,9 @@
# 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/.
SOURCES += [
UNIFIED_SOURCES += [
'mozHunspell.cpp',
'mozHunspellDirProvider.cpp',
'RemoteSpellCheckEngineChild.cpp',
'RemoteSpellCheckEngineParent.cpp',
]
if not CONFIG['MOZ_NATIVE_HUNSPELL']:
@ -42,14 +40,3 @@ LOCAL_INCLUDES += [
# Suppress warnings in third-party code.
if CONFIG['CLANG_CXX']:
CXXFLAGS += ['-Wno-unused-private-field']
include('/ipc/chromium/chromium-config.mozbuild')
IPDL_SOURCES = [
'PRemoteSpellcheckEngine.ipdl',
]
EXPORTS.mozilla += [
'RemoteSpellCheckEngineChild.h',
'RemoteSpellCheckEngineParent.h',
]

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

@ -4,8 +4,7 @@
# 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/.
include('/ipc/chromium/chromium-config.mozbuild')
SOURCES += [
UNIFIED_SOURCES += [
'mozEnglishWordUtils.cpp',
'mozGenericWordUtils.cpp',
'mozInlineSpellChecker.cpp',

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

@ -1978,12 +1978,6 @@ NS_IMETHODIMP mozInlineSpellChecker::UpdateCurrentDictionary()
return NS_OK;
}
if (XRE_GetProcessType() == GeckoProcessType_Content) {
mNumPendingUpdateCurrentDictionary++;
ChangeNumPendingSpellChecks(1);
return NS_OK;
}
if (NS_FAILED(spellCheck->GetCurrentDictionary(mPreviousDictionary))) {
mPreviousDictionary.Truncate();
}

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

@ -10,12 +10,6 @@
#include "nsICategoryManager.h"
#include "nsISupportsPrimitives.h"
#include "nsISimpleEnumerator.h"
#include "mozilla/PRemoteSpellcheckEngineChild.h"
#include "mozilla/dom/ContentChild.h"
#include "nsXULAppAPI.h"
using mozilla::dom::ContentChild;
using mozilla::PRemoteSpellcheckEngineChild;
#define DEFAULT_SPELL_CHECKER "@mozilla.org/spellchecker/engine;1"
@ -44,10 +38,6 @@ mozSpellChecker::~mozSpellChecker()
}
mSpellCheckingEngine = nullptr;
mPersonalDictionary = nullptr;
if(XRE_GetProcessType() == GeckoProcessType_Content) {
mEngine->Send__delete__(mEngine);
}
}
nsresult
@ -56,11 +46,6 @@ mozSpellChecker::Init()
mPersonalDictionary = do_GetService("@mozilla.org/spellchecker/personaldictionary;1");
mSpellCheckingEngine = nullptr;
if (XRE_GetProcessType() == GeckoProcessType_Content) {
mozilla::dom::ContentChild* contentChild = mozilla::dom::ContentChild::GetSingleton();
MOZ_ASSERT(contentChild);
mEngine = contentChild->SendPRemoteSpellcheckEngineConstructor();
}
return NS_OK;
}
@ -123,12 +108,6 @@ mozSpellChecker::CheckWord(const nsAString &aWord, bool *aIsMisspelled, nsTArray
{
nsresult result;
bool correct;
if (XRE_GetProcessType() == GeckoProcessType_Content) {
nsString wordwrapped = nsString(aWord);
mEngine->SendCheckForMisspelling(wordwrapped, aIsMisspelled);
return NS_OK;
}
if(!mSpellCheckingEngine)
return NS_ERROR_NULL_POINTER;
@ -353,13 +332,6 @@ mozSpellChecker::GetCurrentDictionary(nsAString &aDictionary)
NS_IMETHODIMP
mozSpellChecker::SetCurrentDictionary(const nsAString &aDictionary)
{
if (XRE_GetProcessType() == GeckoProcessType_Content) {
nsString wrappedDict = nsString(aDictionary);
bool isSuccess;
mEngine->SendSetDictionary(wrappedDict, &isSuccess);
return isSuccess ? NS_OK : NS_ERROR_NOT_AVAILABLE;
}
// Calls to mozISpellCheckingEngine::SetDictionary might destroy us
nsRefPtr<mozSpellChecker> kungFuDeathGrip = this;

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

@ -18,10 +18,6 @@
#include "mozISpellI18NUtil.h"
#include "nsCycleCollectionParticipant.h"
namespace mozilla {
class PRemoteSpellcheckEngineChild;
}
class mozSpellChecker : public nsISpellChecker
{
public:
@ -63,7 +59,5 @@ protected:
nsresult GetCurrentBlockIndex(nsITextServicesDocument *aDoc, int32_t *outBlockIndex);
nsresult GetEngineList(nsCOMArray<mozISpellCheckingEngine> *aDictionaryList);
mozilla::PRemoteSpellcheckEngineChild *mEngine;
};
#endif // mozSpellChecker_h__

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

@ -538,7 +538,7 @@
<xul:menuitem label="&selectAllCmd.label;" accesskey="&selectAllCmd.accesskey;" cmd="cmd_selectAll"/>
<xul:menuseparator anonid="spell-check-separator"/>
<xul:menuitem label="&spellCheckToggle.label;" type="checkbox" accesskey="&spellCheckToggle.accesskey;" anonid="spell-check-enabled"
oncommand="this.parentNode.parentNode.spellCheckerUI.toggleEnabled(window);"/>
oncommand="this.parentNode.parentNode.spellCheckerUI.toggleEnabled();"/>
<xul:menu label="&spellDictionaries.label;" accesskey="&spellDictionaries.accesskey;" anonid="spell-dictionaries">
<xul:menupopup anonid="spell-dictionaries-menu"
onpopupshowing="event.stopPropagation();"

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

@ -185,7 +185,7 @@ InlineSpellChecker.prototype = {
if (curlang == sortedList[i].id) {
item.setAttribute("checked", "true");
} else {
var callback = function(me, val) { return function(evt) { me.selectDictionary(val, me.menu.ownerDocument.defaultView); } };
var callback = function(me, val) { return function(evt) { me.selectDictionary(val); } };
item.addEventListener("command", callback(this, i), true);
}
if (insertBefore)
@ -266,20 +266,8 @@ InlineSpellChecker.prototype = {
},
// callback for selecting a dictionary
selectDictionary: function(index, aWindow)
selectDictionary: function(index)
{
// Avoid a crash in multiprocess until Bug 1030451 lands
// Remove aWindow parameter at that time
const Ci = Components.interfaces;
let chromeFlags = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShellTreeItem).treeOwner.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIXULWindow).chromeFlags;
let chromeRemoteWindow = Ci.nsIWebBrowserChrome.CHROME_REMOTE_WINDOW;
if (chromeFlags & chromeRemoteWindow) {
return;
}
if (! this.mInlineSpellChecker || index < 0 || index >= this.mDictionaryNames.length)
return;
var spellchecker = this.mInlineSpellChecker.spellChecker;
@ -299,20 +287,8 @@ InlineSpellChecker.prototype = {
},
// callback for enabling or disabling spellchecking
toggleEnabled: function(aWindow)
toggleEnabled: function()
{
// Avoid a crash in multiprocess until Bug 1030451 lands
// Remove aWindow parameter at that time
const Ci = Components.interfaces;
let chromeFlags = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIWebNavigation).
QueryInterface(Ci.nsIDocShellTreeItem).treeOwner.
QueryInterface(Ci.nsIInterfaceRequestor).
getInterface(Ci.nsIXULWindow).chromeFlags;
let chromeRemoteWindow = Ci.nsIWebBrowserChrome.CHROME_REMOTE_WINDOW;
if (chromeFlags & chromeRemoteWindow) {
return;
}
this.mEditor.setSpellcheckUserOverride(!this.mInlineSpellChecker.enableRealTimeSpell);
},