| 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..5cb2d4ed2b85ff92e4b54859f08123e14aef2ef9 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,8 @@ InitialLoadObserver::InitialLoadObserver(size_t tab_count,
|
| NotificationService::AllSources());
|
| registrar_.Add(this, content::NOTIFICATION_LOAD_STOP,
|
| NotificationService::AllSources());
|
| + registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CLOSED,
|
| + NotificationService::AllSources());
|
| }
|
| }
|
|
|
| @@ -127,12 +130,37 @@ 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_CLOSED) {
|
| + base::TerminationStatus status =
|
| + Details<RenderProcessHost::RendererClosedDetails>(details)->status;
|
| + switch (status) {
|
| + case base::TERMINATION_STATUS_NORMAL_TERMINATION:
|
| + break;
|
| +
|
| + case base::TERMINATION_STATUS_ABNORMAL_TERMINATION:
|
| + case base::TERMINATION_STATUS_PROCESS_WAS_KILLED:
|
| + case base::TERMINATION_STATUS_PROCESS_CRASHED:
|
| + crashed_tab_count_++;
|
| + break;
|
| +
|
| + case base::TERMINATION_STATUS_STILL_RUNNING:
|
| + LOG(ERROR) << "Got RENDERER_PROCESS_CLOSED notification, "
|
| + << "but the process is still running. We may miss further "
|
| + << "crash notification, resulting in hangs.";
|
| + break;
|
| +
|
| + default:
|
| + LOG(ERROR) << "Unhandled termination status " << status;
|
| + NOTREACHED();
|
| + break;
|
| }
|
| } else {
|
| NOTREACHED();
|
| }
|
| +
|
| + if (finished_tabs_.size() + crashed_tab_count_ >= outstanding_tab_count_)
|
| + ConditionMet();
|
| }
|
|
|
| DictionaryValue* InitialLoadObserver::GetTimingInformation() const {
|
|
|