Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(468)

Unified Diff: fpdfsdk/javascript/cjs_runtime.cpp

Issue 2322743002: Replace CJS_Runtime::Observer with CFX_Runtime<CJS_Runtime>::Observer (Closed)
Patch Set: Order matters Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/javascript/cjs_runtime.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/cjs_runtime.cpp
diff --git a/fpdfsdk/javascript/cjs_runtime.cpp b/fpdfsdk/javascript/cjs_runtime.cpp
index b12a3f5eeb278f77693b9dd825859acb5bc0c26e..67d45d5e4a6b6e7eeb63e470f1605d361c0c9443 100644
--- a/fpdfsdk/javascript/cjs_runtime.cpp
+++ b/fpdfsdk/javascript/cjs_runtime.cpp
@@ -124,9 +124,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
}
CJS_Runtime::~CJS_Runtime() {
- for (auto* obs : m_observers)
- obs->OnDestroyed();
-
+ NotifyObservers();
ReleaseEngine();
if (m_isolateManaged) {
GetIsolate()->Dispose();
@@ -255,16 +253,6 @@ void CJS_Runtime::RemoveEventFromSet(const FieldEvent& event) {
m_FieldEventSet.erase(event);
}
-void CJS_Runtime::AddObserver(Observer* observer) {
- ASSERT(!pdfium::ContainsKey(m_observers, observer));
- m_observers.insert(observer);
-}
-
-void CJS_Runtime::RemoveObserver(Observer* observer) {
- ASSERT(pdfium::ContainsKey(m_observers, observer));
- m_observers.erase(observer);
-}
-
#ifdef PDF_ENABLE_XFA
CFX_WideString ChangeObjName(const CFX_WideString& str) {
CFX_WideString sRet = str;
« no previous file with comments | « fpdfsdk/javascript/cjs_runtime.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698