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

Unified Diff: src/FileSystemJsObject.cpp

Issue 29809555: Issue #6526 - pass v8::Isolate to more functions because old approach is deprecated (Closed) Base URL: https://github.com/adblockplus/libadblockplus@4d9bcc12e77369cbc4bc04bace9a3e7fa03de17b
Patch Set: Created June 18, 2018, 10:22 a.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/ConsoleJsObject.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/FileSystemJsObject.cpp
diff --git a/src/FileSystemJsObject.cpp b/src/FileSystemJsObject.cpp
index f62e00429eea3dc98cf5d028592ca733bacc4faf..e7d94db95daa0e5a323d4105215e1d30a33a98c4 100644
--- a/src/FileSystemJsObject.cpp
+++ b/src/FileSystemJsObject.cpp
@@ -179,16 +179,18 @@ namespace
if (!globalContext->IsObject())
throw std::runtime_error("`this` pointer has to be an object");
- const v8::TryCatch tryCatch(jsEngine->GetIsolate());
+ auto isolate = jsEngine->GetIsolate();
+ const v8::TryCatch tryCatch(isolate);
const auto contentEnd = content.cend();
auto stringBegin = SkipEndOfLine(content.begin(), contentEnd);
+ auto v8Context = isolate->GetCurrentContext();
do
{
auto stringEnd = AdvanceToEndOfLine(stringBegin, contentEnd);
- auto jsLine = Utils::StringBufferToV8String(jsEngine->GetIsolate(), StringBuffer(stringBegin, stringEnd)).As<v8::Value>();
- processFunc->Call(globalContext, 1, &jsLine);
+ auto jsLine = Utils::StringBufferToV8String(isolate, StringBuffer(stringBegin, stringEnd)).As<v8::Value>();
+ processFunc->Call(v8Context, globalContext, 1, &jsLine);
hub 2018/06/18 12:59:02 I get this warning here: ../src/FileSystemJsObjec
sergei 2018/06/18 13:00:19 Yeah, that's because the impl is not complete yet.
if (tryCatch.HasCaught())
- throw JsError(tryCatch.Exception(), tryCatch.Message());
+ throw JsError(isolate, tryCatch.Exception(), tryCatch.Message());
stringBegin = SkipEndOfLine(stringEnd, contentEnd);
} while (stringBegin != contentEnd);
jsEngine->GetJsValues(weakData->weakResolveCallback)[0].Call();
« no previous file with comments | « src/ConsoleJsObject.cpp ('k') | src/JsEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld