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

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

Issue 1365503003: Merge to XFA: Use std::set<> to track active event handlers. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Blown merge. Created 5 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/include/javascript/JS_Runtime.h ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Context.cpp
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index d4d1f2c8773869e403351083ca319f29798122d4..f09032622672d4bf2775a6c2b719eb1b8559a194 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -47,8 +47,9 @@ FX_BOOL CJS_Context::RunScript(const CFX_WideString& script,
m_bBusy = TRUE;
ASSERT(m_pEventHandler->IsValid());
- if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(),
- m_pEventHandler->EventType())) {
+ CJS_Runtime::FieldEvent event(m_pEventHandler->TargetName(),
+ m_pEventHandler->EventType());
+ if (!m_pRuntime->AddEventToSet(event)) {
info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
return FALSE;
}
@@ -69,9 +70,7 @@ FX_BOOL CJS_Context::RunScript(const CFX_WideString& script,
info = JSGetStringFromID(this, IDS_STRING_RUN);
}
- m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(),
- m_pEventHandler->EventType());
-
+ m_pRuntime->RemoveEventFromSet(event);
m_pEventHandler->Destroy();
m_bBusy = FALSE;
« no previous file with comments | « fpdfsdk/include/javascript/JS_Runtime.h ('k') | fpdfsdk/src/javascript/JS_Runtime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698