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

Side by Side Diff: src/plugin/PluginTabBase.cpp

Issue 4895405913407488: Issue #1234 - remove CString from declarations representing domains. (Closed)
Patch Set: Created Aug. 7, 2014, 7:46 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/PluginTabBase.h ('k') | src/plugin/PluginWbPassThrough.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 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginClient.h" 3 #include "PluginClient.h"
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #ifdef SUPPORT_CONFIG 5 #ifdef SUPPORT_CONFIG
6 #include "PluginConfig.h" 6 #include "PluginConfig.h"
7 #endif 7 #endif
8 #include "PluginTab.h" 8 #include "PluginTab.h"
9 #include "PluginDomTraverser.h" 9 #include "PluginDomTraverser.h"
10 #include "PluginClass.h" 10 #include "PluginClass.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 void CPluginTabBase::OnUpdate() 80 void CPluginTabBase::OnUpdate()
81 { 81 {
82 m_isActivated = true; 82 m_isActivated = true;
83 } 83 }
84 84
85 namespace 85 namespace
86 { 86 {
87 void FilterLoader(CPluginTabBase* tabBase) 87 void FilterLoader(CPluginTabBase* tabBase)
88 { 88 {
89 tabBase->m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementH idingSelectors(tabBase->GetDocumentDomain().GetString())); 89 tabBase->m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementH idingSelectors(tabBase->GetDocumentDomain()));
90 SetEvent(tabBase->m_filter->hideFiltersLoadedEvent); 90 SetEvent(tabBase->m_filter->hideFiltersLoadedEvent);
91 } 91 }
92 } 92 }
93 93
94 void CPluginTabBase::OnNavigate(const CString& url) 94 void CPluginTabBase::OnNavigate(const CString& url)
95 { 95 {
96 SetDocumentUrl(url); 96 SetDocumentUrl(url);
97 97
98 98
99 #ifdef SUPPORT_FRAME_CACHING 99 #ifdef SUPPORT_FRAME_CACHING
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 docHostUIHandler->UpdateUI(); 237 docHostUIHandler->UpdateUI();
238 } 238 }
239 } 239 }
240 240
241 pDoc.Release(); 241 pDoc.Release();
242 pDocDispatch.Release(); 242 pDocDispatch.Release();
243 } 243 }
244 #endif 244 #endif
245 } 245 }
246 246
247 CString CPluginTabBase::GetDocumentDomain() 247 std::wstring CPluginTabBase::GetDocumentDomain()
248 { 248 {
249 CString domain; 249 std::wstring domain;
250 250
251 m_criticalSection.Lock(); 251 m_criticalSection.Lock();
252 { 252 {
253 domain = m_documentDomain; 253 domain = m_documentDomain;
254 } 254 }
255 m_criticalSection.Unlock(); 255 m_criticalSection.Unlock();
256 256
257 return domain; 257 return domain;
258 } 258 }
259 259
260 void CPluginTabBase::SetDocumentUrl(const CString& url) 260 void CPluginTabBase::SetDocumentUrl(const CString& url)
261 { 261 {
262 m_criticalSection.Lock(); 262 m_criticalSection.Lock();
263 { 263 {
264 m_documentUrl = url; 264 m_documentUrl = url;
265 m_documentDomain = CString(CAdblockPlusClient::GetInstance()->GetHostFromUrl (url.GetString()).c_str()); 265 m_documentDomain = CAdblockPlusClient::GetInstance()->GetHostFromUrl(to_wstr ing(url));
266 } 266 }
267 m_criticalSection.Unlock(); 267 m_criticalSection.Unlock();
268 } 268 }
269 269
270 CString CPluginTabBase::GetDocumentUrl() 270 CString CPluginTabBase::GetDocumentUrl()
271 { 271 {
272 CString url; 272 CString url;
273 273
274 m_criticalSection.Lock(); 274 m_criticalSection.Lock();
275 { 275 {
(...skipping 26 matching lines...) Expand all
302 302
303 void CPluginTabBase::CacheFrame(const CString& url) 303 void CPluginTabBase::CacheFrame(const CString& url)
304 { 304 {
305 m_criticalSectionCache.Lock(); 305 m_criticalSectionCache.Lock();
306 { 306 {
307 m_cacheFrames.insert(url); 307 m_cacheFrames.insert(url);
308 } 308 }
309 m_criticalSectionCache.Unlock(); 309 m_criticalSectionCache.Unlock();
310 } 310 }
311 311
312 void CPluginTabBase::ClearFrameCache(const CString& domain) 312 void CPluginTabBase::ClearFrameCache(const std::wstring& domain)
313 { 313 {
314 m_criticalSectionCache.Lock(); 314 m_criticalSectionCache.Lock();
315 { 315 {
316 if (domain.IsEmpty() || domain != m_cacheDomain) 316 if (domain.empty() || domain != m_cacheDomain)
317 { 317 {
318 m_cacheFrames.clear(); 318 m_cacheFrames.clear();
319 m_cacheDomain = domain; 319 m_cacheDomain = domain;
320 } 320 }
321 } 321 }
322 m_criticalSectionCache.Unlock(); 322 m_criticalSectionCache.Unlock();
323 } 323 }
324 324
325 #endif // SUPPORT_FRAME_CACHING 325 #endif // SUPPORT_FRAME_CACHING
326 326
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 CPluginClient::LogPluginError(pluginError.GetErrorCode(), pluginError. GetErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), tr ue, pluginError.GetProcessId(), pluginError.GetThreadId()); 386 CPluginClient::LogPluginError(pluginError.GetErrorCode(), pluginError. GetErrorId(), pluginError.GetErrorSubid(), pluginError.GetErrorDescription(), tr ue, pluginError.GetProcessId(), pluginError.GetThreadId());
387 } 387 }
388 388
389 // Non-hanging sleep 389 // Non-hanging sleep
390 Sleep(50); 390 Sleep(50);
391 } 391 }
392 392
393 tabLoopIteration++; 393 tabLoopIteration++;
394 } 394 }
395 } 395 }
OLDNEW
« no previous file with comments | « src/plugin/PluginTabBase.h ('k') | src/plugin/PluginWbPassThrough.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld