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

Unified Diff: src/JsValue.cpp

Issue 29449592: Issue 5183 - Provide async interface for FileSystem (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Rebase on master. Last changes. Created July 7, 2017, 1:36 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
« no previous file with comments | « src/JsEngine.cpp ('k') | src/Thread.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/JsValue.cpp
===================================================================
--- a/src/JsValue.cpp
+++ b/src/JsValue.cpp
@@ -122,16 +122,22 @@
}
std::string AdblockPlus::JsValue::AsString() const
{
const JsContext context(*jsEngine);
return Utils::FromV8String(UnwrapValue());
}
+StringBuffer AdblockPlus::JsValue::AsStringBuffer() const
+{
+ const JsContext context(*jsEngine);
+ return Utils::StringBufferFromV8String(UnwrapValue());
+}
+
int64_t AdblockPlus::JsValue::AsInt() const
{
const JsContext context(*jsEngine);
return UnwrapValue()->IntegerValue();
}
bool AdblockPlus::JsValue::AsBool() const
{
@@ -198,16 +204,22 @@
}
void AdblockPlus::JsValue::SetProperty(const std::string& name, const std::string& val)
{
const JsContext context(*jsEngine);
SetProperty(name, Utils::ToV8String(jsEngine->GetIsolate(), val));
}
+void AdblockPlus::JsValue::SetStringBufferProperty(const std::string& name, const StringBuffer& val)
+{
+ const JsContext context(*jsEngine);
+ SetProperty(name, Utils::StringBufferToV8String(jsEngine->GetIsolate(), val));
+}
+
void AdblockPlus::JsValue::SetProperty(const std::string& name, int64_t val)
{
const JsContext context(*jsEngine);
SetProperty(name, v8::Number::New(jsEngine->GetIsolate(), val));
}
void AdblockPlus::JsValue::SetProperty(const std::string& name, const JsValue& val)
{
« no previous file with comments | « src/JsEngine.cpp ('k') | src/Thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld