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

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

Issue 209033002: Merge 258544 "Fix crash introduced in https://codereview.chromiu..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/android/content_view_statics.cc
===================================================================
--- content/browser/android/content_view_statics.cc (revision 258675)
+++ content/browser/android/content_view_statics.cc (working copy)
@@ -44,14 +44,14 @@
base::ProcessHandle handle,
base::TerminationStatus status,
int exit_code) OVERRIDE {
- std::vector<int>::iterator pos = std::find(suspended_processes_.begin(),
- suspended_processes_.end(),
- host->GetID());
- DCHECK_NE(pos, suspended_processes_.end());
- host->RemoveObserver(this);
- suspended_processes_.erase(pos);
+ StopWatching(host);
}
+ virtual void RenderProcessHostDestroyed(
+ content::RenderProcessHost* host) OVERRIDE {
+ StopWatching(host);
+ }
+
// Suspends timers in all current render processes.
void SuspendWebKitSharedTimers() {
DCHECK(suspended_processes_.empty());
@@ -82,6 +82,15 @@
}
private:
+ void StopWatching(content::RenderProcessHost* host) {
+ std::vector<int>::iterator pos = std::find(suspended_processes_.begin(),
+ suspended_processes_.end(),
+ host->GetID());
+ DCHECK_NE(pos, suspended_processes_.end());
+ host->RemoveObserver(this);
+ suspended_processes_.erase(pos);
+ }
+
std::vector<int /* RenderProcessHost id */> suspended_processes_;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698