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

Issue 2762023003: Enable ARC for //ios/web_view/internal/translate/*.m. (Closed)

Created:
3 years, 9 months ago by Hiroshi Ichikawa
Modified:
3 years, 9 months ago
Reviewers:
michaeldo
CC:
chromium-reviews, Eugene But (OOO till 7-30), ios-reviews+web_chromium.org, ios-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Enable ARC for //ios/web_view/internal/translate/*.m. This CL also (hopefully) fixes occasional SEGV of ios_web_view_shell, by marking WebViewTranslateClient::delegete_ as __weak and also initializing it with nil. I believe the SEGV happened because: - Actually web_view_translate_client.h has been already built with ARC *enabled* because it's included by cwv_web_view.mm. - With ARC enabled, WebViewTranslateClient::delegete_ was a strong reference. - WebViewTranslateClient::delegete_ was not initialized, so it held an uninitialized pointer initially. - So call to WebViewTranslateClient::set_translate_delegate() tries to free an uninitialized pointer, causing SEGV. BUG=703564 Review-Url: https://codereview.chromium.org/2762023003 Cr-Commit-Position: refs/heads/master@{#458688} Committed: https://chromium.googlesource.com/chromium/src/+/d78e66457cf8aa8a82f0cfc8a387eb8a71655bb7

Patch Set 1 #

Total comments: 5

Patch Set 2 : Apply review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -4 lines) Patch
M ios/web_view/internal/translate/BUILD.gn View 1 chunk +2 lines, -0 lines 0 comments Download
M ios/web_view/internal/translate/cwv_translate_manager_impl.mm View 1 chunk +4 lines, -0 lines 0 comments Download
M ios/web_view/internal/translate/web_view_translate_client.h View 1 3 chunks +4 lines, -3 lines 0 comments Download
M ios/web_view/internal/translate/web_view_translate_client.mm View 1 2 chunks +5 lines, -1 line 0 comments Download

Messages

Total messages: 17 (8 generated)
Hiroshi Ichikawa
3 years, 9 months ago (2017-03-21 09:38:30 UTC) #3
michaeldo
Thank you! https://codereview.chromium.org/2762023003/diff/1/ios/web_view/internal/translate/web_view_translate_client.h File ios/web_view/internal/translate/web_view_translate_client.h (right): https://codereview.chromium.org/2762023003/diff/1/ios/web_view/internal/translate/web_view_translate_client.h#newcode75 ios/web_view/internal/translate/web_view_translate_client.h:75: __weak id<CWVTranslateDelegate> delegate_; Please use base::WeakNSProtocol<id<CWVTranslateDelegate>> instead ...
3 years, 9 months ago (2017-03-21 16:29:18 UTC) #4
Hiroshi Ichikawa
https://codereview.chromium.org/2762023003/diff/1/ios/web_view/internal/translate/web_view_translate_client.h File ios/web_view/internal/translate/web_view_translate_client.h (right): https://codereview.chromium.org/2762023003/diff/1/ios/web_view/internal/translate/web_view_translate_client.h#newcode75 ios/web_view/internal/translate/web_view_translate_client.h:75: __weak id<CWVTranslateDelegate> delegate_; On 2017/03/21 16:29:18, michaeldo wrote: > ...
3 years, 9 months ago (2017-03-22 01:32:16 UTC) #5
michaeldo
Thanks, lgtm https://codereview.chromium.org/2762023003/diff/1/ios/web_view/internal/translate/web_view_translate_client.h File ios/web_view/internal/translate/web_view_translate_client.h (right): https://codereview.chromium.org/2762023003/diff/1/ios/web_view/internal/translate/web_view_translate_client.h#newcode75 ios/web_view/internal/translate/web_view_translate_client.h:75: __weak id<CWVTranslateDelegate> delegate_; On 2017/03/22 01:32:15, Hiroshi ...
3 years, 9 months ago (2017-03-22 02:13:47 UTC) #6
Hiroshi Ichikawa
On 2017/03/22 02:13:47, michaeldo wrote: > Thanks, lgtm > > https://codereview.chromium.org/2762023003/diff/1/ios/web_view/internal/translate/web_view_translate_client.h > File ios/web_view/internal/translate/web_view_translate_client.h (right): ...
3 years, 9 months ago (2017-03-22 05:32:37 UTC) #7
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/2762023003/20001
3 years, 9 months ago (2017-03-22 05:40:50 UTC) #9
commit-bot: I haz the power
Prior attempt to commit was detected, but we were not able to check whether the ...
3 years, 9 months ago (2017-03-22 07:45:32 UTC) #12
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/2762023003/20001
3 years, 9 months ago (2017-03-22 08:51:09 UTC) #14
commit-bot: I haz the power
3 years, 9 months ago (2017-03-22 08:55:45 UTC) #17
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/d78e66457cf8aa8a82f0cfc8a387...

Powered by Google App Engine
This is Rietveld 408576698