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

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

Issue 1938983003: WebUI: Update Downloads to fix bug introduced by JS lifecycle controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 c2018934f2564d1ca2196fa8d955f26b12c8eb91..940b1eb61efe095971d8aa31b736b1b818a68909 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
@@ -134,7 +134,9 @@ void MdDownloadsDOMHandler::RegisterMessages() {
}
void MdDownloadsDOMHandler::OnJavascriptAllowed() {
- list_tracker_.StartAndSendChunk();
+ // The list tracker is started with the StartAndSendChunk method call
+ // within the HandleGetDownloads handler. StartAndSendChunk should not be
+ // called here as it must be called each time the handler is called.
}
Dan Beam 2016/05/03 04:11:38 just remove this method, IMO
tommycli 2016/05/03 16:26:05 Done.
void MdDownloadsDOMHandler::OnJavascriptDisallowed() {
@@ -144,13 +146,15 @@ void MdDownloadsDOMHandler::OnJavascriptDisallowed() {
}
void MdDownloadsDOMHandler::HandleGetDownloads(const base::ListValue* args) {
+ AllowJavascript();
+
CountDownloadsDOMEvents(DOWNLOADS_DOM_EVENT_GET_DOWNLOADS);
bool terms_changed = list_tracker_.SetSearchTerms(*args);
if (terms_changed)
list_tracker_.Reset();
- AllowJavascript();
+ list_tracker_.StartAndSendChunk();
}
void MdDownloadsDOMHandler::HandleOpenFile(const base::ListValue* args) {

Powered by Google App Engine
This is Rietveld 408576698