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

Unified Diff: chrome/browser/ui/webui/task_manager_handler.cc

Issue 8396044: Browser crashing when closing the WebUI task manager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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
« no previous file with comments | « chrome/browser/ui/webui/task_manager_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/task_manager_handler.cc
diff --git a/chrome/browser/ui/webui/task_manager_handler.cc b/chrome/browser/ui/webui/task_manager_handler.cc
index fbff96d491a311ac1542d2326ae75cb090bcf47d..29650674a1603981e1f419501e3a776f6d471a90 100644
--- a/chrome/browser/ui/webui/task_manager_handler.cc
+++ b/chrome/browser/ui/webui/task_manager_handler.cc
@@ -401,6 +401,10 @@ void TaskManagerHandler::OpenAboutMemory(const ListValue* indexes) {
// TaskManagerHandler, private: -----------------------------------------------
+bool TaskManagerHandler::is_alive() {
+ return web_ui_->tab_contents()->render_view_host();
+}
+
void TaskManagerHandler::UpdateResourceGroupTable(int start, int length) {
if (resource_to_group_table_.size() < static_cast<size_t>(start)) {
length += start - resource_to_group_table_.size();
@@ -426,7 +430,7 @@ void TaskManagerHandler::OnGroupChanged(const int group_start,
for (int i = 0; i < group_length; ++i)
tasks_value.Append(CreateTaskGroupValue(model_, group_start + i));
- if (is_enabled_) {
+ if (is_enabled_ && is_alive()) {
web_ui_->CallJavascriptFunction("taskChanged",
start_value, length_value, tasks_value);
}
@@ -440,7 +444,7 @@ void TaskManagerHandler::OnGroupAdded(const int group_start,
for (int i = 0; i < group_length; ++i)
tasks_value.Append(CreateTaskGroupValue(model_, group_start + i));
- if (is_enabled_) {
+ if (is_enabled_ && is_alive()) {
web_ui_->CallJavascriptFunction("taskAdded",
start_value, length_value, tasks_value);
}
@@ -450,6 +454,6 @@ void TaskManagerHandler::OnGroupRemoved(const int group_start,
const int group_length) {
base::FundamentalValue start_value(group_start);
base::FundamentalValue length_value(group_length);
- if (is_enabled_)
+ if (is_enabled_ && is_alive())
web_ui_->CallJavascriptFunction("taskRemoved", start_value, length_value);
}
« no previous file with comments | « chrome/browser/ui/webui/task_manager_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698