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

Unified Diff: include/AdblockPlus/JsEngine.h

Issue 10213003: Make JsEngine::Evaluate() return a wrapper for v8::Value to accessdifferent variable types easily (Closed)
Patch Set: Created April 12, 2013, 2:55 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/JsEngine.h
===================================================================
--- a/include/AdblockPlus/JsEngine.h
+++ b/include/AdblockPlus/JsEngine.h
@@ -1,14 +1,15 @@
#ifndef ADBLOCKPLUS_JS_ENGINE_H
#define ADBLOCKPLUS_JS_ENGINE_H
#include <stdexcept>
#include <string>
#include <v8.h>
+#include <AdblockPlus/JsValue.h>
namespace AdblockPlus
{
class ErrorCallback;
class FileReader;
class WebRequest;
class JsError : public std::runtime_error
@@ -19,17 +20,17 @@ namespace AdblockPlus
};
class JsEngine
{
public:
JsEngine(const FileReader* const fileReader,
WebRequest* const webRequest,
ErrorCallback* const errorCallback);
- std::string Evaluate(const std::string& source,
+ JsValuePtr Evaluate(const std::string& source,
const std::string& filename = "");
void Load(const std::string& scriptPath);
void Gc();
private:
const FileReader* const fileReader;
v8::Persistent<v8::Context> context;
};

Powered by Google App Engine
This is Rietveld