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: Created Nov. 3, 2016, 11: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;
+}

Powered by Google App Engine
This is Rietveld