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

Delta Between Two Patch Sets: src/engine/main.cpp

Issue 11013110: Cleanup (Closed)
Left Patch Set: Whole cleanup + comments addressed Created July 23, 2013, 11:34 a.m.
Right Patch Set: More beautification and addressing comments Created July 29, 2013, 12:13 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « adblockplus.gyp ('k') | src/plugin/AdblockPlus.rc » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 request >> name; 190 request >> name;
191 191
192 AdblockPlus::JsValuePtr valuePtr = filterEngine->GetPref(name); 192 AdblockPlus::JsValuePtr valuePtr = filterEngine->GetPref(name);
193 if (valuePtr->IsNull() || valuePtr->IsUndefined()) 193 if (valuePtr->IsNull() || valuePtr->IsUndefined())
194 { 194 {
195 // Report no success 195 // Report no success
196 response << false; 196 response << false;
197 break; 197 break;
198 } 198 }
199 199
200 // Report success
201 response << true;
Felix Dahlke 2013/07/25 13:52:33 So anything that is not bool, int or string will r
202 200
203 if (valuePtr->IsBool()) 201 if (valuePtr->IsBool())
204 { 202 {
203 response << true;
205 response << valuePtr->AsBool(); 204 response << valuePtr->AsBool();
206 } 205 }
207 else if (valuePtr->IsNumber()) 206 else if (valuePtr->IsNumber())
208 { 207 {
208 response << true;
209 response << valuePtr->AsInt(); 209 response << valuePtr->AsInt();
210 } 210 }
211 else if (valuePtr->IsString()) 211 else if (valuePtr->IsString())
212 { 212 {
213 response << true;
213 response << valuePtr->AsString(); 214 response << valuePtr->AsString();
215 }
216 else
217 {
218 // Report failure
219 response << false;
214 } 220 }
215 break; 221 break;
216 } 222 }
217 223
218 } 224 }
219 return response; 225 return response;
220 } 226 }
221 227
222 DWORD WINAPI ClientThread(LPVOID param) 228 DWORD WINAPI ClientThread(LPVOID param)
223 { 229 {
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 } 325 }
320 catch (std::runtime_error e) 326 catch (std::runtime_error e)
321 { 327 {
322 DebugException(e); 328 DebugException(e);
323 return 1; 329 return 1;
324 } 330 }
325 } 331 }
326 332
327 return 0; 333 return 0;
328 } 334 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld