Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chromium] Implement DateTime Picker #1256

Merged
merged 2 commits into from
Feb 21, 2024
Merged

[Chromium] Implement DateTime Picker #1256

merged 2 commits into from
Feb 21, 2024

Conversation

mshin-wolvic
Copy link
Collaborator

No description provided.

Copy link
Member

@svillar svillar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and I could get easily it to crash. Seems easy to fix though

13:31:52.198 27412-27412 System.err            W  java.lang.NullPointerException: Attempt to invoke interface method 'com.igalia.wolvic.browser.api.WResult com.igalia.wolvic.browser.api.WSession$PromptDelegate.onDateTimePrompt(com.igalia.wolvic.browser.api.WSession, com.igalia.wolvic.browser.api.WSession$PromptDelegate$DateTimePrompt)' on a null object reference
13:31:52.198 27412-27412                       W  	at com.igalia.wolvic.browser.api.impl.PromptDelegateImpl$DateTimeChooserBridge.showDialog(PromptDelegateImpl.java:597)
13:31:52.198 27412-27412                       W  	at org.chromium.content.browser.input.DateTimeChooserAndroid.showDialog(DateTimeChooserAndroid.java:70)
13:31:52.198 27412-27412                       W  	at org.chromium.content.browser.input.DateTimeChooserAndroid.createDateTimeChooser(DateTimeChooserAndroid.java:93)
13:31:52.198 27412-27412                       W  	at android.os.MessageQueue.nativePollOnce(Native Method)
13:31:52.198 27412-27412                       W  	at android.os.MessageQueue.next(MessageQueue.java:335)
13:31:52.198 27412-27412                       W  	at android.os.Looper.loopOnce(Looper.java:167)
13:31:52.198 27412-27412                       W  	at android.os.Looper.loop(Looper.java:304)
13:31:52.198 27412-27412                       W  	at android.app.ActivityThread.main(ActivityThread.java:7918)
13:31:52.198 27412-27412                       W  	at java.lang.reflect.Method.invoke(Native Method)
13:31:52.198 27412-27412                       W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
13:31:52.198 27412-27412                       W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1010)

@mshin-wolvic
Copy link
Collaborator Author

I tested it and I could get easily it to crash. Seems easy to fix though

13:31:52.198 27412-27412 System.err            W  java.lang.NullPointerException: Attempt to invoke interface method 'com.igalia.wolvic.browser.api.WResult com.igalia.wolvic.browser.api.WSession$PromptDelegate.onDateTimePrompt(com.igalia.wolvic.browser.api.WSession, com.igalia.wolvic.browser.api.WSession$PromptDelegate$DateTimePrompt)' on a null object reference
13:31:52.198 27412-27412                       W  	at com.igalia.wolvic.browser.api.impl.PromptDelegateImpl$DateTimeChooserBridge.showDialog(PromptDelegateImpl.java:597)
13:31:52.198 27412-27412                       W  	at org.chromium.content.browser.input.DateTimeChooserAndroid.showDialog(DateTimeChooserAndroid.java:70)
13:31:52.198 27412-27412                       W  	at org.chromium.content.browser.input.DateTimeChooserAndroid.createDateTimeChooser(DateTimeChooserAndroid.java:93)
13:31:52.198 27412-27412                       W  	at android.os.MessageQueue.nativePollOnce(Native Method)
13:31:52.198 27412-27412                       W  	at android.os.MessageQueue.next(MessageQueue.java:335)
13:31:52.198 27412-27412                       W  	at android.os.Looper.loopOnce(Looper.java:167)
13:31:52.198 27412-27412                       W  	at android.os.Looper.loop(Looper.java:304)
13:31:52.198 27412-27412                       W  	at android.app.ActivityThread.main(ActivityThread.java:7918)
13:31:52.198 27412-27412                       W  	at java.lang.reflect.Method.invoke(Native Method)
13:31:52.198 27412-27412                       W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
13:31:52.198 27412-27412                       W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1010)

Thanks for checking. It could be easy to fix this but I'd like to understand why the delegate is the null object. sorry but I couldn't reproduce it. Maybe I'm testing within some pattern only. Could you let me know how to reproduce it?

@svillar
Copy link
Member

svillar commented Feb 21, 2024

I tested it and I could get easily it to crash. Seems easy to fix though

13:31:52.198 27412-27412 System.err            W  java.lang.NullPointerException: Attempt to invoke interface method 'com.igalia.wolvic.browser.api.WResult com.igalia.wolvic.browser.api.WSession$PromptDelegate.onDateTimePrompt(com.igalia.wolvic.browser.api.WSession, com.igalia.wolvic.browser.api.WSession$PromptDelegate$DateTimePrompt)' on a null object reference
13:31:52.198 27412-27412                       W  	at com.igalia.wolvic.browser.api.impl.PromptDelegateImpl$DateTimeChooserBridge.showDialog(PromptDelegateImpl.java:597)
13:31:52.198 27412-27412                       W  	at org.chromium.content.browser.input.DateTimeChooserAndroid.showDialog(DateTimeChooserAndroid.java:70)
13:31:52.198 27412-27412                       W  	at org.chromium.content.browser.input.DateTimeChooserAndroid.createDateTimeChooser(DateTimeChooserAndroid.java:93)
13:31:52.198 27412-27412                       W  	at android.os.MessageQueue.nativePollOnce(Native Method)
13:31:52.198 27412-27412                       W  	at android.os.MessageQueue.next(MessageQueue.java:335)
13:31:52.198 27412-27412                       W  	at android.os.Looper.loopOnce(Looper.java:167)
13:31:52.198 27412-27412                       W  	at android.os.Looper.loop(Looper.java:304)
13:31:52.198 27412-27412                       W  	at android.app.ActivityThread.main(ActivityThread.java:7918)
13:31:52.198 27412-27412                       W  	at java.lang.reflect.Method.invoke(Native Method)
13:31:52.198 27412-27412                       W  	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
13:31:52.198 27412-27412                       W  	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1010)

Thanks for checking. It could be easy to fix this but I'd like to understand why the delegate is the null object. sorry but I couldn't reproduce it. Maybe I'm testing within some pattern only. Could you let me know how to reproduce it?

I think it was just going back but not really sure. In any case we should add null checks to the delegates because the session might have freed them by the time chromium calls these methods

@mshin-wolvic
Copy link
Collaborator Author

I think it was just going back but not really sure. In any case we should add null checks to the delegates because the session might have freed them by the time chromium calls these methods.

Thanks for sharing. I've added the NullPointerException to prevent the access of null delegate. I will patch the safe code for other implementations at this file in a separate patch.

Copy link
Member

@svillar svillar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@svillar svillar merged commit 96a090f into main Feb 21, 2024
20 checks passed
@svillar svillar deleted the implement_DateTimePicker branch February 21, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants