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

Unified Diff: src/plugin/AdblockPlusClient.cpp

Issue 10825021: Move settings page into the application directory (Closed)
Patch Set: Created June 3, 2013, 11:40 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 | « no previous file | src/plugin/PluginClass.cpp » ('j') | src/plugin/PluginUtil.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/AdblockPlusClient.cpp
===================================================================
--- a/src/plugin/AdblockPlusClient.cpp
+++ b/src/plugin/AdblockPlusClient.cpp
@@ -39,48 +39,41 @@ namespace
CloseHandle(processInformation.hThread);
}
std::auto_ptr<Communication::Pipe> OpenAdblockPlusEnginePipe()
{
std::auto_ptr<Communication::Pipe> result;
try
{
- try
+ result.reset(new Communication::Pipe(Communication::pipeName,
+ Communication::Pipe::MODE_CONNECT));
+ }
+ catch (Communication::PipeConnectionError e)
+ {
+ SpawnAdblockPlusEngine();
+
+ int timeout = 10000;
+ const int step = 10;
+ while (!result.get())
{
- result.reset(new Communication::Pipe(Communication::pipeName,
- Communication::Pipe::MODE_CONNECT));
- }
- catch (Communication::PipeConnectionError e)
- {
- SpawnAdblockPlusEngine();
-
- int timeout = 10000;
- const int step = 10;
- while (!result.get())
+ try
{
- try
- {
- result.reset(new Communication::Pipe(Communication::pipeName,
- Communication::Pipe::MODE_CONNECT));
- }
- catch (Communication::PipeConnectionError e)
- {
- Sleep(step);
- timeout -= step;
- if (timeout <= 0)
- throw std::runtime_error("Unable to open Adblock Plus Engine pipe");
- }
+ result.reset(new Communication::Pipe(Communication::pipeName,
+ Communication::Pipe::MODE_CONNECT));
+ }
+ catch (Communication::PipeConnectionError e)
+ {
+ Sleep(step);
+ timeout -= step;
+ if (timeout <= 0)
+ throw std::runtime_error("Unable to open Adblock Plus Engine pipe");
}
}
}
- catch(std::exception e)
- {
- DEBUG_GENERAL(e.what());
Wladimir Palant 2013/06/03 11:43:31 I had to remove the try..catch block here - if the
- }
return result;
}
std::vector<std::string> ReadStrings(Communication::InputBuffer& message)
{
int32_t count;
message >> count;
« no previous file with comments | « no previous file | src/plugin/PluginClass.cpp » ('j') | src/plugin/PluginUtil.h » ('J')

Powered by Google App Engine
This is Rietveld