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

Delta Between Two Patch Sets: src/FilterEngine.cpp

Issue 29391775: Issue 5013 - Improve some const-correctness (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Feedback + another small patch related. Created March 22, 2017, 4:50 p.m.
Right Patch Set: Removed GetType() const-ness change Created March 23, 2017, 12:57 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 | « src/DefaultWebRequestCurl.cpp ('k') | src/JsValue.cpp » ('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 /* 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-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 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 19 matching lines...) Expand all
30 30
31 extern std::string jsSources[]; 31 extern std::string jsSources[];
32 32
33 Filter::Filter(JsValue&& value) 33 Filter::Filter(JsValue&& value)
34 : JsValue(std::move(value)) 34 : JsValue(std::move(value))
35 { 35 {
36 if (!IsObject()) 36 if (!IsObject())
37 throw std::runtime_error("JavaScript value is not an object"); 37 throw std::runtime_error("JavaScript value is not an object");
38 } 38 }
39 39
40 Filter::Type Filter::GetType() const 40 Filter::Type Filter::GetType()
41 { 41 {
42 std::string className = GetClass(); 42 std::string className = GetClass();
43 if (className == "BlockingFilter") 43 if (className == "BlockingFilter")
44 return TYPE_BLOCKING; 44 return TYPE_BLOCKING;
45 else if (className == "WhitelistFilter") 45 else if (className == "WhitelistFilter")
46 return TYPE_EXCEPTION; 46 return TYPE_EXCEPTION;
47 else if (className == "ElemHideFilter") 47 else if (className == "ElemHideFilter")
48 return TYPE_ELEMHIDE; 48 return TYPE_ELEMHIDE;
49 else if (className == "ElemHideException") 49 else if (className == "ElemHideException")
50 return TYPE_ELEMHIDE_EXCEPTION; 50 return TYPE_ELEMHIDE_EXCEPTION;
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url); 581 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent Url);
582 if (filter) 582 if (filter)
583 { 583 {
584 return filter; 584 return filter;
585 } 585 }
586 currentUrl = parentUrl; 586 currentUrl = parentUrl;
587 } 587 }
588 while (urlIterator != documentUrls.end()); 588 while (urlIterator != documentUrls.end());
589 return FilterPtr(); 589 return FilterPtr();
590 } 590 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld