Bug 88675 - [BlackBerry] Fix crash on PagePopupChromeClient
Summary: [BlackBerry] Fix crash on PagePopupChromeClient
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-08 11:15 PDT by Crystal Zhang
Modified: 2012-06-08 17:12 PDT (History)
2 users (show)

See Also:


Attachments
patch (6.99 KB, patch)
2012-06-08 11:33 PDT, Crystal Zhang
no flags Details | Formatted Diff | Diff
updated patch (7.25 KB, patch)
2012-06-08 12:21 PDT, Crystal Zhang
no flags Details | Formatted Diff | Diff
updated patch (7.60 KB, patch)
2012-06-08 13:00 PDT, Crystal Zhang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Crystal Zhang 2012-06-08 11:15:46 PDT
Actually it's the bug inside InputHandler, should delete the old popup and create a new one, because update() is problematic.
Comment 1 Crystal Zhang 2012-06-08 11:33:49 PDT
Created attachment 146619 [details]
patch
Comment 2 Antonio Gomes 2012-06-08 11:59:33 PDT
Comment on attachment 146619 [details]
patch

maybe we could re-write the InputHandler::openSelectPopup part like:

...
bool* enableds = 0;
int* itemTypes = 0;
bool* selecteds = 0;

if (size) {
    enableds = new bool[size];
    int* itemTypes = new int[size];
    bool* selecteds = new bool[size]; 
    blah;
    bleh;
    ....
}

selectClient = new SelectPopupClient(xxx, size, labels, enableds, itemTypes, selecteds, m_webPage, select);
....

also "enableds" and "selecteds" are not a English :)
Comment 3 Crystal Zhang 2012-06-08 12:21:29 PDT
Created attachment 146626 [details]
updated patch
Comment 4 Antonio Gomes 2012-06-08 12:32:10 PDT
Comment on attachment 146626 [details]
updated patch

View in context: https://bugs.webkit.org/attachment.cgi?id=146626&action=review

looks better. two questions ...

> Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp:315
>  void ChromeClientBlackBerry::closePagePopup(PagePopup* popup)

is popup unused now?

> Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp:129
> +    if (m_webPage->m_webPage->hasOpenedPopup())
> +        m_webPage->m_page->chrome()->client()->closePagePopup(0);

does it make sense to move the hasOpenedPopup check inside ::closePagePopup()?
Comment 5 Crystal Zhang 2012-06-08 12:38:28 PDT
Comment on attachment 146626 [details]
updated patch

View in context: https://bugs.webkit.org/attachment.cgi?id=146626&action=review

>> Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp:315
>>  void ChromeClientBlackBerry::closePagePopup(PagePopup* popup)
> 
> is popup unused now?

yes, we always get popup from m_webPage.

>> Source/WebKit/blackberry/WebKitSupport/InputHandler.cpp:129
>> +        m_webPage->m_page->chrome()->client()->closePagePopup(0);
> 
> does it make sense to move the hasOpenedPopup check inside ::closePagePopup()?

yeah, we can do that.
Comment 6 Crystal Zhang 2012-06-08 13:00:28 PDT
Created attachment 146631 [details]
updated patch
Comment 7 WebKit Review Bot 2012-06-08 17:12:32 PDT
Comment on attachment 146631 [details]
updated patch

Clearing flags on attachment: 146631

Committed r119880: <http://trac.webkit.org/changeset/119880>
Comment 8 WebKit Review Bot 2012-06-08 17:12:36 PDT
All reviewed patches have been landed.  Closing bug.