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

Unified Diff: extensions/renderer/unsafe_persistent.h

Issue 225413015: Remove unused class UnsafePersistent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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
« no previous file with comments | « extensions/extensions.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/unsafe_persistent.h
diff --git a/extensions/renderer/unsafe_persistent.h b/extensions/renderer/unsafe_persistent.h
deleted file mode 100644
index 2a658783db7f72b7ec6495df3b7e715a87be617f..0000000000000000000000000000000000000000
--- a/extensions/renderer/unsafe_persistent.h
+++ /dev/null
@@ -1,51 +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 EXTENSIONS_RENDERER_UNSAFE_PERSISTENT_H_
-#define EXTENSIONS_RENDERER_UNSAFE_PERSISTENT_H_
-
-#include "v8/include/v8.h"
-
-namespace extensions {
-
-// 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 extensions
-
-#endif // EXTENSIONS_RENDERER_UNSAFE_PERSISTENT_H_
« no previous file with comments | « extensions/extensions.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698