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

Unified Diff: src/engine/Main.cpp

Issue 6321034575740928: Issue 1032 - Use ReferrerMapping API (Closed)
Patch Set: Created July 22, 2014, 10:03 a.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 | « .hgsubstate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/engine/Main.cpp
===================================================================
--- a/src/engine/Main.cpp
+++ b/src/engine/Main.cpp
@@ -10,6 +10,7 @@
#include "../shared/Utils.h"
#include "../shared/Version.h"
#include "../shared/CriticalSection.h"
+#include "AdblockPlus.h"
#include "Debug.h"
#include "Updater.h"
@@ -75,6 +76,7 @@
CriticalSection firstRunLock;
CriticalSection updateCheckLock;
bool firstRunActionExecuted = false;
+ AdblockPlus::ReferrerMapping referrerMapping;
Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request)
{
Communication::OutputBuffer response;
@@ -89,7 +91,8 @@
std::string type;
std::string documentUrl;
request >> url >> type >> documentUrl;
- AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, documentUrl);
+ referrerMapping.Add(url, documentUrl);
+ AdblockPlus::FilterPtr filter = filterEngine->Matches(url, type, referrerMapping.BuildReferrerChain(url));
response << (filter && filter->GetType() != AdblockPlus::Filter::TYPE_EXCEPTION);
break;
}
« no previous file with comments | « .hgsubstate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld