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

Delta Between Two Patch Sets: src/FilterEngine.cpp

Issue 5163715573841920: Issue 768 - Switch from TR1 to C++11 (Closed)
Left Patch Set: rebase Created Aug. 5, 2015, 10:38 a.m.
Right Patch Set: fix including of <memory> Created Aug. 7, 2015, 6:07 a.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/FileSystemJsObject.cpp ('k') | src/JsEngine.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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 func->Call(params); 279 func->Call(params);
280 } 280 }
281 281
282 void FilterEngine::SetShowNotificationCallback(const ShowNotificationCallback& v alue) 282 void FilterEngine::SetShowNotificationCallback(const ShowNotificationCallback& v alue)
283 { 283 {
284 if (!value) 284 if (!value)
285 return; 285 return;
286 286
287 jsEngine->SetEventCallback("_showNotification", 287 jsEngine->SetEventCallback("_showNotification",
288 std::bind(&FilterEngine::ShowNotification, this, value, 288 std::bind(&FilterEngine::ShowNotification, this, value,
289 std::placeholders::_1)); 289 std::placeholders::_1));
Felix Dahlke 2015/08/05 21:28:05 Nit: This was previously indented on column (i.e.
290 } 290 }
291 291
292 void FilterEngine::RemoveShowNotificationCallback() 292 void FilterEngine::RemoveShowNotificationCallback()
293 { 293 {
294 jsEngine->RemoveEventCallback("_showNotification"); 294 jsEngine->RemoveEventCallback("_showNotification");
295 } 295 }
296 296
297 AdblockPlus::FilterPtr FilterEngine::Matches(const std::string& url, 297 AdblockPlus::FilterPtr FilterEngine::Matches(const std::string& url,
298 ContentType contentType, 298 ContentType contentType,
299 const std::string& documentUrl) const 299 const std::string& documentUrl) const
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 JsValueList params; 376 JsValueList params;
377 params.push_back(jsEngine->NewValue(url)); 377 params.push_back(jsEngine->NewValue(url));
378 return func->Call(params)->AsString(); 378 return func->Call(params)->AsString();
379 } 379 }
380 380
381 void FilterEngine::SetUpdateAvailableCallback( 381 void FilterEngine::SetUpdateAvailableCallback(
382 FilterEngine::UpdateAvailableCallback callback) 382 FilterEngine::UpdateAvailableCallback callback)
383 { 383 {
384 jsEngine->SetEventCallback("updateAvailable", 384 jsEngine->SetEventCallback("updateAvailable",
385 std::bind(&FilterEngine::UpdateAvailable, this, callback, 385 std::bind(&FilterEngine::UpdateAvailable, this, callback,
386 std::placeholders::_1)); 386 std::placeholders::_1));
Felix Dahlke 2015/08/05 21:28:05 Nit: This was previously indented on column (i.e.
387 } 387 }
388 388
389 void FilterEngine::RemoveUpdateAvailableCallback() 389 void FilterEngine::RemoveUpdateAvailableCallback()
390 { 390 {
391 jsEngine->RemoveEventCallback("updateAvailable"); 391 jsEngine->RemoveEventCallback("updateAvailable");
392 } 392 }
393 393
394 void FilterEngine::UpdateAvailable( 394 void FilterEngine::UpdateAvailable(
395 FilterEngine::UpdateAvailableCallback callback, JsValueList& params) 395 FilterEngine::UpdateAvailableCallback callback, JsValueList& params)
396 { 396 {
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 451
452 452
453 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2) 453 int FilterEngine::CompareVersions(const std::string& v1, const std::string& v2)
454 { 454 {
455 JsValueList params; 455 JsValueList params;
456 params.push_back(jsEngine->NewValue(v1)); 456 params.push_back(jsEngine->NewValue(v1));
457 params.push_back(jsEngine->NewValue(v2)); 457 params.push_back(jsEngine->NewValue(v2));
458 JsValuePtr func = jsEngine->Evaluate("API.compareVersions"); 458 JsValuePtr func = jsEngine->Evaluate("API.compareVersions");
459 return func->Call(params)->AsInt(); 459 return func->Call(params)->AsInt();
460 } 460 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld