Merge lp:~abreu-alexandre/oxide/fix-crash-scroll-message-handler into lp:~oxide-developers/oxide/oxide.trunk

Proposed by Alexandre Abreu
Status: Needs review
Proposed branch: lp:~abreu-alexandre/oxide/fix-crash-scroll-message-handler
Merge into: lp:~oxide-developers/oxide/oxide.trunk
Diff against target: 16 lines (+6/-0)
1 file modified
shared/browser/oxide_script_message_contents_helper.cc (+6/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/oxide/fix-crash-scroll-message-handler
Reviewer Review Type Date Requested Status
Chris Coulson Needs Fixing
Review via email: mp+292321@code.launchpad.net

Commit message

Fix a crash caused by a race if a message is being sent as the corresponding webcontents is being destroyed.

Description of the change

Fix a crash caused by a race if a message is being sent as the corresponding webcontents is being destroyed.

To post a comment you must log in.
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

This looks ok, but it needs a test (and rebasing on to the git branch)

review: Needs Fixing

Unmerged revisions

1449. By Alexandre Abreu

draft fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shared/browser/oxide_script_message_contents_helper.cc'
2--- shared/browser/oxide_script_message_contents_helper.cc 2015-10-07 09:44:33 +0000
3+++ shared/browser/oxide_script_message_contents_helper.cc 2016-04-19 20:37:04 +0000
4@@ -121,6 +121,12 @@
5 &params.wrapped_payload));
6 WebFrame* target = frame;
7 WebView* view = frame->GetView();
8+ if (!view) {
9+ ReturnError(render_frame_host,
10+ ScriptMessageParams::ERROR_NO_HANDLER,
11+ params);
12+ return;
13+ }
14
15 while (target) {
16 DCHECK_EQ(target->GetView(), view);

Subscribers

People subscribed via source and target branches