summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/JS_Runtime.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-22 13:48:10 -0800
committerLei Zhang <thestig@chromium.org>2015-12-22 13:48:10 -0800
commit1fc92867ca53f0fba4272fbee3814d844f487495 (patch)
tree8c81760b66d1e8da186bddc52d38f350f4e85bf1 /fpdfsdk/src/javascript/JS_Runtime.cpp
parentf6dafc90ec1a0df8d618efc68c0223f0cdd80ffb (diff)
downloadpdfium-1fc92867ca53f0fba4272fbee3814d844f487495.tar.xz
Add ContainsKey() and ContainsValue() and use them where appropriate.
R=ochang@chromium.org Review URL: https://codereview.chromium.org/1540263003 .
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 f52e23a094..b08823f6ed 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"
// static
void IJS_Runtime::Initialize(unsigned int slot, void* isolate) {
@@ -206,11 +207,11 @@ v8::Local<v8::Context> CJS_Runtime::NewJSContext() {
}
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);
}