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

Issue 2914453002: Check UsbDevice string fields for null. (Closed)

Created:
3 years, 6 months ago by Igor Eremeev
Modified:
3 years, 6 months ago
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Check UsbDevice string fields for null. Android API allows these methods to return null, but converters from jni_string.h expect jstrings to be non-null with a DCHECK. See https://developer.android.com/reference/android/hardware/usb/UsbDevice.html > Returns ... or null if the property could not be read R=reillyg@chromium.org TEST=Don't crash in debug on null jstring DCHECK on KeyedService creation, or any other scenarios that call UsbDeviceAndroid::Create. Was reproducible only on certain devices, like Motorola Nexus 6. Review-Url: https://codereview.chromium.org/2914453002 Cr-Commit-Position: refs/heads/master@{#475841} Committed: https://chromium.googlesource.com/chromium/src/+/eed4be16b9d9e00cfb5708277c78969d9c652810

Patch Set 1 #

Total comments: 3

Patch Set 2 : Use ScopedJavaLocalRef as a local var type. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -6 lines) Patch
M device/usb/usb_device_android.cc View 1 1 chunk +12 lines, -6 lines 0 comments Download

Messages

Total messages: 10 (3 generated)
Igor Eremeev
3 years, 6 months ago (2017-05-29 12:51:04 UTC) #1
Igor Eremeev
Hello! I've found the issue when browser was crashing on DCHECK in this method, because ...
3 years, 6 months ago (2017-05-29 13:07:24 UTC) #2
Reilly Grant (use Gerrit)
https://codereview.chromium.org/2914453002/diff/1/device/usb/usb_device_android.cc File device/usb/usb_device_android.cc (right): https://codereview.chromium.org/2914453002/diff/1/device/usb/usb_device_android.cc#newcode38 device/usb/usb_device_android.cc:38: const JavaRef<jstring>& manufacturer_jstring = These locals must be ScopedJavaLocalRef<jstring>. ...
3 years, 6 months ago (2017-05-30 18:50:29 UTC) #3
Igor Eremeev
https://codereview.chromium.org/2914453002/diff/1/device/usb/usb_device_android.cc File device/usb/usb_device_android.cc (right): https://codereview.chromium.org/2914453002/diff/1/device/usb/usb_device_android.cc#newcode38 device/usb/usb_device_android.cc:38: const JavaRef<jstring>& manufacturer_jstring = On 2017/05/30 18:50:29, Reilly Grant ...
3 years, 6 months ago (2017-05-31 06:50:44 UTC) #4
Reilly Grant (use Gerrit)
lgtm
3 years, 6 months ago (2017-05-31 06:59:05 UTC) #5
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/2914453002/20001
3 years, 6 months ago (2017-05-31 07:01:12 UTC) #7
commit-bot: I haz the power
3 years, 6 months ago (2017-05-31 07:47:28 UTC) #10
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/eed4be16b9d9e00cfb5708277c78...

Powered by Google App Engine
This is Rietveld 408576698