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: Minor CallEngine refactoring Created July 26, 2013, 2:12 p.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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 break; 183 break;
184 } 184 }
185 break; 185 break;
186 } 186 }
187 case Communication::PROC_GET_PREF: 187 case Communication::PROC_GET_PREF:
188 { 188 {
189 std::string name; 189 std::string name;
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())
Wladimir Palant 2013/07/26 16:45:37 valuePtr->IsNull() will be true for undefined as w
Oleksandr 2013/08/05 23:11:01 This was addressed in: https://hg.adblockplus.org/
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 200
201 if (valuePtr->IsBool()) 201 if (valuePtr->IsBool())
202 { 202 {
203 response << true;
203 response << valuePtr->AsBool(); 204 response << valuePtr->AsBool();
205 }
206 else if (valuePtr->IsNumber())
207 {
204 response << true; 208 response << true;
Wladimir Palant 2013/07/26 16:45:37 I don't get this, shouldn't you first write succes
205 }
206 else if (valuePtr->IsNumber())
207 {
208 response << valuePtr->AsInt(); 209 response << valuePtr->AsInt();
210 }
211 else if (valuePtr->IsString())
212 {
209 response << true; 213 response << true;
210 }
211 else if (valuePtr->IsString())
212 {
213 response << valuePtr->AsString(); 214 response << valuePtr->AsString();
214 response << true;
215 } 215 }
216 else 216 else
217 { 217 {
218 // Report failure 218 // Report failure
219 response << false; 219 response << false;
220 } 220 }
221 break; 221 break;
222 } 222 }
223 223
224 } 224 }
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 } 325 }
326 catch (std::runtime_error e) 326 catch (std::runtime_error e)
327 { 327 {
328 DebugException(e); 328 DebugException(e);
329 return 1; 329 return 1;
330 } 330 }
331 } 331 }
332 332
333 return 0; 333 return 0;
334 } 334 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld