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

Side by Side Diff: compiled/intrusive_ptr.h

Issue 29721753: Issue 6180 - use ABP_TEXT everywhere in order to let String be a UTF-8 string (Closed) Base URL: https://github.com/adblockplus/adblockpluscore.git@adb2678354813ce5b6de095072954c5a784a7bc4
Patch Set: rebase Created March 15, 2018, 1:53 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/filter/RegExpFilter.cpp ('k') | compiled/library.cpp » ('j') | 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 26 matching lines...) Expand all
37 class ref_counted 37 class ref_counted
38 { 38 {
39 public: 39 public:
40 void AddRef() 40 void AddRef()
41 { 41 {
42 mRefCount++; 42 mRefCount++;
43 } 43 }
44 44
45 void ReleaseRef() 45 void ReleaseRef()
46 { 46 {
47 assert2(mRefCount > 0, u"Unexpected zero or negative reference count"_str); 47 assert2(mRefCount > 0, ABP_TEXT("Unexpected zero or negative reference count "_str));
48 if (--mRefCount == 0) 48 if (--mRefCount == 0)
49 delete this; 49 delete this;
50 } 50 }
51 51
52 protected: 52 protected:
53 ref_counted() 53 ref_counted()
54 : mRefCount(1) 54 : mRefCount(1)
55 { 55 {
56 } 56 }
57 57
58 virtual ~ref_counted() 58 virtual ~ref_counted()
59 { 59 {
60 assert2(mRefCount == 0, u"Destroying a ref-counted object with a non-zero re ference count"_str); 60 assert2(mRefCount == 0, ABP_TEXT("Destroying a ref-counted object with a non -zero reference count"_str));
61 } 61 }
62 62
63 private: 63 private:
64 int mRefCount; 64 int mRefCount;
65 }; 65 };
66 66
67 template<typename T> 67 template<typename T>
68 class intrusive_ptr 68 class intrusive_ptr
69 { 69 {
70 static_assert(std::is_base_of<ref_counted, T>::value, "The class T should inhe rit ref_counted"); 70 static_assert(std::is_base_of<ref_counted, T>::value, "The class T should inhe rit ref_counted");
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 return a == b.get(); 216 return a == b.get();
217 } 217 }
218 218
219 template<typename T, typename U> 219 template<typename T, typename U>
220 inline bool operator!=(const T* a, intrusive_ptr<U> const& b) 220 inline bool operator!=(const T* a, intrusive_ptr<U> const& b)
221 { 221 {
222 return a != b.get(); 222 return a != b.get();
223 } 223 }
224 224
225 ABP_NS_END 225 ABP_NS_END
OLDNEW
« no previous file with comments | « compiled/filter/RegExpFilter.cpp ('k') | compiled/library.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld