New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 703564 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Bug



Sign in to add a comment

Enable ARC for //ios/web_view/internal/translate/*.m

Project Member Reported by ichikawa@chromium.org, Mar 21 2017

Issue description

Enable ARC for //ios/web_view/internal/translate/*.m.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d78e66457cf8aa8a82f0cfc8a387eb8a71655bb7

commit d78e66457cf8aa8a82f0cfc8a387eb8a71655bb7
Author: ichikawa <ichikawa@chromium.org>
Date: Wed Mar 22 08:54:54 2017

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}

[modify] https://crrev.com/d78e66457cf8aa8a82f0cfc8a387eb8a71655bb7/ios/web_view/internal/translate/BUILD.gn
[modify] https://crrev.com/d78e66457cf8aa8a82f0cfc8a387eb8a71655bb7/ios/web_view/internal/translate/cwv_translate_manager_impl.mm
[modify] https://crrev.com/d78e66457cf8aa8a82f0cfc8a387eb8a71655bb7/ios/web_view/internal/translate/web_view_translate_client.h
[modify] https://crrev.com/d78e66457cf8aa8a82f0cfc8a387eb8a71655bb7/ios/web_view/internal/translate/web_view_translate_client.mm

Status: Fixed (was: Started)

Sign in to add a comment