Bug 1279657 - Fix missed callsites. - r=benwa draft
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 17 Jun 2016 16:16:59 -0700
changeset 379834 ffe5a8c82e3342f751f211d77d9b1056493d6185
parent 379817 097dc302f5a07a576c7ba6cfc73b78b459fbe5ce
child 523586 116f4c749a75c665687ed49ba1cffe90ff8d0157
push id21071
push userbmo:jgilbert@mozilla.com
push dateSat, 18 Jun 2016 11:24:53 +0000
reviewersbenwa
bugs1279657
milestone50.0a1
Bug 1279657 - Fix missed callsites. - r=benwa MozReview-Commit-ID: 8RY2D5OTnZ5
dom/plugins/base/nsNPAPIPluginInstance.cpp
gfx/gl/GLContextProviderCGL.mm
gfx/gl/GLContextProviderEAGL.mm
gfx/gl/GLContextProviderEGL.cpp
gfx/gl/GLContextProviderGLX.cpp
gfx/gl/GLContextProviderNull.cpp
widget/android/GfxInfo.cpp
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -87,18 +87,19 @@ private:
   bool mCanceled;
 };
 
 static RefPtr<GLContext> sPluginContext = nullptr;
 
 static bool EnsureGLContext()
 {
   if (!sPluginContext) {
-    nsCString failureId;
-    sPluginContext = GLContextProvider::CreateHeadless(CreateContextFlags::REQUIRE_COMPAT_PROFILE, failureId);
+    const auto flags = CreateContextFlags::REQUIRE_COMPAT_PROFILE;
+    nsCString discardedFailureId;
+    sPluginContext = GLContextProvider::CreateHeadless(flags, &discardedFailureId);
   }
 
   return sPluginContext != nullptr;
 }
 
 static std::map<NPP, nsNPAPIPluginInstance*> sPluginNPPMap;
 
 #endif
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -366,17 +366,17 @@ GLContextProviderCGL::GetGlobalContext()
 {
     static bool triedToCreateContext = false;
     if (!triedToCreateContext) {
         triedToCreateContext = true;
 
         MOZ_RELEASE_ASSERT(!gGlobalContext);
         nsCString discardFailureId;
         RefPtr<GLContext> temp = CreateHeadless(CreateContextFlags::NONE,
-                                                discardFailureId);
+                                                &discardFailureId);
         gGlobalContext = temp;
 
         if (!gGlobalContext) {
             NS_WARNING("Couldn't init gGlobalContext.");
         }
     }
 
     return gGlobalContext;
--- a/gfx/gl/GLContextProviderEAGL.mm
+++ b/gfx/gl/GLContextProviderEAGL.mm
@@ -215,27 +215,29 @@ GLContextProviderEAGL::CreateForWindow(n
     if (!GLContextEAGL::Cast(glContext)->AttachToWindow(aWidget)) {
         return nullptr;
     }
 
     return glContext.forget();
 }
 
 already_AddRefed<GLContext>
-GLContextProviderEAGL::CreateHeadless(CreateContextFlags flags)
+GLContextProviderEAGL::CreateHeadless(CreateContextFlags flags,
+                                      nsACString* const out_failureId)
 {
     return CreateEAGLContext(true, GetGlobalContextEAGL());
 }
 
 already_AddRefed<GLContext>
 GLContextProviderEAGL::CreateOffscreen(const mozilla::gfx::IntSize& size,
                                        const SurfaceCaps& caps,
-                                       CreateContextFlags flags)
+                                       CreateContextFlags flags,
+                                       nsACString* const out_failureId)
 {
-    RefPtr<GLContext> glContext = CreateHeadless(flags);
+    RefPtr<GLContext> glContext = CreateHeadless(flags, out_failureId);
     if (!glContext->InitOffscreen(size, caps)) {
         return nullptr;
     }
 
     return glContext.forget();
 }
 
 static RefPtr<GLContext> gGlobalContext;
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -812,17 +812,17 @@ GLContextProviderEGL::CreateForWindow(ns
     return glContext.forget();
 }
 
 #if defined(ANDROID)
 EGLSurface
 GLContextProviderEGL::CreateEGLSurface(void* aWindow)
 {
     nsCString discardFailureId;
-    if (!sEGLLibrary.EnsureInitialized(false, discardFailureId)) {
+    if (!sEGLLibrary.EnsureInitialized(false, &discardFailureId)) {
         MOZ_CRASH("GFX: Failed to load EGL library 4!\n");
     }
 
     EGLConfig config;
     if (!CreateConfig(&config, static_cast<nsIWidget*>(aWindow))) {
         MOZ_CRASH("GFX: Failed to create EGLConfig 2!\n");
     }
 
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -1374,17 +1374,17 @@ GLContextProviderGLX::GetGlobalContext()
         return nullptr;
 
     static bool triedToCreateContext = false;
     if (!triedToCreateContext) {
         triedToCreateContext = true;
 
         MOZ_RELEASE_ASSERT(!gGlobalContext, "GFX: Global GL context already initialized.");
         nsCString discardFailureId;
-        RefPtr<GLContext> temp = CreateHeadless(CreateContextFlags::NONE, discardFailureId);
+        RefPtr<GLContext> temp = CreateHeadless(CreateContextFlags::NONE, &discardFailureId);
         gGlobalContext = temp;
     }
 
     return gGlobalContext;
 }
 
 /*static*/ void
 GLContextProviderGLX::Shutdown()
--- a/gfx/gl/GLContextProviderNull.cpp
+++ b/gfx/gl/GLContextProviderNull.cpp
@@ -26,18 +26,19 @@ GLContextProviderNull::CreateOffscreen(c
                                        CreateContextFlags,
                                        nsACString* const out_failureId)
 {
     *out_failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_NULL");
     return nullptr;
 }
 
 already_AddRefed<GLContext>
-GLContextProviderNull::CreateHeadless(CreateContextFlags)
+GLContextProviderNull::CreateHeadless(CreateContextFlags, nsACString* const out_failureId)
 {
+    *out_failureId = NS_LITERAL_CSTRING("FEATURE_FAILURE_NULL");
     return nullptr;
 }
 
 GLContext*
 GLContextProviderNull::GetGlobalContext()
 {
     return nullptr;
 }
--- a/widget/android/GfxInfo.cpp
+++ b/widget/android/GfxInfo.cpp
@@ -72,17 +72,17 @@ public:
   void EnsureInitialized() {
     if (mReady) {
       return;
     }
 
     RefPtr<gl::GLContext> gl;
     nsCString discardFailureId;
     gl = gl::GLContextProvider::CreateHeadless(gl::CreateContextFlags::REQUIRE_COMPAT_PROFILE,
-                                               discardFailureId);
+                                               &discardFailureId);
 
     if (!gl) {
       // Setting mReady to true here means that we won't retry. Everything will
       // remain blacklisted forever. Ideally, we would like to update that once
       // any GLContext is successfully created, like the compositor's GLContext.
       mReady = true;
       return;
     }