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

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

Issue 5338025085108224: Support Acceptable Ads (Closed)
Left Patch Set: Cosmetic code fixes. Addressing comments. Created July 18, 2014, 6:51 p.m.
Right Patch Set: Missing negation fix Created July 18, 2014, 7:39 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 | « locales/uk.ini ('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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 WriteSubscriptions(response, filterEngine->GetListedSubscriptions()); 109 WriteSubscriptions(response, filterEngine->GetListedSubscriptions());
110 break; 110 break;
111 } 111 }
112 case Communication::PROC_SET_SUBSCRIPTION: 112 case Communication::PROC_SET_SUBSCRIPTION:
113 { 113 {
114 std::string url; 114 std::string url;
115 request >> url; 115 request >> url;
116 116
117 AdblockPlus::JsValuePtr valuePtr = filterEngine->GetPref("subscriptions_ exceptionsurl"); 117 AdblockPlus::JsValuePtr valuePtr = filterEngine->GetPref("subscriptions_ exceptionsurl");
118 std::string aaUrl = ""; 118 std::string aaUrl = "";
119 if (valuePtr->IsNull()) 119 if (!valuePtr->IsNull())
Eric 2014/07/18 19:26:48 Missing a ! negation?
Oleksandr 2014/07/18 19:44:00 Wow! That's awkward now :D On 2014/07/18 19:26:48,
Eric 2014/07/18 19:52:10 There's always the infrequently used !!! operator,
120 { 120 {
121 aaUrl = valuePtr->AsString(); 121 aaUrl = valuePtr->AsString();
122 } 122 }
123 std::vector<AdblockPlus::SubscriptionPtr> subscriptions = filterEngine-> GetListedSubscriptions(); 123 std::vector<AdblockPlus::SubscriptionPtr> subscriptions = filterEngine-> GetListedSubscriptions();
124 124
125 // Remove all subscriptions, besides the Acceptable Ads 125 // Remove all subscriptions, besides the Acceptable Ads
126 for (size_t i = 0, count = subscriptions.size(); i < count; i++) 126 for (size_t i = 0, count = subscriptions.size(); i < count; i++)
127 { 127 {
128 if (subscriptions[i]->GetProperty("url")->AsString() != aaUrl) 128 if (subscriptions[i]->GetProperty("url")->AsString() != aaUrl)
129 { 129 {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 } 447 }
448 catch (std::runtime_error e) 448 catch (std::runtime_error e)
449 { 449 {
450 DebugException(e); 450 DebugException(e);
451 return 1; 451 return 1;
452 } 452 }
453 } 453 }
454 454
455 return 0; 455 return 0;
456 } 456 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld