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

Side by Side Diff: Shared/PluginWbPassThrough.cpp

Issue 8978054: Removal of shareware parts (Closed)
Patch Set: Created Dec. 5, 2012, 7:59 a.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 | « Shared/PluginSettings.cpp ('k') | no next file » | 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 "PluginWbPassThrough.h" 3 #include "PluginWbPassThrough.h"
4 #include "PluginClient.h" 4 #include "PluginClient.h"
5 #include "PluginClientFactory.h" 5 #include "PluginClientFactory.h"
6 #ifdef SUPPORT_FILTER 6 #ifdef SUPPORT_FILTER
7 #include "PluginFilter.h" 7 #include "PluginFilter.h"
8 #endif 8 #endif
9 #include "PluginSettings.h" 9 #include "PluginSettings.h"
10 #include "PluginClass.h" 10 #include "PluginClass.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 else 109 else
110 { 110 {
111 contentType = CFilter::contentTypeAny & ~CFi lter::contentTypeSubdocument; 111 contentType = CFilter::contentTypeAny & ~CFi lter::contentTypeSubdocument;
112 } 112 }
113 } 113 }
114 if (client->ShouldBlock(src, contentType, domain, true)) 114 if (client->ShouldBlock(src, contentType, domain, true))
115 { 115 {
116 isBlocked = true; 116 isBlocked = true;
117 117
118 DEBUG_BLOCKER("Blocker::Blocking Http-request:" + src); 118 DEBUG_BLOCKER("Blocker::Blocking Http-request:" + src);
119
120 CPluginSettings* settings = CPluginSettings::Get Instance();
121 //is plugin registered
122 if (!settings->GetBool(SETTING_PLUGIN_REGISTRATI ON, false))
123 {
124 //is the limit exceeded?
125 if ((settings->GetValue(SETTING_PLUGIN_A DBLOCKCOUNT, 0) >= settings->GetValue(SETTING_PLUGIN_ADBLOCKLIMIT, 0))
126 && (settings->GetValue(SETTING_P LUGIN_ADBLOCKLIMIT, 0) > 0))
127 {
128 return false;
129 }
130
131 else
132 {
133 //Increment blocked ads counter if not registered and not yet exceeded the adblocklimit
134 settings->SetValue(SETTING_PLUGI N_ADBLOCKCOUNT, settings->GetValue(SETTING_PLUGIN_ADBLOCKCOUNT, 0) + 1);
135 settings->Write();
136 }
137 }
138 } 119 }
139 #ifdef ENABLE_DEBUG_RESULT_IGNORED 120 #ifdef ENABLE_DEBUG_RESULT_IGNORED
140 else 121 else
141 { 122 {
142 CString type; 123 CString type;
143 124
144 if (contentType == CFilter::contentTypeDocument) type = "doc"; 125 if (contentType == CFilter::contentTypeDocument) type = "doc";
145 else if (contentType == CFilter::contentTypeObject) type = " object"; 126 else if (contentType == CFilter::contentTypeObject) type = " object";
146 else if (contentType == CFilter::contentTypeImage) type = "i mg"; 127 else if (contentType == CFilter::contentTypeImage) type = "i mg";
147 else if (contentType == CFilter::contentTypeScript) type = " script"; 128 else if (contentType == CFilter::contentTypeScript) type = " script";
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 CComPtr<IHttpNegotiate> spHttpNegotiate; 317 CComPtr<IHttpNegotiate> spHttpNegotiate;
337 QueryServiceFromClient(&spHttpNegotiate); 318 QueryServiceFromClient(&spHttpNegotiate);
338 319
339 return spHttpNegotiate ? spHttpNegotiate->OnResponse(dwResponseCode, szR esponseHeaders, szRequestHeaders, pszAdditionalRequestHeaders) : S_OK; 320 return spHttpNegotiate ? spHttpNegotiate->OnResponse(dwResponseCode, szR esponseHeaders, szRequestHeaders, pszAdditionalRequestHeaders) : S_OK;
340 } 321 }
341 322
342 STDMETHODIMP WBPassthruSink::ReportProgress(ULONG ulStatusCode, LPCWSTR szStatus Text) 323 STDMETHODIMP WBPassthruSink::ReportProgress(ULONG ulStatusCode, LPCWSTR szStatus Text)
343 { 324 {
344 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgre ss(ulStatusCode, szStatusText) : S_OK; 325 return m_spInternetProtocolSink ? m_spInternetProtocolSink->ReportProgre ss(ulStatusCode, szStatusText) : S_OK;
345 } 326 }
OLDNEW
« no previous file with comments | « Shared/PluginSettings.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld