Index: third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h |
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h b/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h |
index 51ffd6ea861a1c3388a742e9d4917ccbfa08835a..dbca055dc6d12f768a4fb31ab577eddd3a1b500e 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScopedPersistent.h |
@@ -28,81 +28,6 @@ |
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
-#ifndef ScopedPersistent_h |
-#define ScopedPersistent_h |
- |
-#include <memory> |
- |
-#include "bindings/core/v8/ScriptWrappableVisitor.h" |
-#include "platform/wtf/Allocator.h" |
-#include "platform/wtf/Noncopyable.h" |
-#include "v8/include/v8.h" |
- |
-namespace blink { |
- |
-template <typename T> |
-class ScopedPersistent { |
- USING_FAST_MALLOC(ScopedPersistent); |
- WTF_MAKE_NONCOPYABLE(ScopedPersistent); |
- |
- public: |
- ScopedPersistent() {} |
- |
- ScopedPersistent(v8::Isolate* isolate, v8::Local<T> handle) |
- : handle_(isolate, handle) {} |
- |
- ScopedPersistent(v8::Isolate* isolate, v8::MaybeLocal<T> maybe) { |
- v8::Local<T> local; |
- if (maybe.ToLocal(&local)) |
- handle_.Reset(isolate, local); |
- } |
- |
- virtual ~ScopedPersistent() { Clear(); } |
- |
- ALWAYS_INLINE v8::Local<T> NewLocal(v8::Isolate* isolate) const { |
- return v8::Local<T>::New(isolate, handle_); |
- } |
- |
- // If you don't need to get weak callback, use setPhantom instead. |
- // setPhantom is faster than setWeak. |
- template <typename P> |
- void SetWeak(P* parameters, |
- void (*callback)(const v8::WeakCallbackInfo<P>&), |
- v8::WeakCallbackType type = v8::WeakCallbackType::kParameter) { |
- handle_.SetWeak(parameters, callback, type); |
- } |
- |
- // Turns this handle into a weak phantom handle without |
- // finalization callback. |
- void SetPhantom() { handle_.SetWeak(); } |
- |
- void ClearWeak() { handle_.template ClearWeak<void>(); } |
- |
- bool IsEmpty() const { return handle_.IsEmpty(); } |
- bool IsWeak() const { return handle_.IsWeak(); } |
- |
- virtual void Set(v8::Isolate* isolate, v8::Local<T> handle) { |
- handle_.Reset(isolate, handle); |
- } |
- |
- // Note: This is clear in the std::unique_ptr sense, not the v8::Local sense. |
- void Clear() { handle_.Reset(); } |
- |
- bool operator==(const ScopedPersistent<T>& other) { |
- return handle_ == other.handle_; |
- } |
- |
- template <class S> |
- bool operator==(const v8::Local<S> other) const { |
- return handle_ == other; |
- } |
- |
- ALWAYS_INLINE v8::Persistent<T>& Get() { return handle_; } |
- |
- private: |
- v8::Persistent<T> handle_; |
-}; |
- |
-} // namespace blink |
- |
-#endif // ScopedPersistent_h |
+// This file has been moved to platform/bindings/ScopedPersistent.h. |
+// TODO(adithyas): Remove this file. |
+#include "platform/bindings/ScopedPersistent.h" |