Skip to content

Commit

Permalink
Bug 1386825 - Part 4: Remove remaining instances of MOZ_B2G. r=froydnj
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: 8r4eMwiZ4Vg
  • Loading branch information
EricRahm committed Aug 8, 2017
1 parent d947321 commit fe18bf0
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 82 deletions.
12 changes: 0 additions & 12 deletions extensions/cookie/nsPermissionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1802,18 +1802,6 @@ nsPermissionManager::AddInternal(nsIPrincipal* aPrincipal,
id = aID;
}

#ifdef MOZ_B2G
// When we do the initial addition of the permissions we don't want to
// inherit session specific permissions from other tabs or apps
// so we ignore them and set the permission to PROMPT_ACTION if it was
// previously allowed or denied by the user.
if (aIgnoreSessionPermissions &&
aExpireType == nsIPermissionManager::EXPIRE_SESSION) {
aPermission = nsIPermissionManager::PROMPT_ACTION;
aExpireType = nsIPermissionManager::EXPIRE_NEVER;
}
#endif // MOZ_B2G

entry->GetPermissions().AppendElement(PermissionEntry(id, typeIndex, aPermission,
aExpireType, aExpireTime,
aModificationTime));
Expand Down
8 changes: 0 additions & 8 deletions gfx/gl/GLLibraryEGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ namespace gl {

StaticMutex GLLibraryEGL::sMutex;
GLLibraryEGL sEGLLibrary;
#ifdef MOZ_B2G
MOZ_THREAD_LOCAL(EGLContext) GLLibraryEGL::sCurrentContext;
#endif

// should match the order of EGLExtensions, and be null-terminated.
static const char* sEGLExtensionNames[] = {
Expand Down Expand Up @@ -320,11 +317,6 @@ GLLibraryEGL::EnsureInitialized(bool forceAccel, nsACString* const out_failureId

mozilla::ScopedGfxFeatureReporter reporter("EGL");

#ifdef MOZ_B2G
if (!sCurrentContext.init())
MOZ_CRASH("GFX: Tls init failed");
#endif

#ifdef XP_WIN
if (!mEGLLibrary) {
// On Windows, the GLESv2, EGL and DXSDK libraries are shipped with libxul and
Expand Down
20 changes: 0 additions & 20 deletions gfx/gl/GLLibraryEGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -486,32 +486,12 @@ class GLLibraryEGL
} mSymbols;

public:
#ifdef MOZ_B2G
EGLContext CachedCurrentContext() {
return sCurrentContext.get();
}
void UnsetCachedCurrentContext() {
sCurrentContext.set(nullptr);
}
void SetCachedCurrentContext(EGLContext aCtx) {
sCurrentContext.set(aCtx);
}
bool CachedCurrentContextMatches() {
return sCurrentContext.get() == fGetCurrentContext();
}

private:
static MOZ_THREAD_LOCAL(EGLContext) sCurrentContext;
public:

#else
EGLContext CachedCurrentContext() {
return nullptr;
}
void UnsetCachedCurrentContext() {}
void SetCachedCurrentContext(EGLContext aCtx) { }
bool CachedCurrentContextMatches() { return true; }
#endif

private:
bool mInitialized;
Expand Down
5 changes: 0 additions & 5 deletions ipc/glue/MessageChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,8 @@ using mozilla::Move;
// Undo the damage done by mozzconf.h
#undef compress

// Logging seems to be somewhat broken on b2g.
#ifdef MOZ_B2G
#define IPC_LOG(...)
#else
static mozilla::LazyLogModule sLogModule("ipc");
#define IPC_LOG(...) MOZ_LOG(sLogModule, LogLevel::Debug, (__VA_ARGS__))
#endif

/*
* IPC design:
Expand Down
3 changes: 0 additions & 3 deletions mozglue/misc/TimeStamp.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,7 @@ class BaseTimeDuration
}
double operator/(const BaseTimeDuration& aOther) const
{
#ifndef MOZ_B2G
// Bug 1066388 - This fails on B2G ICS Emulator
MOZ_ASSERT(aOther.mValue != 0, "Division by zero");
#endif
return ValueCalculator::DivideDouble(mValue, aOther.mValue);
}
BaseTimeDuration operator%(const BaseTimeDuration& aOther) const
Expand Down
2 changes: 1 addition & 1 deletion netwerk/base/Tickler.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// The tickler only applies to wifi on mobile right now. Hopefully it
// can also be restricted to particular handset models in the future.

#if defined(ANDROID) && !defined(MOZ_B2G)
#if defined(ANDROID)
#define MOZ_USE_WIFI_TICKLER
#endif

Expand Down
11 changes: 2 additions & 9 deletions services/fxaccounts/FxAccountsStorage.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ this.FxAccountsStorageManager = function(options = {}) {
baseDir: options.baseDir || OS.Constants.Path.profileDir,
}
this.plainStorage = new JSONStorage(this.options);
// On b2g we have no loginManager for secure storage, and tests may want
// to pretend secure storage isn't available.
let useSecure = "useSecure" in options ? options.useSecure : haveLoginManager;
// Tests may want to pretend secure storage isn't available.
let useSecure = "useSecure" in options ? options.useSecure : true;
if (useSecure) {
this.secureStorage = new LoginManagerStorage();
} else {
Expand Down Expand Up @@ -601,9 +600,3 @@ LoginManagerStorage.prototype = {
return null;
},
}

// A global variable to indicate if the login manager is available - it doesn't
// exist on b2g. Defined here as the use of preprocessor directives skews line
// numbers in the runtime, meaning stack-traces etc end up off by a few lines.
// Doing it at the end of the file makes that less of a pita.
var haveLoginManager = !AppConstants.MOZ_B2G;
4 changes: 0 additions & 4 deletions services/fxaccounts/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,3 @@ EXTRA_JS_MODULES += [
'FxAccountsStorage.jsm',
'FxAccountsWebChannel.jsm',
]

# For now, we will only be using the FxA manager in B2G.
if CONFIG['MOZ_B2G']:
EXTRA_JS_MODULES += ['FxAccountsManager.jsm']
3 changes: 1 addition & 2 deletions startupcache/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
with Files("**"):
BUG_COMPONENT = ("Core", "XPCOM")

if not CONFIG['MOZ_B2G']:
TEST_DIRS += ['test']
TEST_DIRS += ['test']

XPIDL_SOURCES += [
'nsIStartupCache.idl',
Expand Down
10 changes: 0 additions & 10 deletions uriloader/base/nsURILoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,16 +405,6 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *

bool allowContentDispositionToForceExternalHandling = true;

#ifdef MOZ_B2G

// On B2G, OMA content files should never be handled by an external handler
// (even if the server specifies Content-Disposition: attachment) because the
// data should never be stored on an unencrypted form.
allowContentDispositionToForceExternalHandling =
!mContentType.LowerCaseEqualsASCII("application/vnd.oma.drm.message");

#endif

if (NS_SUCCEEDED(rv) && (disposition == nsIChannel::DISPOSITION_ATTACHMENT) &&
allowContentDispositionToForceExternalHandling) {
forceExternalHandling = true;
Expand Down
6 changes: 0 additions & 6 deletions widget/NativeKeyToDOMKeyName.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,9 @@
#undef KEY_MAP_ANDROID
#define KEY_MAP_ANDROID(aCPPKeyName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
#ifndef MOZ_B2G
#undef KEY_MAP_ANDROID_EXCEPT_B2G
#define KEY_MAP_ANDROID_EXCEPT_B2G(aCPPKeyName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
#else // #ifndef MOZ_B2G
#undef KEY_MAP_B2G
#define KEY_MAP_B2G(aCPPKeyName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
#endif // #ifndef MOZ_B2G #else
#endif

/******************************************************************************
Expand Down
3 changes: 1 addition & 2 deletions widget/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ if toolkit == 'gtk3':
'nsIApplicationChooser.idl',
]

if not CONFIG['MOZ_B2G']:
DEFINES['MOZ_CROSS_PROCESS_IME'] = True
DEFINES['MOZ_CROSS_PROCESS_IME'] = True

include('/ipc/chromium/chromium-config.mozbuild')

Expand Down

0 comments on commit fe18bf0

Please sign in to comment.