Bug 837856 - Rename hal_sandbox::IsHalChildLive() to HalChildDestroyed(). r=mounir
authorJustin Lebar <justin.lebar@gmail.com>
Mon, 11 Feb 2013 23:09:25 -0500
changeset 121572 328742b12ef546892628fd33327eaa63c22ecc15
parent 121571 9a0846d180af483fb4328413bd8b8c8c9325b1bb
child 121573 44af3765d3d30dca92e390a532c3a49b03f396f3
push id22804
push userjlebar@mozilla.com
push dateTue, 12 Feb 2013 04:09:47 +0000
treeherdermozilla-inbound@328742b12ef5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmounir
bugs837856
milestone21.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 837856 - Rename hal_sandbox::IsHalChildLive() to HalChildDestroyed(). r=mounir The return value stays the same (that is, the function was mis-named).
hal/Hal.cpp
hal/HalInternal.h
hal/sandbox/SandboxHal.cpp
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -28,28 +28,28 @@
 #define getpid _getpid
 #endif
 
 using namespace mozilla::services;
 
 #define PROXY_IF_SANDBOXED(_call)                 \
   do {                                            \
     if (InSandbox()) {                            \
-      if (!hal_sandbox::IsHalChildLive()) {  \
+      if (!hal_sandbox::HalChildDestroyed()) {    \
         hal_sandbox::_call;                       \
       }                                           \
     } else {                                      \
       hal_impl::_call;                            \
     }                                             \
   } while (0)
 
 #define RETURN_PROXY_IF_SANDBOXED(_call, defValue)\
   do {                                            \
     if (InSandbox()) {                            \
-      if (hal_sandbox::IsHalChildLive()) {   \
+      if (hal_sandbox::HalChildDestroyed()) {     \
         return defValue;                          \
       }                                           \
       return hal_sandbox::_call;                  \
     } else {                                      \
       return hal_impl::_call;                     \
     }                                             \
   } while (0)
 
--- a/hal/HalInternal.h
+++ b/hal/HalInternal.h
@@ -89,13 +89,17 @@ void DisableSystemClockChangeNotificatio
  */
 void EnableSystemTimezoneChangeNotifications();
 
 /**
  * Disable system timezone change notifications from the backend.
  */
 void DisableSystemTimezoneChangeNotifications();
 
-bool IsHalChildLive();
+/**
+ * Has the child-side HAL IPC object been destroyed?  If so, you shouldn't send
+ * messages to hal_sandbox.
+ */
+bool HalChildDestroyed();
 } // namespace MOZ_HAL_NAMESPACE
 } // namespace mozilla
 
 #endif  // mozilla_HalInternal_h
--- a/hal/sandbox/SandboxHal.cpp
+++ b/hal/sandbox/SandboxHal.cpp
@@ -20,22 +20,22 @@
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::hal;
 
 namespace mozilla {
 namespace hal_sandbox {
 
-static bool sHalChildIsLive = false;
+static bool sHalChildDestroyed = false;
 
 bool
-IsHalChildLive()
+HalChildDestroyed()
 {
-  return sHalChildIsLive;
+  return sHalChildDestroyed;
 }
 
 static PHalChild* sHal;
 static PHalChild*
 Hal()
 {
   if (!sHal) {
     sHal = ContentChild::GetSingleton()->SendPHalConstructor();
@@ -805,17 +805,17 @@ public:
   }
 };
 
 class HalChild : public PHalChild {
 public:
   virtual void
   ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE
   {
-    sHalChildIsLive = true;
+    sHalChildDestroyed = true;
   }
 
   virtual bool
   RecvNotifyBatteryChange(const BatteryInformation& aBatteryInfo) MOZ_OVERRIDE {
     hal::NotifyBatteryChange(aBatteryInfo);
     return true;
   }