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

Side by Side Diff: src/engine/Main.cpp

Issue 5652794446970880: Rely on libadblockplus for domain extraction (Closed)
Patch Set: Use libadblockplus for domain extraction in APP as well Created April 22, 2014, 7:48 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 | « no previous file | src/plugin/AdblockPlusClient.h » ('j') | src/plugin/AdblockPlusClient.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <AdblockPlus.h> 1 #include <AdblockPlus.h>
2 #include <functional> 2 #include <functional>
3 #include <vector> 3 #include <vector>
4 #include <Windows.h> 4 #include <Windows.h>
5 5
6 #include "../shared/AutoHandle.h" 6 #include "../shared/AutoHandle.h"
7 #include "../shared/Communication.h" 7 #include "../shared/Communication.h"
8 #include "../shared/Dictionary.h" 8 #include "../shared/Dictionary.h"
9 #include "../shared/Utils.h" 9 #include "../shared/Utils.h"
10 #include "../shared/Version.h" 10 #include "../shared/Version.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 { 307 {
308 response << ToUtf16String(filterEngine->GetPref("documentation_link")->A sString()); 308 response << ToUtf16String(filterEngine->GetPref("documentation_link")->A sString());
309 break; 309 break;
310 } 310 }
311 case Communication::PROC_TOGGLE_PLUGIN_ENABLED: 311 case Communication::PROC_TOGGLE_PLUGIN_ENABLED:
312 { 312 {
313 filterEngine->SetPref("enabled", filterEngine->GetJsEngine()->NewValue(! filterEngine->GetPref("enabled")->AsBool())); 313 filterEngine->SetPref("enabled", filterEngine->GetJsEngine()->NewValue(! filterEngine->GetPref("enabled")->AsBool()));
314 response << filterEngine->GetPref("enabled")->AsBool(); 314 response << filterEngine->GetPref("enabled")->AsBool();
315 break; 315 break;
316 } 316 }
317 case Communication::PROC_GET_HOST:
318 {
319 std::string url;
320 request >> url;
321 std::string host = filterEngine->GetHostFromURL(url);
322 if (host.empty())
323 {
324 response << url;
325 }
326 else
327 {
328 response << host;
329 }
330 break;
331 }
317 } 332 }
318 return response; 333 return response;
319 } 334 }
320 335
321 DWORD WINAPI ClientThread(LPVOID param) 336 DWORD WINAPI ClientThread(LPVOID param)
322 { 337 {
323 std::auto_ptr<Communication::Pipe> pipe(static_cast<Communication::Pipe*>(pa ram)); 338 std::auto_ptr<Communication::Pipe> pipe(static_cast<Communication::Pipe*>(pa ram));
324 339
325 std::stringstream stream; 340 std::stringstream stream;
326 stream << GetCurrentThreadId(); 341 stream << GetCurrentThreadId();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 } 463 }
449 catch (std::runtime_error e) 464 catch (std::runtime_error e)
450 { 465 {
451 DebugException(e); 466 DebugException(e);
452 return 1; 467 return 1;
453 } 468 }
454 } 469 }
455 470
456 return 0; 471 return 0;
457 } 472 }
OLDNEW
« no previous file with comments | « no previous file | src/plugin/AdblockPlusClient.h » ('j') | src/plugin/AdblockPlusClient.cpp » ('J')

Powered by Google App Engine
This is Rietveld