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

Side by Side Diff: compiled/bindings/generator.h

Issue 29433621: Noissue - [emscripten] Make bindings slightly more efficient by resolving classes when mappings are… (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Created May 8, 2017, 1:25 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 | « no previous file | compiled/bindings/generator.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-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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 void register_property(TYPEID classID, const char* name, 197 void register_property(TYPEID classID, const char* name,
198 const FunctionInfo& getter, const FunctionInfo& setter, 198 const FunctionInfo& getter, const FunctionInfo& setter,
199 const char* jsValue = ""); 199 const char* jsValue = "");
200 200
201 void register_method(TYPEID classID, const char* name, 201 void register_method(TYPEID classID, const char* name,
202 const FunctionInfo& call); 202 const FunctionInfo& call);
203 203
204 void register_differentiator(TYPEID classID, size_t offset, 204 void register_differentiator(TYPEID classID, size_t offset,
205 std::vector<std::pair<int, std::string>>& mapping); 205 std::vector<std::pair<int, std::string>>& mapping);
206 206
207 std::string generateCall(const FunctionInfo& call,
208 std::vector<std::string>& params);
209
210 std::string wrapCall(const FunctionInfo& call, bool isFunction = true); 207 std::string wrapCall(const FunctionInfo& call, bool isFunction = true);
211
212 void printHelpers();
213
214 void printClass(const ClassInfo& cls);
215 } 208 }
216 209
217 template<typename ClassType, 210 template<typename ClassType,
218 typename BaseClass = bindings_internal::NoBaseClass, 211 typename BaseClass = bindings_internal::NoBaseClass,
219 typename std::enable_if<std::is_base_of<ref_counted, ClassType>::value>::typ e* = nullptr> 212 typename std::enable_if<std::is_base_of<ref_counted, ClassType>::value>::typ e* = nullptr>
220 class class_ 213 class class_
221 { 214 {
222 public: 215 public:
223 class_(const char* name) 216 class_(const char* name)
224 { 217 {
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 for (const auto& item : list) 282 for (const auto& item : list)
290 mapping.emplace_back(item.first, item.second); 283 mapping.emplace_back(item.first, item.second);
291 284
292 bindings_internal::register_differentiator( 285 bindings_internal::register_differentiator(
293 bindings_internal::TypeInfo<ClassType>(), offset, mapping); 286 bindings_internal::TypeInfo<ClassType>(), offset, mapping);
294 return *this; 287 return *this;
295 } 288 }
296 }; 289 };
297 290
298 void printBindings(); 291 void printBindings();
OLDNEW
« no previous file with comments | « no previous file | compiled/bindings/generator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld