Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj

This commit is contained in:
Juan Gomez
2015-06-24 14:11:00 -04:00
parent 90f3162b9e
commit 7323e89a40
201 changed files with 506 additions and 579 deletions

View File

@@ -824,7 +824,7 @@ IncreasePrivateDocShellCount()
{
gNumberOfPrivateDocShells++;
if (gNumberOfPrivateDocShells > 1 ||
XRE_GetProcessType() != GeckoProcessType_Content) {
!XRE_IsContentProcess()) {
return;
}
@@ -838,7 +838,7 @@ DecreasePrivateDocShellCount()
MOZ_ASSERT(gNumberOfPrivateDocShells > 0);
gNumberOfPrivateDocShells--;
if (!gNumberOfPrivateDocShells) {
if (XRE_GetProcessType() == GeckoProcessType_Content) {
if (XRE_IsContentProcess()) {
dom::ContentChild* cc = dom::ContentChild::GetSingleton();
cc->SendPrivateDocShellsExist(false);
return;
@@ -5021,7 +5021,7 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
mInPrivateBrowsing ? nsISocketProvider::NO_PERMANENT_STORAGE : 0;
bool isStsHost = false;
bool isPinnedHost = false;
if (XRE_GetProcessType() == GeckoProcessType_Default) {
if (XRE_IsParentProcess()) {
nsCOMPtr<nsISiteSecurityService> sss =
do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
@@ -9449,7 +9449,7 @@ nsDocShell::CopyFavicon(nsIURI* aOldURI,
nsIURI* aNewURI,
bool aInPrivateBrowsing)
{
if (XRE_GetProcessType() == GeckoProcessType_Content) {
if (XRE_IsContentProcess()) {
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
if (contentChild) {
mozilla::ipc::URIParams oldURI, newURI;
@@ -13991,7 +13991,7 @@ nsDocShell::MaybeNotifyKeywordSearchLoading(const nsString& aProvider,
return;
}
if (XRE_GetProcessType() == GeckoProcessType_Content) {
if (XRE_IsContentProcess()) {
dom::ContentChild* contentChild = dom::ContentChild::GetSingleton();
if (contentChild) {
contentChild->SendNotifyKeywordSearchLoading(aProvider, aKeyword);