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

Side by Side Diff: compiled/subscription/UserDefinedSubscription.cpp

Issue 29549903: Issue 5664 - assert now accept one parameter. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Leave assert() alone now. Created Sept. 21, 2017, 12:48 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « compiled/storage/FilterStorage.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 UserDefinedSubscription::UserDefinedSubscription(const String& id) 50 UserDefinedSubscription::UserDefinedSubscription(const String& id)
51 : Subscription(Type::USERDEFINED, id), mDefaults(0) 51 : Subscription(Type::USERDEFINED, id), mDefaults(0)
52 { 52 {
53 } 53 }
54 54
55 bool UserDefinedSubscription::IsDefaultFor(const Filter& filter) const 55 bool UserDefinedSubscription::IsDefaultFor(const Filter& filter) const
56 { 56 {
57 if (filter.mType >= Filter::Type::VALUE_COUNT) 57 if (filter.mType >= Filter::Type::VALUE_COUNT)
58 { 58 {
59 assert(false, "Filter type exceeds valid range"); 59 assert2(false, "Filter type exceeds valid range");
60 abort(); 60 abort();
61 } 61 }
62 return mDefaults & filterTypeToCategory[filter.mType]; 62 return mDefaults & filterTypeToCategory[filter.mType];
63 } 63 }
64 64
65 void UserDefinedSubscription::MakeDefaultFor(const Filter& filter) 65 void UserDefinedSubscription::MakeDefaultFor(const Filter& filter)
66 { 66 {
67 if (filter.mType >= Filter::Type::VALUE_COUNT) 67 if (filter.mType >= Filter::Type::VALUE_COUNT)
68 { 68 {
69 assert(false, "Filter type exceeds valid range"); 69 assert2(false, "Filter type exceeds valid range");
70 abort(); 70 abort();
71 } 71 }
72 mDefaults |= filterTypeToCategory[filter.mType]; 72 mDefaults |= filterTypeToCategory[filter.mType];
73 } 73 }
74 74
75 void UserDefinedSubscription::InsertFilterAt(Filter& filter, unsigned pos) 75 void UserDefinedSubscription::InsertFilterAt(Filter& filter, unsigned pos)
76 { 76 {
77 if (pos >= mFilters.size()) 77 if (pos >= mFilters.size())
78 pos = mFilters.size(); 78 pos = mFilters.size();
79 mFilters.emplace(mFilters.begin() + pos, &filter); 79 mFilters.emplace(mFilters.begin() + pos, &filter);
(...skipping 29 matching lines...) Expand all
109 if (mDefaults & FilterCategory::BLOCKING) 109 if (mDefaults & FilterCategory::BLOCKING)
110 result.append(u" blocking"_str); 110 result.append(u" blocking"_str);
111 if (mDefaults & FilterCategory::WHITELIST) 111 if (mDefaults & FilterCategory::WHITELIST)
112 result.append(u" whitelist"_str); 112 result.append(u" whitelist"_str);
113 if (mDefaults & FilterCategory::ELEMHIDE) 113 if (mDefaults & FilterCategory::ELEMHIDE)
114 result.append(u" elemhide"_str); 114 result.append(u" elemhide"_str);
115 result.append(u'\n'); 115 result.append(u'\n');
116 } 116 }
117 return result; 117 return result;
118 } 118 }
OLDNEW
« no previous file with comments | « compiled/storage/FilterStorage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld