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

Side by Side Diff: fpdfsdk/javascript/app.cpp

Issue 2626863003: Don't put timers with ID == 0 into the global timer map. (Closed)
Patch Set: add test Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « fpdfsdk/fpdfformfill_embeddertest.cpp ('k') | testing/embedder_test_timer_handling_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "fpdfsdk/javascript/app.h" 7 #include "fpdfsdk/javascript/app.h"
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 : m_nTimerID(0), 68 : m_nTimerID(0),
69 m_pEmbedObj(pObj), 69 m_pEmbedObj(pObj),
70 m_bProcessing(false), 70 m_bProcessing(false),
71 m_nType(nType), 71 m_nType(nType),
72 m_dwTimeOut(dwTimeOut), 72 m_dwTimeOut(dwTimeOut),
73 m_swJScript(script), 73 m_swJScript(script),
74 m_pRuntime(pRuntime), 74 m_pRuntime(pRuntime),
75 m_pFormFillEnv(pFormFillEnv) { 75 m_pFormFillEnv(pFormFillEnv) {
76 CFX_SystemHandler* pHandler = m_pFormFillEnv->GetSysHandler(); 76 CFX_SystemHandler* pHandler = m_pFormFillEnv->GetSysHandler();
77 m_nTimerID = pHandler->SetTimer(dwElapse, Trigger); 77 m_nTimerID = pHandler->SetTimer(dwElapse, Trigger);
78 (*GetGlobalTimerMap())[m_nTimerID] = this; 78 if (m_nTimerID)
79 (*GetGlobalTimerMap())[m_nTimerID] = this;
79 } 80 }
80 81
81 GlobalTimer::~GlobalTimer() { 82 GlobalTimer::~GlobalTimer() {
82 if (!m_nTimerID) 83 if (!m_nTimerID)
83 return; 84 return;
84 85
85 if (GetRuntime()) 86 if (GetRuntime())
86 m_pFormFillEnv->GetSysHandler()->KillTimer(m_nTimerID); 87 m_pFormFillEnv->GetSysHandler()->KillTimer(m_nTimerID);
87 88
88 GetGlobalTimerMap()->erase(m_nTimerID); 89 GetGlobalTimerMap()->erase(m_nTimerID);
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 bool app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { 793 bool app::media(IJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) {
793 return false; 794 return false;
794 } 795 }
795 796
796 bool app::execDialog(IJS_Context* cc, 797 bool app::execDialog(IJS_Context* cc,
797 const std::vector<CJS_Value>& params, 798 const std::vector<CJS_Value>& params,
798 CJS_Value& vRet, 799 CJS_Value& vRet,
799 CFX_WideString& sError) { 800 CFX_WideString& sError) {
800 return true; 801 return true;
801 } 802 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdfformfill_embeddertest.cpp ('k') | testing/embedder_test_timer_handling_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698