Chromium Code Reviews| 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 { |