⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 277375 in webkit


Ignore:
Timestamp:
May 12, 2021, 10:46:26 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Crash in WebPageProxy::endColorPicker()
https://bugs.webkit.org/show_bug.cgi?id=225679

Patch by Julian Gonzalez <julian_a_gonzalez@apple.com> on 2021-05-12
Reviewed by Ryosuke Niwa.

Make sure that endColorPicker() and didEndColorPicker()
do not both attempt to null-out m_colorPicker.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::endColorPicker):
(WebKit::WebPageProxy::didEndColorPicker):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r277372 r277375  
     12021-05-12  Julian Gonzalez  <julian_a_gonzalez@apple.com>
     2
     3        Crash in WebPageProxy::endColorPicker()
     4        https://bugs.webkit.org/show_bug.cgi?id=225679
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Make sure that endColorPicker() and didEndColorPicker()
     9        do not both attempt to null-out m_colorPicker.
     10
     11        * UIProcess/WebPageProxy.cpp:
     12        (WebKit::WebPageProxy::endColorPicker):
     13        (WebKit::WebPageProxy::didEndColorPicker):
     14
    1152021-05-12  Peng Liu  <peng.liu6@apple.com>
    216
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r277356 r277375  
    62186218void WebPageProxy::endColorPicker()
    62196219{
    6220     if (!m_colorPicker)
    6221         return;
    6222 
    6223     m_colorPicker->endPicker();
     6220    if (auto colorPicker = std::exchange(m_colorPicker, nullptr))
     6221        colorPicker->endPicker();
    62246222}
    62256223
     
    62346232void WebPageProxy::didEndColorPicker()
    62356233{
    6236     m_colorPicker = nullptr;
    6237     if (!hasRunningProcess())
    6238         return;
    6239 
    6240     send(Messages::WebPage::DidEndColorPicker());
     6234    if (std::exchange(m_colorPicker, nullptr)) {
     6235        if (!hasRunningProcess())
     6236            return;
     6237
     6238        send(Messages::WebPage::DidEndColorPicker());
     6239    }
     6240
    62416241}
    62426242#endif
Note: See TracChangeset for help on using the changeset viewer.