commit | 8c14ad2e43c2e7ae309ad337f691281090ad4b01 | [log] [tgz] |
---|---|---|
author | Victor Costan <pwnall@chromium.org> | Thu Dec 14 16:39:22 2017 |
committer | Commit Bot <commit-bot@chromium.org> | Thu Dec 14 16:39:22 2017 |
tree | 7f387a8be5409fd056ba13fa3f1c3aa068b7b0d6 | |
parent | 8c324f67ae0d013beece31f8a2d4650b0db14601 [diff] |
Make BlinkCloneableMessage and BlinkTransferableMessage move-only. The mojo typemaps for BlinkCloneableMessage and BlinkTransferableMessage specify that the structs are move-only, so the code in the mojo bindings uses std::move. However, since the structs declare a custom constructor (the constructor is defaulted in the .cpp, but the compiler can't see this from the .h), no move constructor or move-assignment is generated, and the structs are copied rather than being moved. The mismatch causes extra reference increments / decrements. When the underlying type uses thread-safe reference counter (like SerializedScriptValue does), increments and decrements use atomic operations, which are not cheap on ARM. This CL adds move constructors and move-assignment operators to BlinkCloneableMessage to allow moving, and adds DISALLOW_COPY_AND_ASSIGN to prevent accidental copying. This CL also adds DISALLOW_COPY_AND_ASSIGN to the browser-side structures corresponding to Blink{Cloneable,Transferable}Message, to make it obvious that they are move-only. Bug: 794791 Change-Id: Iffe8f1e65bf9ccc2cd98082c341c2bdc3246fa33 Reviewed-on: https://chromium-review.googlesource.com/826260 Commit-Queue: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Jeremy Roman <jbroman@chromium.org> Reviewed-by: Marijn Kruisselbrink <mek@chromium.org> Cr-Commit-Position: refs/heads/master@{#524085}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .