Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(653)

Issue 2892353002: WebUI: Fix crash while loading scripts for webview.[add/remove]ContentScripts API. (Closed)

Created:
3 years, 7 months ago by karandeepb
Modified:
3 years, 7 months ago
Reviewers:
lazyboy
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

WebUI: Fix crash while loading scripts for webview.[add/remove]ContentScripts API. WebUIUserScriptLoader is used by the DeclarativeUserScriptMaster to load scripts in webui through the declarative webview.[add/remove]ContentScripts API. As per crash reports, the cached UserScriptRenderInfo may not correspond to an alive render process host. This can happen since UserScriptLoader::LoadScripts may not be synchronous with UserScriptLoader::AddScripts. This CL tries to fix the crash by checking whether the cached UserScriptRenderInfo corresponds to a live RenderProcessHost. If it doesn't the corresponding script is not loaded. BUG=720331 Review-Url: https://codereview.chromium.org/2892353002 Cr-Commit-Position: refs/heads/master@{#474457} Committed: https://chromium.googlesource.com/chromium/src/+/017234bc0a7505f2a773352e1d38090847aee163

Patch Set 1 #

Total comments: 2

Patch Set 2 : Add test. #

Patch Set 3 : Remove test and add TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -9 lines) Patch
M extensions/browser/user_script_loader.h View 1 chunk +2 lines, -1 line 0 comments Download
M extensions/browser/web_ui_user_script_loader.cc View 1 2 1 chunk +16 lines, -8 lines 0 comments Download

Messages

Total messages: 24 (19 generated)
karandeepb
PTAL Istiaque. Don't have a repro case, but think this should fix it. I am ...
3 years, 7 months ago (2017-05-20 23:40:33 UTC) #5
lazyboy
> I am not clear on what can cause the RenderProcessHost to not be alive. ...
3 years, 7 months ago (2017-05-22 23:34:53 UTC) #8
karandeepb
https://codereview.chromium.org/2892353002/diff/1/extensions/browser/web_ui_user_script_loader.cc File extensions/browser/web_ui_user_script_loader.cc (right): https://codereview.chromium.org/2892353002/diff/1/extensions/browser/web_ui_user_script_loader.cc#newcode93 extensions/browser/web_ui_user_script_loader.cc:93: // |render_process_host| may no longer be alive. On 2017/05/22 ...
3 years, 7 months ago (2017-05-24 21:36:57 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2892353002/100001
3 years, 7 months ago (2017-05-24 21:38:13 UTC) #21
commit-bot: I haz the power
3 years, 7 months ago (2017-05-24 22:45:00 UTC) #24
Message was sent while issue was closed.
Committed patchset #3 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/017234bc0a7505f2a773352e1d38...

Powered by Google App Engine
This is Rietveld 408576698