Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginDomTraverserBase.h

Issue 29332440: TEST CODE - Replace frame/iframe cache sets with boolean (Closed)
Patch Set: Created Dec. 7, 2015, 5:29 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginDomTraverserBase.h
===================================================================
--- a/src/plugin/PluginDomTraverserBase.h
+++ b/src/plugin/PluginDomTraverserBase.h
@@ -62,7 +62,6 @@
CComAutoCriticalSection m_criticalSection;
std::wstring m_domain;
- std::wstring m_documentName;
bool m_isHeaderTraversed;
@@ -71,8 +70,8 @@
int m_cacheIndexLast;
int m_cacheElementsMax;
- std::set<std::wstring> m_cacheDocumentHasFrames;
- std::set<std::wstring> m_cacheDocumentHasIframes;
+ bool cacheHasFrames;
+ bool cacheHasIframes;
T* m_cacheElements;
@@ -81,8 +80,9 @@
};
template <class T>
-CPluginDomTraverserBase<T>::CPluginDomTraverserBase(CPluginTab* tab) :
- m_tab(tab), m_isHeaderTraversed(false), m_cacheDomElementCount(0), m_cacheIndexLast(0), m_cacheElementsMax(5000)
+CPluginDomTraverserBase<T>::CPluginDomTraverserBase(CPluginTab* tab)
+ : m_tab(tab), m_isHeaderTraversed(false), m_cacheDomElementCount(0), m_cacheIndexLast(0), m_cacheElementsMax(5000)
+ , cacheHasFrames(false), cacheHasIframes(false)
{
m_cacheElements = new T[m_cacheElementsMax];
}
@@ -207,8 +207,8 @@
m_criticalSection.Lock();
{
- hasFrames = m_cacheDocumentHasFrames.find(m_documentName) != m_cacheDocumentHasFrames.end();
- hasIframes = m_cacheDocumentHasIframes.find(m_documentName) != m_cacheDocumentHasIframes.end();
+ hasFrames = cacheHasFrames;
+ hasIframes = cacheHasIframes;
}
m_criticalSection.Unlock();
@@ -396,7 +396,7 @@
{
m_criticalSection.Lock();
{
- m_cacheDocumentHasIframes.insert(m_documentName);
+ cacheHasIframes = true;
}
m_criticalSection.Unlock();
}
@@ -404,7 +404,7 @@
{
m_criticalSection.Lock();
{
- m_cacheDocumentHasFrames.insert(m_documentName);
+ cacheHasFrames = true;
}
m_criticalSection.Unlock();
}
@@ -453,8 +453,8 @@
m_criticalSection.Lock();
{
m_cacheIndexLast = 0;
- m_cacheDocumentHasFrames.clear();
- m_cacheDocumentHasIframes.clear();
+ cacheHasFrames = false;
+ cacheHasIframes = false;
}
m_criticalSection.Unlock();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld