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

Unified Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 7870008: Wait properly for renderer crashes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win? Created 9 years, 3 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/automation/automation_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 8de225a96d838b01b76c1c349f21a39c72df2ba0..ed9cfbb98159f794a9b622b28845f9e04fca97c2 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -99,6 +99,7 @@ class InitialLoadObserver::TabTime {
InitialLoadObserver::InitialLoadObserver(size_t tab_count,
AutomationProvider* automation)
: automation_(automation->AsWeakPtr()),
+ crashed_tab_count_(0),
outstanding_tab_count_(tab_count),
init_time_(base::TimeTicks::Now()) {
if (outstanding_tab_count_ > 0) {
@@ -106,6 +107,10 @@ InitialLoadObserver::InitialLoadObserver(size_t tab_count,
NotificationService::AllSources());
registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
NotificationService::AllSources());
+ registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
+ NotificationService::AllSources());
+ registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
+ NotificationService::AllSources());
}
}
@@ -127,12 +132,21 @@ void InitialLoadObserver::Observe(int type,
finished_tabs_.insert(source.map_key());
iter->second.set_stop_time(base::TimeTicks::Now());
}
- if (outstanding_tab_count_ == finished_tabs_.size())
- ConditionMet();
}
+ } else if (type == content::NOTIFICATION_RENDERER_PROCESS_CREATED) {
+ LOG(INFO) << "Got RENDERER_PROCESS_CREATED";
+ } else if (type == content::NOTIFICATION_RENDERER_PROCESS_CLOSED) {
+ LOG(INFO) << "Got RENDERER_PROCESS_CLOSED";
+
+ // Assume no render process transitions on initial loads for simplicity.
+ // Treat every closing render process as a crash.
darin (slow to review) 2011/09/15 05:43:37 It might help to explain why instead of just summa
Paweł Hajdan Jr. 2011/09/15 18:36:44 I just removed that assumption then. Probably bett
+ crashed_tab_count_++;
} else {
NOTREACHED();
}
+
+ if (finished_tabs_.size() + crashed_tab_count_ >= outstanding_tab_count_)
+ ConditionMet();
}
DictionaryValue* InitialLoadObserver::GetTimingInformation() const {

Powered by Google App Engine
This is Rietveld 408576698