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

Unified Diff: src/Utils.cpp

Issue 29361562: Issue 3594 - remove circular references JsEngine-JsValue-JsEngine (Closed)
Patch Set: temporary workaround for race condition Created Dec. 1, 2016, 10:26 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
Index: src/Utils.cpp
diff --git a/src/Utils.cpp b/src/Utils.cpp
index 1020ec5b6334a1bd293cdb3ef353fd858ae8d633..6501e069c86a09d94e5ac7b816b24884f1204ba2 100644
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -24,6 +24,7 @@
#endif
#include "Utils.h"
+#include <AdblockPlus/JsEngine.h>
using namespace AdblockPlus;
@@ -104,3 +105,10 @@ std::wstring Utils::CanonizeUrl(const std::wstring& url)
}
#endif
+std::shared_ptr<JsEngine> Utils::lockJsEngine(const std::weak_ptr<JsEngine>& jsEngine)
+{
+ auto retValue = jsEngine.lock();
+ if (!retValue)
+ throw AdblockPlus::JsEngine::JsEngineNotAvailableException();
+ return retValue;
+}
« src/JsValue.cpp ('K') | « src/Utils.h ('k') | src/WebRequestJsObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld