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

Unified Diff: fpdfsdk/src/javascript/JS_Runtime.cpp

Issue 1542193002: Merge to XFA: Add ContainsKey() and ContainsValue() and use them where appropriate. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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/src/fsdk_mgr.cpp ('k') | fpdfsdk/src/javascript/util.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Runtime.cpp
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index eaf2dda36c12d0eaee55eeecdece3340c3a28e15..a20ca8f44d4fe2ed53ced1ff01a31208367d3e47 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -26,6 +26,7 @@
#include "global.h"
#include "report.h"
#include "util.h"
+#include "third_party/base/stl_util.h"
#ifdef PDF_ENABLE_XFA
#include "../../../xfa/src/fxjse/src/value.h"
@@ -326,11 +327,11 @@ FX_BOOL CJS_Runtime::SetHValueByName(const CFX_ByteStringC& utf8Name,
#endif
void CJS_Runtime::AddObserver(Observer* observer) {
- ASSERT(m_observers.find(observer) == m_observers.end());
+ ASSERT(!pdfium::ContainsKey(m_observers, observer));
m_observers.insert(observer);
}
void CJS_Runtime::RemoveObserver(Observer* observer) {
- ASSERT(m_observers.find(observer) != m_observers.end());
+ ASSERT(pdfium::ContainsKey(m_observers, observer));
m_observers.erase(observer);
}
« no previous file with comments | « fpdfsdk/src/fsdk_mgr.cpp ('k') | fpdfsdk/src/javascript/util.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698