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

Unified Diff: chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc

Issue 1960223002: MD Downloads: reset list tracker when renderer crashes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: alpha Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
diff --git a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
index c980c14d4b6d0c146c20345aa2913a74468e5bd6..966a36461cf4a2877628465dfca17409e561aec6 100644
--- a/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
+++ b/chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.cc
@@ -131,6 +131,8 @@ void MdDownloadsDOMHandler::RegisterMessages() {
web_ui()->RegisterMessageCallback("openDownloadsFolder",
base::Bind(&MdDownloadsDOMHandler::HandleOpenDownloadsFolder,
weak_ptr_factory_.GetWeakPtr()));
+
+ Observe(GetWebUIWebContents());
}
void MdDownloadsDOMHandler::OnJavascriptDisallowed() {
@@ -139,6 +141,14 @@ void MdDownloadsDOMHandler::OnJavascriptDisallowed() {
CheckForRemovedFiles();
}
+void MdDownloadsDOMHandler::RenderProcessGone(base::TerminationStatus status) {
+ if (status != base::TERMINATION_STATUS_NORMAL_TERMINATION &&
tommycli 2016/05/09 17:54:35 Does using WebContents::IsCrashed() work here inst
Dan Beam 2016/05/09 18:29:32 Done.
+ status != base::TERMINATION_STATUS_STILL_RUNNING) {
+ // TODO(dbeam): WebUI + WebUIMessageHandler should do this automatically.
+ DisallowJavascript();
+ }
+}
+
void MdDownloadsDOMHandler::HandleGetDownloads(const base::ListValue* args) {
AllowJavascript();
« no previous file with comments | « chrome/browser/ui/webui/md_downloads/md_downloads_dom_handler.h ('k') | content/browser/webui/web_ui_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698