Bug 1338086 - Remove useless else blocks in order to reduce complexity in dom/media/gmp* r?cpearce
MozReview-Commit-ID: FaKW6Sb721i
--- a/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp
+++ b/dom/media/gmp-plugin-openh264/gmp-fake-openh264.cpp
@@ -400,21 +400,23 @@ extern "C" {
return GMPNoErr;
}
PUBLIC_FUNC GMPErr
GMPGetAPI (const char* aApiName, void* aHostAPI, void** aPluginApi) {
if (!strcmp (aApiName, GMP_API_VIDEO_DECODER)) {
*aPluginApi = new FakeVideoDecoder (static_cast<GMPVideoHost*> (aHostAPI));
return GMPNoErr;
- } else if (!strcmp (aApiName, GMP_API_VIDEO_ENCODER)) {
+ }
+ if (!strcmp (aApiName, GMP_API_VIDEO_ENCODER)) {
*aPluginApi = new FakeVideoEncoder (static_cast<GMPVideoHost*> (aHostAPI));
return GMPNoErr;
#if defined(GMP_FAKE_SUPPORT_DECRYPT)
- } else if (!strcmp (aApiName, GMP_API_DECRYPTOR)) {
+ }
+ if (!strcmp (aApiName, GMP_API_DECRYPTOR)) {
*aPluginApi = new FakeDecryptor();
return GMPNoErr;
#endif
}
return GMPGenericErr;
}
PUBLIC_FUNC void
--- a/dom/media/gmp-plugin/gmp-fake.cpp
+++ b/dom/media/gmp-plugin/gmp-fake.cpp
@@ -67,17 +67,18 @@ extern "C" {
PUBLIC_FUNC GMPErr
GMPGetAPI (const char* aApiName, void* aHostAPI, void** aPluginApi) {
if (!strcmp (aApiName, GMP_API_VIDEO_DECODER)) {
// Note: Deliberately advertise in our .info file that we support
// video-decode, but we fail the "get" call here to simulate what
// happens when decoder init fails.
return GMPGenericErr;
#if defined(GMP_FAKE_SUPPORT_DECRYPT)
- } else if (!strcmp (aApiName, GMP_API_DECRYPTOR)) {
+ }
+ if (!strcmp (aApiName, GMP_API_DECRYPTOR)) {
*aPluginApi = new FakeDecryptor();
return GMPNoErr;
#endif
}
return GMPGenericErr;
}
PUBLIC_FUNC void
--- a/dom/media/gmp/GMPLoader.cpp
+++ b/dom/media/gmp/GMPLoader.cpp
@@ -196,21 +196,19 @@ private:
LinuxSandboxStarter() { }
friend mozilla::detail::UniqueSelector<LinuxSandboxStarter>::SingleObject mozilla::MakeUnique<LinuxSandboxStarter>();
public:
static UniquePtr<SandboxStarter> Make()
{
if (mozilla::SandboxInfo::Get().CanSandboxMedia()) {
return MakeUnique<LinuxSandboxStarter>();
- } else {
- // Sandboxing isn't possible, but the parent has already
- // checked that this plugin doesn't require it. (Bug 1074561)
- return nullptr;
}
+ // Sandboxing isn't possible, but the parent has already
+ // checked that this plugin doesn't require it. (Bug 1074561)
return nullptr;
}
bool Start(const char *aLibPath) override
{
mozilla::SetMediaPluginSandbox(aLibPath);
return true;
}
};