| Index: include/AdblockPlus/JsValue.h |
| =================================================================== |
| --- a/include/AdblockPlus/JsValue.h |
| +++ b/include/AdblockPlus/JsValue.h |
| @@ -1,27 +1,27 @@ |
| #ifndef ADBLOCKPLUS_JS_VALUE_H |
| #define ADBLOCKPLUS_JS_VALUE_H |
| +#include <string> |
| #include <vector> |
| #include <v8.h> |
| -#ifdef _MSC_VER |
| -#include <memory> |
| -#else |
| -#include <tr1/memory> |
| -#endif |
| +#include "tr1_memory.h" |
| namespace AdblockPlus |
| { |
| + class JsValue; |
| class JsEngine; |
| - class JsValue; |
| typedef std::tr1::shared_ptr<JsValue> JsValuePtr; |
| typedef std::vector<AdblockPlus::JsValuePtr> JsValueList; |
| + // Forward declaration to avoid including JsEngine.h |
| + typedef std::tr1::shared_ptr<JsEngine> JsEnginePtr; |
| + |
| class JsValue |
| { |
| friend class JsEngine; |
| friend class JsObject; |
| public: |
| virtual ~JsValue(); |
| bool IsUndefined() const; |
| @@ -49,17 +49,17 @@ namespace AdblockPlus |
| inline void SetProperty(const std::string& name, int val) |
| { |
| SetProperty(name, static_cast<int64_t>(val)); |
| } |
| std::string GetClassName() const; |
| JsValuePtr Call(const JsValueList& params = JsValueList(), |
| AdblockPlus::JsValuePtr thisPtr = AdblockPlus::JsValuePtr()) const; |
| protected: |
| - JsValue(JsEngine& jsEngine, v8::Handle<v8::Value> value); |
| + JsValue(JsEnginePtr jsEngine, v8::Handle<v8::Value> value); |
| void SetProperty(const std::string& name, v8::Handle<v8::Value> val); |
| - JsEngine& jsEngine; |
| + JsEnginePtr jsEngine; |
| v8::Persistent<v8::Value> value; |
| }; |
| } |
| #endif |