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

Delta Between Two Patch Sets: src/Notification.cpp

Issue 29419629: Issue 5164 - Remove NotificationPtr (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Left Patch Set: Added move assignment operator. Created April 24, 2017, 7:08 p.m.
Right Patch Set: Call the inherited assignment operator properly Created April 24, 2017, 8:16 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/FilterEngine.cpp ('k') | test/Notification.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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 { 67 {
68 } 68 }
69 69
70 Notification::Notification(JsValue&& jsValue) 70 Notification::Notification(JsValue&& jsValue)
71 : JsValue(std::move(jsValue)) 71 : JsValue(std::move(jsValue))
72 { 72 {
73 } 73 }
74 74
75 Notification& Notification::operator=(const Notification& src) 75 Notification& Notification::operator=(const Notification& src)
76 { 76 {
77 *this = src; 77 static_cast<JsValue&>(*this) = src;
78 return *this; 78 return *this;
79 } 79 }
80 80
81 Notification& Notification::operator=(Notification&& src) 81 Notification& Notification::operator=(Notification&& src)
82 { 82 {
83 *this = std::move(src); 83 static_cast<JsValue&>(*this) = std::move(src);
sergei 2017/04/24 19:28:15 It will cause an infinite recursion. It should be
hub 2017/04/24 20:17:04 oops. same with the assignment (copy).
84 return *this; 84 return *this;
85 } 85 }
86 86
87 NotificationType Notification::GetType() const 87 NotificationType Notification::GetType() const
88 { 88 {
89 return StringToNotificationType(GetProperty("type").AsString()); 89 return StringToNotificationType(GetProperty("type").AsString());
90 } 90 }
91 91
92 NotificationTexts Notification::GetTexts() const 92 NotificationTexts Notification::GetTexts() const
93 { 93 {
(...skipping 25 matching lines...) Expand all
119 { 119 {
120 retValue.push_back(link.AsString()); 120 retValue.push_back(link.AsString());
121 } 121 }
122 return retValue; 122 return retValue;
123 } 123 }
124 124
125 void Notification::MarkAsShown() 125 void Notification::MarkAsShown()
126 { 126 {
127 jsEngine->Evaluate("API.markNotificationAsShown").Call(GetProperty("id")); 127 jsEngine->Evaluate("API.markNotificationAsShown").Call(GetProperty("id"));
128 } 128 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld