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

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

Issue 11013110: Cleanup (Closed)
Patch Set: More refactoring. Removing main thread, tab counting. Implementing SetPref and GetPref. Addressing … Created July 9, 2013, 12:59 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
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginSettings.h" 3 #include "PluginSettings.h"
4 #include "PluginSystem.h" 4 #include "PluginSystem.h"
5 #include "PluginFilter.h" 5 #include "PluginFilter.h"
6 #include "PluginClientFactory.h" 6 #include "PluginClientFactory.h"
7 #include "PluginMutex.h" 7 #include "PluginMutex.h"
8 #include "PluginClass.h" 8 #include "PluginClass.h"
9 9
10 #include "AdblockPlusClient.h" 10 #include "AdblockPlusClient.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 377
378 try 378 try
379 { 379 {
380 CallAdblockPlusEngineProcedure(request); 380 CallAdblockPlusEngineProcedure(request);
381 } 381 }
382 catch (const std::exception& e) 382 catch (const std::exception& e)
383 { 383 {
384 DEBUG_GENERAL(e.what()); 384 DEBUG_GENERAL(e.what());
385 } 385 }
386 } 386 }
387
388 void CAdblockPlusClient::SetPref(const std::wstring& name, const std::wstring& v alue)
389 {
390 Communication::OutputBuffer request;
391 request << Communication::PROC_SET_PREF << ToUtf8String(name) << ToUtf8String( value);
392
393 try
394 {
395 CallAdblockPlusEngineProcedure(request);
396 }
397 catch (const std::exception& e)
398 {
399 DEBUG_GENERAL(e.what());
400 }
401 }
402
403 std::wstring CAdblockPlusClient::GetPref(const std::wstring& name)
404 {
405 Communication::OutputBuffer request;
406 request << Communication::PROC_GET_PREF << ToUtf8String(name);
407
408 try
409 {
410 Communication::InputBuffer response = CallAdblockPlusEngineProcedure(request );
411 std::vector<std::wstring> retValue = ReadStrings(response);
412 return retValue.size() > 0 ? retValue.at(0) : L"";
Wladimir Palant 2013/07/11 12:53:10 This really shouldn't try to read a list of string
413 }
414 catch (const std::exception& e)
415 {
416 DEBUG_GENERAL(e.what());
417 return L"";
418 }
419 }
OLDNEW

Powered by Google App Engine
This is Rietveld