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

Side by Side Diff: compiled/bindings.ipp

Issue 29385742: Issue 4127 - [emscripten] Convert subscription classes to C++ - Part 2 (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Rebased Created April 13, 2017, 1:01 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/bindings.cpp ('k') | compiled/filter/Filter.h » ('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-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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 else 483 else
484 { 484 {
485 result += " var type = HEAP32[result + " + std::to_string(offset)+ " >> 2];\n"; 485 result += " var type = HEAP32[result + " + std::to_string(offset)+ " >> 2];\n";
486 result += " if (type in " + cls.name + "_mapping)\n"; 486 result += " if (type in " + cls.name + "_mapping)\n";
487 result += " result = new (exports[" + cls.name + "_mapping[type]] )(result);\n"; 487 result += " result = new (exports[" + cls.name + "_mapping[type]] )(result);\n";
488 result += " else\n"; 488 result += " else\n";
489 result += " throw new Error('Unexpected " + cls.name + " type: ' + type);\n"; 489 result += " throw new Error('Unexpected " + cls.name + " type: ' + type);\n";
490 } 490 }
491 491
492 result += " }\n"; 492 result += " }\n";
493 result += " else\n";
494 result += " result = null;\n";
493 return result; 495 return result;
494 } 496 }
495 default: 497 default:
496 throw std::runtime_error("Unexpected return type for " + std::string(cal l.name)); 498 throw std::runtime_error("Unexpected return type for " + std::string(cal l.name));
497 } 499 }
498 } 500 }
499 501
500 const std::string wrapCall(const FunctionInfo& call) 502 const std::string wrapCall(const FunctionInfo& call)
501 { 503 {
502 bool hasStringArgs = false; 504 bool hasStringArgs = false;
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 795
794 std::vector<std::pair<int, std::string>> mapping; 796 std::vector<std::pair<int, std::string>> mapping;
795 for (const auto& item : list) 797 for (const auto& item : list)
796 mapping.emplace_back(item.first, item.second); 798 mapping.emplace_back(item.first, item.second);
797 799
798 bindings_internal::register_differentiator( 800 bindings_internal::register_differentiator(
799 bindings_internal::TypeInfo<ClassType>(), offset, mapping); 801 bindings_internal::TypeInfo<ClassType>(), offset, mapping);
800 return *this; 802 return *this;
801 } 803 }
802 }; 804 };
OLDNEW
« no previous file with comments | « compiled/bindings.cpp ('k') | compiled/filter/Filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld