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

Unified Diff: content/browser/android/content_view_statics.cc

Issue 181823006: Add DCHECK for shared_timer_suspended_ which shouldn't be negative (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Take review comment into consideration Created 6 years, 9 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: content/browser/android/content_view_statics.cc
diff --git a/content/browser/android/content_view_statics.cc b/content/browser/android/content_view_statics.cc
index e176564c4a0f5a430aad40adaddc2d7aef806c05..75176db3ed52903e7b55cd46374832590ddb2177 100644
--- a/content/browser/android/content_view_statics.cc
+++ b/content/browser/android/content_view_statics.cc
@@ -43,8 +43,10 @@ void SuspendWebKitSharedTimers(std::vector<int>* suspended_processes) {
content::RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
content::RenderProcessHost* host = i.GetCurrentValue();
- suspended_processes->push_back(host->GetID());
- host->Send(new ViewMsg_SetWebKitSharedTimersSuspended(true));
+ if (host && host->HasConnection()) {
+ suspended_processes->push_back(host->GetID());
+ host->Send(new ViewMsg_SetWebKitSharedTimersSuspended(true));
+ }
}
}
@@ -53,7 +55,7 @@ void ResumeWebkitSharedTimers(const std::vector<int>& suspended_processes) {
for (std::vector<int>::const_iterator it = suspended_processes.begin();
it != suspended_processes.end(); ++it) {
content::RenderProcessHost* host = content::RenderProcessHost::FromID(*it);
- if (host) // The process might have been killed since it was suspended.
+ if (host && host->HasConnection()) // The process might have been killed since it was suspended.
host->Send(new ViewMsg_SetWebKitSharedTimersSuspended(false));
}
}
« no previous file with comments | « no previous file | webkit/child/webkitplatformsupport_impl.cc » ('j') | webkit/child/webkitplatformsupport_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698