Bug 1279657 - Fix missed callsites. - r=jrmuizel
authorJeff Gilbert <jgilbert@mozilla.com>
Fri, 17 Jun 2016 16:16:59 -0700
changeset 302237 fcd860b7546f72dfbc95dff5f0fc443b244485b1
parent 302236 aa737095008decf8aa4fc4d8d368a4f7cb7ca198
child 302238 f852be67d6252bbf21b0a08258e9dea129b26410
push id78657
push userjgilbert@mozilla.com
push dateTue, 21 Jun 2016 21:03:58 +0000
treeherdermozilla-inbound@fcd860b7546f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1279657
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1279657 - Fix missed callsites. - r=jrmuizel 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
@@ -367,17 +367,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
@@ -216,27 +216,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(flags, 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
@@ -798,17 +798,17 @@ GLContextProviderEGL::CreateForWindow(ns
     return gl.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
@@ -1358,17 +1358,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;
     }