Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Issue 2522943003: [iOS/ARC] Fix a violation of ODR in base::BindBlock under ARC. (Closed)

Created:
4 years ago by sdefresne
Modified:
4 years ago
CC:
chromium-reviews, extensions-reviews_chromium.org, cbentzel+watch_chromium.org, qsr+mojo_chromium.org, vmpstr+watch_chromium.org, pkl (ping after 24h if needed), viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, mac-reviews_chromium.org, chromium-apps-reviews_chromium.org, darin (slow to review), sdefresne+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[iOS/ARC] Fix a violation of ODR in base::BindBlock under ARC. The template function base::BindBlock invoked the constructor of base::mac::ScopedBlock that has two different signature whether ARC (automatic reference counting) is enabled or not. If two different files are compiled with a different ARC setting (one has ARC enabled, the other has it disabled) and both invoke base::BindBlock with the same type of block (i.e. same signature) then the function has two different implementation (which is a violation of the ODR) and one of them is selected at link-time. As the base::BindBlock implementation does retain the block, this can only lead to over-retaining an object (as the implementation leaks if the ARC version of base::mac::ScopedBlock is invoked) not to over-releasing. BUG=666027 Committed: https://crrev.com/3baab423ea642cc0851a482841091fd8ac9f8b3c Cr-Commit-Position: refs/heads/master@{#434182}

Patch Set 1 #

Patch Set 2 : Add unittest to validate the fix. #

Patch Set 3 : Switch expected and actual in EXPECT_EQ. #

Patch Set 4 : Use EXPECT_NSEQ instead of EXPECT_EQ/EXPECT_TRUE. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+151 lines, -106 lines) Patch
M base/mac/bind_objc_block.h View 4 chunks +22 lines, -0 lines 0 comments Download
M base/mac/bind_objc_block_unittest.mm View 1 2 3 2 chunks +24 lines, -7 lines 0 comments Download
M base/mac/bind_objc_block_unittest_arc.mm View 1 2 3 6 chunks +44 lines, -28 lines 0 comments Download
M base/mac/scoped_nsobject_unittest.mm View 1 1 chunk +0 lines, -8 lines 0 comments Download
M base/mac/scoped_nsobject_unittest_arc.mm View 1 1 chunk +0 lines, -6 lines 0 comments Download
M ios/chrome/browser/browser_state/off_the_record_chrome_browser_state_io_data.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/chrome/browser/share_extension/share_extension_item_receiver.mm View 8 chunks +10 lines, -9 lines 0 comments Download
M ios/chrome/browser/ssl/ios_ssl_error_handler_unittest.mm View 3 chunks +3 lines, -3 lines 0 comments Download
M ios/web/net/clients/crw_redirect_network_client.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/web/net/crw_cert_verification_controller.mm View 3 chunks +35 lines, -29 lines 0 comments Download
M ios/web/net/request_tracker_impl.mm View 6 chunks +8 lines, -12 lines 0 comments Download
M ios/web/webui/crw_web_ui_manager.mm View 1 chunk +1 line, -1 line 0 comments Download
M ios/web/webui/mojo_facade.mm View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 27 (20 generated)
stkhapugin
lgtm
4 years ago (2016-11-23 13:40:18 UTC) #4
sdefresne
Please take a look. The added unit tests fails without the patch as expected (at ...
4 years ago (2016-11-23 15:07:58 UTC) #10
Mark Mentovai
LGTM
4 years ago (2016-11-23 16:22:52 UTC) #17
rohitrao (ping after 24h)
lgtm
4 years ago (2016-11-23 16:32:42 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2522943003/60001
4 years ago (2016-11-23 16:36:13 UTC) #23
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-11-23 16:41:51 UTC) #25
commit-bot: I haz the power
4 years ago (2016-11-23 16:45:04 UTC) #27
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/3baab423ea642cc0851a482841091fd8ac9f8b3c
Cr-Commit-Position: refs/heads/master@{#434182}

Powered by Google App Engine
This is Rietveld 408576698