|
Straighten up life cycle of native InfoBar pointers
Currently, there are two issues for potential crashes.
1. There is a chance that Java InfoBars can access native counterparts
even after they are destroyed.
mNativeInfoBarPtr is never reset even after native InfoBar is destroyed.
We do not accept touch inputs after closing infobars, but there may be
corner cases where mNativeInfoBarPtr is accessed afterwards.
2. Infobars aren't setting "base" native pointers correctly.
InfoBar_jni.h has the following code:
InfoBarAndroid* native =
reinterpret_cast<InfoBarAndroid*>(nativeInfoBarAndroid);
Here, nativeInfoBarAndroid refers to the subclass, so we implicitly upcast
the pointer using reinterpret_cast<>, which may result in pointing to
an incorrect pointer depending on the architecture.
In order to prevent any such occurrence in the future,
this also prevents InfoBar Java subclasses from accessing
the native base pointer and functions.
BUG= 492777, 481758
Committed: https://crrev.com/6e63752fcab8553a3b84c5ecf6a356240dacb6e4
Cr-Commit-Position: refs/heads/master@{#333015}
Total comments: 1
Total comments: 12
Total comments: 16
Total comments: 4
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+190 lines, -260 lines) |
Patch |
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/download/ChromeDownloadDelegate.java
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/AccountChooserInfoBar.java
|
View
|
1
2
3
4
|
5 chunks |
+19 lines, -19 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/AppBannerInfoBarAndroid.java
|
View
|
1
2
|
3 chunks |
+8 lines, -11 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBar.java
|
View
|
1
2
3
|
2 chunks |
+5 lines, -17 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/ConfirmInfoBarDelegate.java
|
View
|
1
2
3
|
1 chunk |
+5 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionProxyInfoBar.java
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/DataReductionProxyInfoBarDelegate.java
|
View
|
1
2
3
|
1 chunk |
+3 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/DownloadOverwriteInfoBar.java
|
View
|
1
2
3
4
5
|
1 chunk |
+4 lines, -13 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/GeneratedPasswordSavedInfoBar.java
|
View
|
1
2
3
|
2 chunks |
+2 lines, -13 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/GeneratedPasswordSavedInfoBarDelegate.java
|
View
|
1
2
|
2 chunks |
+4 lines, -6 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/InfoBar.java
|
View
|
1
2
3
4
5
|
6 chunks |
+33 lines, -33 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/MessageInfoBar.java
|
View
|
|
1 chunk |
+0 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/SavePasswordInfoBar.java
|
View
|
1
2
|
1 chunk |
+9 lines, -10 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBar.java
|
View
|
1
2
3
4
5
|
6 chunks |
+35 lines, -21 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java/src/org/chromium/chrome/browser/infobar/TranslateInfoBarDelegate.java
|
View
|
1
2
3
|
1 chunk |
+0 lines, -52 lines |
0 comments
|
Download
|
 |
M |
chrome/android/java_staging/src/org/chromium/chrome/browser/omaha/OmahaUpdateInfobar.java
|
View
|
1
2
|
2 chunks |
+5 lines, -5 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/account_chooser_infobar.h
|
View
|
1
2
3
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/account_chooser_infobar.cc
|
View
|
1
2
3
4
|
2 chunks |
+9 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/app_banner_infobar_android.cc
|
View
|
1
2
|
2 chunks |
+0 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/confirm_infobar.cc
|
View
|
1
2
|
1 chunk |
+3 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/data_reduction_proxy_infobar.cc
|
View
|
1
2
|
1 chunk |
+1 line, -4 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/download_overwrite_infobar.cc
|
View
|
1
2
|
1 chunk |
+1 line, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/generated_password_saved_infobar.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/infobar_android.h
|
View
|
1
2
3
4
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/infobar_android.cc
|
View
|
1
2
3
4
|
1 chunk |
+13 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/infobar_container_android.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/save_password_infobar.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -2 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/translate_infobar.h
|
View
|
1
2
3
|
1 chunk |
+2 lines, -3 lines |
0 comments
|
Download
|
 |
M |
chrome/browser/ui/android/infobars/translate_infobar.cc
|
View
|
1
2
3
4
|
5 chunks |
+15 lines, -17 lines |
0 comments
|
Download
|
 |
M |
chrome/chrome_browser.gypi
|
View
|
1
2
3
4
5
|
2 chunks |
+1 line, -1 line |
0 comments
|
Download
|
Total messages: 26 (5 generated)
|