Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2023)

Unified Diff: content/shell/renderer/test_runner/unsafe_persistent.h

Issue 180803004: Revert of Move WebAXObjectProxy and AccessibleController from CppBoundClass to gin::Wrappable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/shell/renderer/test_runner/unsafe_persistent.h
diff --git a/content/shell/renderer/test_runner/unsafe_persistent.h b/content/shell/renderer/test_runner/unsafe_persistent.h
deleted file mode 100644
index b47a33eb2eb2809b374343ab79de963572798a6e..0000000000000000000000000000000000000000
--- a/content/shell/renderer/test_runner/unsafe_persistent.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_UNSAFE_PERSISTENT_H_
-#define CONTENT_SHELL_RENDERER_TEST_RUNNER_UNSAFE_PERSISTENT_H_
-
-#include "v8/include/v8.h"
-
-namespace content {
-
-// An unsafe way to pass Persistent handles around. Do not use unless you know
-// what you're doing. UnsafePersistent is only safe to use when we know that the
-// memory pointed by it is not going away: 1) When GC cannot happen while the
-// UnsafePersistent is alive or 2) when there is a strong Persistent keeping the
-// memory alive while the UnsafePersistent is alive.
-template<typename T> class UnsafePersistent {
- public:
- UnsafePersistent() : value_(0) { }
-
- explicit UnsafePersistent(v8::Persistent<T>* handle) {
- value_ = handle->ClearAndLeak();
- }
-
- UnsafePersistent(v8::Isolate* isolate, const v8::Handle<T>& handle) {
- v8::Persistent<T> persistent(isolate, handle);
- value_ = persistent.ClearAndLeak();
- }
-
- // Usage of this function requires
- // V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR to be defined
- void Dispose() {
- v8::Persistent<T> handle(value_);
- handle.Reset();
- value_ = 0;
- }
-
- // Usage of this function requires
- // V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR to be defined
- v8::Local<T> NewLocal(v8::Isolate* isolate) {
- return v8::Local<T>::New(isolate, v8::Local<T>(value_));
- }
-
- private:
- T* value_;
-};
-
-} // namespace content
-
-#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_UNSAFE_PERSISTENT_H_

Powered by Google App Engine
This is Rietveld 408576698