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

Unified Diff: include/AdblockPlus/JsValue.h

Issue 10727002: Get rid of dependencies on v8.h in public header files (Closed)
Patch Set: Added helper class to make using v8 values via auto_ptr less awkward Created May 23, 2013, 4:08 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/JsValue.h
===================================================================
--- a/include/AdblockPlus/JsValue.h
+++ b/include/AdblockPlus/JsValue.h
@@ -16,18 +16,25 @@
*/
#ifndef ADBLOCK_PLUS_JS_VALUE_H
#define ADBLOCK_PLUS_JS_VALUE_H
#include <stdint.h>
#include <string>
#include <vector>
-#include <v8.h>
#include "tr1_memory.h"
+#include "V8ValueHolder.h"
+
+namespace v8
+{
+ class Value;
+ template <class T> class Handle;
+ template <class T> class Persistent;
Felix Dahlke 2013/05/24 15:45:41 Doesn't look like this is necessary.
+}
namespace AdblockPlus
{
class JsValue;
class JsEngine;
typedef std::tr1::shared_ptr<JsValue> JsValuePtr;
typedef std::vector<AdblockPlus::JsValuePtr> JsValueList;
@@ -71,13 +78,13 @@ namespace AdblockPlus
std::string GetClass() const;
JsValuePtr Call(const JsValueList& params = JsValueList(),
AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const;
protected:
JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value);
void SetProperty(const std::string& name, v8::Handle<v8::Value> val);
JsEnginePtr jsEngine;
- v8::Persistent<v8::Value> value;
+ V8ValueHolder<v8::Value> value;
};
}
#endif

Powered by Google App Engine
This is Rietveld