|
|
Created:
6 years, 7 months ago by AKVT Modified:
6 years, 7 months ago CC:
chromium-reviews, darin-cc_chromium.org, jam, avi.nitk, Cyan, ankit Base URL:
https://chromium.googlesource.com/chromium/src.git@master Visibility:
Public. |
DescriptionSafety check has been added before calling native JNI functions to prevent random crashes.
BUG=
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=268016
Patch Set 1 #
Total comments: 2
Patch Set 2 : Updated code based on review comments. #
Total comments: 3
Patch Set 3 : Updated code based on review comments. #
Total comments: 4
Patch Set 4 : Updated code based on review comments. #
Total comments: 2
Patch Set 5 : Updated code based on review comments. #Messages
Total messages: 34 (0 generated)
PTAL
Hi! What are these random crashes? Are there any reproduce steps? It is possible that these random crashes reveal actual problems in the code. The documentation says "Embedders must call initialize() after constructing a ContentViewCore and before using it". So if the embedder is doing things correctly, mNativeContentViewCore should not be NULL.
+tedchoc
On 2014/04/30 17:05:26, hush wrote: > Hi! > What are these random crashes? Are there any reproduce steps? > It is possible that these random crashes reveal actual problems in the code. The > documentation says "Embedders must call initialize() after constructing a > ContentViewCore and before using it". So if the embedder is doing things > correctly, mNativeContentViewCore should not be NULL. As I can see all the other places in the code, before calling JNi function, we used to valuate the mNativeContentViewCore , so I followed the same in missing areas.
The CQ bit was checked by ajith.v@samsung.com
The CQ bit was unchecked by ajith.v@samsung.com
The CQ bit was checked by ajith.v@samsung.com
The CQ bit was unchecked by ajith.v@samsung.com
https://codereview.chromium.org/269443003/diff/1/content/public/android/java/... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/1/content/public/android/java/... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1642: if (mNativeContentViewCore != 0) { We should probably just early return here: if (mNativeContentViewCore == 0) return false;
@jdduke PTAL new patch set. https://codereview.chromium.org/269443003/diff/1/content/public/android/java/... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/1/content/public/android/java/... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1642: if (mNativeContentViewCore != 0) { On 2014/05/01 16:33:38, jdduke wrote: > We should probably just early return here: > > if (mNativeContentViewCore == 0) return false; Done.
https://codereview.chromium.org/269443003/diff/20001/content/public/android/j... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/20001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1649: event.getEventTime(), I don't believe this is the standard argument indentation for Java, the arguments should "wrap" against a width of 120, with new lines indented by 8 spaces. https://codereview.chromium.org/269443003/diff/20001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:2123: if (mNativeContentViewCore != 0) { I believe this will fit on a single line, so we can get rid of the braces.
@jdduke PTAL a new patch set. https://codereview.chromium.org/269443003/diff/20001/content/public/android/j... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/20001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1649: event.getEventTime(), On 2014/05/02 15:39:33, jdduke wrote: > I don't believe this is the standard argument indentation for Java, the > arguments should "wrap" against a width of 120, with new lines indented by 8 > spaces. Done.
https://codereview.chromium.org/269443003/diff/40001/content/public/android/j... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/40001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1462: ImeAdapter.getTextInputTypeNone()); This line should be indented by 8 spaces instead of 19. https://codereview.chromium.org/269443003/diff/40001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:2125: nativeClearSslPreferences(mNativeContentViewCore); Move this up to be on the same line with the if check.
@jdduke and aurimas, PTAL new patch set. https://codereview.chromium.org/269443003/diff/40001/content/public/android/j... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/40001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1462: ImeAdapter.getTextInputTypeNone()); On 2014/05/02 16:40:17, aurimas wrote: > This line should be indented by 8 spaces instead of 19. Done. https://codereview.chromium.org/269443003/diff/40001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:2125: nativeClearSslPreferences(mNativeContentViewCore); On 2014/05/02 16:40:17, aurimas wrote: > Move this up to be on the same line with the if check. Done.
https://codereview.chromium.org/269443003/diff/60001/content/public/android/j... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/60001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1341: if (mNativeContentViewCore == 0) return 0; This is new. Is 0 equivalent to INVALID_RENDER_PROCESS_PID? I'm worried about callers of this method, if they rely on a valid ID maybe we should be asserting here... (i.e., we don't have control over the calling sequence for onConfigurationChanged/onGenericMotionEvent, but we do over getCurrentRenderProcessId). I would prefer we left this alone unless we actually found that the calling sequence was valid when mNativeContentViewCore == 0.
@jdduke and aurimas PTAL this new patch set. https://codereview.chromium.org/269443003/diff/60001/content/public/android/j... File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/269443003/diff/60001/content/public/android/j... content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:1341: if (mNativeContentViewCore == 0) return 0; On 2014/05/02 17:00:47, jdduke wrote: > This is new. Is 0 equivalent to INVALID_RENDER_PROCESS_PID? I'm worried about > callers of this method, if they rely on a valid ID maybe we should be asserting > here... (i.e., we don't have control over the calling sequence for > onConfigurationChanged/onGenericMotionEvent, but we do over > getCurrentRenderProcessId). I would prefer we left this alone unless we > actually found that the calling sequence was valid when mNativeContentViewCore > == 0. Thanks for the correction. Inner method GetRenderProcessIdFromRenderViewHost(RenderViewHost* host) is returning 0 when renderProcess doesn't have a connection, so I thought of propagating back to the caller with an early exit. But as per your opinion, caller may be relying on valid ID, so we should avoid it. I am agreeing with your point.
Thanks, lgtm (but please for sign-off from aurimas@).
lgtm
The CQ bit was checked by ajith.v@samsung.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajith.v@samsung.com/269443003/80001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_rel on tryserver.chromium
The CQ bit was checked by aurimas@chromium.org
The CQ bit was checked by ajith.v@samsung.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajith.v@samsung.com/269443003/80001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium
The CQ bit was checked by ajith.v@samsung.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajith.v@samsung.com/269443003/80001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: mac_chromium_rel on tryserver.chromium
The CQ bit was checked by ajith.v@samsung.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/ajith.v@samsung.com/269443003/80001
Message was sent while issue was closed.
Change committed as 268016 |