From 65b8a0205fd9bbceb3e766962046651a6ddeb335 Mon Sep 17 00:00:00 2001
From: Chad Parry <cparry@fb.com>
Date: Wed, 11 Nov 2015 16:02:35 -0800
Subject: [PATCH] Restore the definition of HHWheelTimer::UniquePtr

Summary: Changing the definition of `HHWheelTimer::UniquePtr` wasn't safe, because some clients were using that type outside of the `HHWheelTimer::newTimer` helper. I'm changing that part back. We'll still be able to proceed with my other codemod to `HHWheelTimer`, but we'll always have two different smart pointer types to manage: `UniquePtr` and `IntrusivePtr`.

Reviewed By: djwatson

Differential Revision: D2644721

fb-gh-sync-id: 14685be62355f09d39c4139ef7186d60b5f48dcd
---
 folly/io/async/HHWheelTimer.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/folly/io/async/HHWheelTimer.h b/folly/io/async/HHWheelTimer.h
index 17a74d54e..e8e678da0 100644
--- a/folly/io/async/HHWheelTimer.h
+++ b/folly/io/async/HHWheelTimer.h
@@ -60,15 +60,12 @@ class HHWheelTimer : private folly::AsyncTimeout,
                      public folly::DelayedDestruction {
  public:
   // This type has always been a misnomer, because it is not a unique pointer.
-  using UniquePtr = IntrusivePtr<HHWheelTimer>;
+  using UniquePtr = std::unique_ptr<HHWheelTimer, Destructor>;
+  using SharedPtr = IntrusivePtr<HHWheelTimer>;
 
   template <typename... Args>
   static UniquePtr newTimer(Args&&... args) {
-    std::unique_ptr<HHWheelTimer, Destructor> instance(
-        new HHWheelTimer(std::forward<Args>(args)...));
-    // Avoid the weird semantics of the Destructor by managing ownership
-    // entirely from the IntrusivePtr.
-    return UniquePtr(instance);
+    return UniquePtr(new HHWheelTimer(std::forward<Args>(args)...));
   }
 
   /**
-- 
2.26.2