Don't use NotificationStateLock for GetMainFrame (see issue #2421)

This causes a race related to |notification_state_lock_| assignment when
GetMainFrame is called from multiple threads. GetMainFrame doesn't
trigger any notifications so it shouldn't need that lock. Instead, only
use NotificationStateLock on the UI thread.
This commit is contained in:
Marshall Greenblatt
2021-09-16 11:01:55 +03:00
parent db807e804a
commit 84117f2d1b
2 changed files with 8 additions and 7 deletions

View File

@@ -204,7 +204,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
// Used instead of |base::AutoLock(lock_)| in situations that might generate
// CefFrameHandler notifications. Any notifications passed to
// MaybeExecuteFrameNotification() will be queued until the lock is released,
// and then executed in order.
// and then executed in order. Only accessed on the UI thread.
class NotificationStateLock final {
public:
explicit NotificationStateLock(CefBrowserInfo* browser_info);