Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include/AdblockPlus/V8ValueHolder.h

Issue 5598762307158016: Issue 1550 - Get rid of V8ValueHolder.h (Closed)
Patch Set: fix JsValue destructor Created Jan. 22, 2016, 1:16 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: include/AdblockPlus/V8ValueHolder.h
diff --git a/include/AdblockPlus/V8ValueHolder.h b/include/AdblockPlus/V8ValueHolder.h
deleted file mode 100644
index 52722dcdf46c91cb717c91877bdd845ebf6cab3a..0000000000000000000000000000000000000000
--- a/include/AdblockPlus/V8ValueHolder.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of Adblock Plus <https://adblockplus.org/>,
- * Copyright (C) 2006-2016 Eyeo GmbH
- *
- * Adblock Plus is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Adblock Plus is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef ADBLOCK_PLUS_V8_VALUE_HOLDER_H
-#define ADBLOCK_PLUS_V8_VALUE_HOLDER_H
-
-#include <memory>
-
-namespace v8
-{
- class Isolate;
- template<class T> class Handle;
- template<class T> class Persistent;
-}
-
-namespace AdblockPlus
-{
- template<class T>
- class V8ValueHolder
- {
- public:
- typedef typename v8::Persistent<T> V8Persistent;
- V8ValueHolder()
- {
- reset();
- }
- V8ValueHolder(v8::Isolate* isolate, v8::Handle<T> value)
- {
- reset(isolate, value);
- }
- ~V8ValueHolder()
- {
- if (this->value.get())
- {
- this->value->Dispose(this->isolate);
- this->value.reset(0);
- }
- }
- void reset(v8::Isolate* isolate, v8::Handle<T> value)
- {
- reset(isolate, std::auto_ptr<V8Persistent>(new V8Persistent(isolate, value)));
- }
- void reset(v8::Isolate* isolate = 0, std::auto_ptr<V8Persistent> value = std::auto_ptr<V8Persistent>(new V8Persistent()))
- {
- if (this->value.get())
- {
- this->value->Dispose(this->isolate);
- this->value.reset(0);
- }
-
- if (!value->IsEmpty())
- {
- this->isolate = isolate;
- this->value = value;
- }
- }
-
- operator V8Persistent&() const
- {
- return *value;
- }
- private:
- v8::Isolate* isolate;
- std::auto_ptr<V8Persistent> value;
- };
-}
-
-#endif

Powered by Google App Engine
This is Rietveld