summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Runtime.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-22 13:49:44 -0800
committerLei Zhang <thestig@chromium.org>2015-12-22 13:49:44 -0800
commitcd2bb30aba89a05c0bbd4d6973fa070205e3a1e8 (patch)
tree0eca7841e7be4b9392bbcd0ffb656a8495f64792 /fpdfsdk/src/javascript/JS_Runtime.cpp
parentbc75f1737f7eb8d45c5a2ebd3ad78203782c1642 (diff)
downloadpdfium-cd2bb30aba89a05c0bbd4d6973fa070205e3a1e8.tar.xz
Merge to XFA: Add ContainsKey() and ContainsValue() and use them where appropriate.
TBR=ochang@chromium.org Review URL: https://codereview.chromium.org/1540263003 . (cherry picked from commit 1fc92867ca53f0fba4272fbee3814d844f487495) Review URL: https://codereview.chromium.org/1542193002 .
Diffstat (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index eaf2dda36c..a20ca8f44d 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);
}