| OLD | NEW |
| 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 25 matching lines...) Expand all Loading... |
| 36 response << subscription->GetProperty("url")->AsString() | 36 response << subscription->GetProperty("url")->AsString() |
| 37 << subscription->GetProperty("title")->AsString() | 37 << subscription->GetProperty("title")->AsString() |
| 38 << subscription->GetProperty("specialization")->AsString() | 38 << subscription->GetProperty("specialization")->AsString() |
| 39 << subscription->IsListed(); | 39 << subscription->IsListed(); |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 | 42 |
| 43 CriticalSection firstRunLock; | 43 CriticalSection firstRunLock; |
| 44 bool firstRunActionExecuted = false; | 44 bool firstRunActionExecuted = false; |
| 45 | 45 |
| 46 void UpdateCallback(const std::string res) |
| 47 { |
| 48 //TODO: Display UI here |
| 49 return; |
| 50 } |
| 51 |
| 46 Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request) | 52 Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request) |
| 47 { | 53 { |
| 48 Communication::OutputBuffer response; | 54 Communication::OutputBuffer response; |
| 49 | 55 |
| 50 Communication::ProcType procedure; | 56 Communication::ProcType procedure; |
| 51 request >> procedure; | 57 request >> procedure; |
| 52 switch (procedure) | 58 switch (procedure) |
| 53 { | 59 { |
| 54 case Communication::PROC_MATCHES: | 60 case Communication::PROC_MATCHES: |
| 55 { | 61 { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 response << true; | 223 response << true; |
| 218 response << valuePtr->AsString(); | 224 response << valuePtr->AsString(); |
| 219 } | 225 } |
| 220 else | 226 else |
| 221 { | 227 { |
| 222 // Report failure | 228 // Report failure |
| 223 response << false; | 229 response << false; |
| 224 } | 230 } |
| 225 break; | 231 break; |
| 226 } | 232 } |
| 233 case Communication::PROC_CHECK_FOR_UPDATES: |
| 234 { |
| 235 filterEngine->ForceUpdateCheck(UpdateCallback); |
| 236 break; |
| 237 } |
| 227 case Communication::PROC_IS_FIRST_RUN_ACTION_NEEDED: | 238 case Communication::PROC_IS_FIRST_RUN_ACTION_NEEDED: |
| 228 { | 239 { |
| 229 CriticalSection::Lock lock(firstRunLock); | 240 CriticalSection::Lock lock(firstRunLock); |
| 230 if (!firstRunActionExecuted && filterEngine->IsFirstRun()) | 241 if (!firstRunActionExecuted && filterEngine->IsFirstRun()) |
| 231 { | 242 { |
| 232 response << true; | 243 response << true; |
| 233 firstRunActionExecuted = true; | 244 firstRunActionExecuted = true; |
| 234 } | 245 } |
| 235 else | 246 else |
| 236 { | 247 { |
| 237 response << false; | 248 response << false; |
| 238 } | 249 } |
| 239 break; | 250 break; |
| 240 } | 251 } |
| 252 case Communication::PROC_GET_APP_LOCALE: |
| 253 { |
| 254 response << ToUtf16String(filterEngine->GetAppLocale()); |
| 255 break; |
| 256 } |
| 257 case Communication::PROC_GET_DOCUMENTATION_LINK: |
| 258 { |
| 259 response << ToUtf16String(filterEngine->GetDocumentationLink()); |
| 260 break; |
| 261 } |
| 241 | 262 |
| 242 } | 263 } |
| 243 return response; | 264 return response; |
| 244 } | 265 } |
| 245 | 266 |
| 246 DWORD WINAPI ClientThread(LPVOID param) | 267 DWORD WINAPI ClientThread(LPVOID param) |
| 247 { | 268 { |
| 248 std::auto_ptr<Communication::Pipe> pipe(static_cast<Communication::Pipe*>(pa
ram)); | 269 std::auto_ptr<Communication::Pipe> pipe(static_cast<Communication::Pipe*>(pa
ram)); |
| 249 | 270 |
| 250 try | 271 try |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 364 } |
| 344 catch (std::runtime_error e) | 365 catch (std::runtime_error e) |
| 345 { | 366 { |
| 346 DebugException(e); | 367 DebugException(e); |
| 347 return 1; | 368 return 1; |
| 348 } | 369 } |
| 349 } | 370 } |
| 350 | 371 |
| 351 return 0; | 372 return 0; |
| 352 } | 373 } |
| OLD | NEW |