Bug 1100205 - Zero ScreenDetails outparam in RecvScreenForBrowser() so Valgrind doesn't complain. r=mconley.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 18 Nov 2014 00:29:12 -0800
changeset 216156 28036503ada1
parent 216155 076b942c1a6e
child 216157 7fa6291d952d
push id51958
push usernnethercote@mozilla.com
push dateTue, 18 Nov 2014 08:30:46 +0000
treeherdermozilla-inbound@28036503ada1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1100205
milestone36.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 1100205 - Zero ScreenDetails outparam in RecvScreenForBrowser() so Valgrind doesn't complain. r=mconley.
dom/ipc/ScreenManagerParent.cpp
--- a/dom/ipc/ScreenManagerParent.cpp
+++ b/dom/ipc/ScreenManagerParent.cpp
@@ -116,16 +116,21 @@ ScreenManagerParent::RecvScreenForRect(c
 }
 
 bool
 ScreenManagerParent::RecvScreenForBrowser(PBrowserParent* aBrowser,
                                           ScreenDetails* aRetVal,
                                           bool* aSuccess)
 {
   *aSuccess = false;
+#ifdef MOZ_VALGRIND
+  // Zero this so that Valgrind doesn't complain when we send it to another
+  // process.
+  memset(aRetVal, 0, sizeof(ScreenDetails));
+#endif
 
   // Find the mWidget associated with the tabparent, and then return
   // the nsIScreen it's on.
   TabParent* tabParent = static_cast<TabParent*>(aBrowser);
   nsCOMPtr<nsIWidget> widget = tabParent->GetWidget();
   if (!widget) {
     return true;
   }