summaryrefslogtreecommitdiff
path: root/chromium/content/browser/service_process_host_impl.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-23 17:21:03 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-01-23 16:25:15 +0000
commitc551f43206405019121bd2b2c93714319a0a3300 (patch)
tree1f48c30631c421fd4bbb3c36da20183c8a2ed7d7 /chromium/content/browser/service_process_host_impl.cc
parent7961cea6d1041e3e454dae6a1da660b453efd238 (diff)
downloadqtwebengine-chromium-c551f43206405019121bd2b2c93714319a0a3300.tar.gz
BASELINE: Update Chromium to 79.0.3945.139
Change-Id: I336b7182fab9bca80b709682489c07db112eaca5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/content/browser/service_process_host_impl.cc')
-rw-r--r--chromium/content/browser/service_process_host_impl.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/chromium/content/browser/service_process_host_impl.cc b/chromium/content/browser/service_process_host_impl.cc
index f0873d3dc5f..1d417b84d88 100644
--- a/chromium/content/browser/service_process_host_impl.cc
+++ b/chromium/content/browser/service_process_host_impl.cc
@@ -58,6 +58,7 @@ class ServiceProcessTracker {
FROM_HERE,
base::BindOnce(&ServiceProcessTracker::NotifyTerminatedOnUIThread,
base::Unretained(this), iter->second));
+ processes_.erase(iter);
}
void NotifyCrashed(ServiceProcessId id) {
@@ -69,6 +70,7 @@ class ServiceProcessTracker {
FROM_HERE,
base::BindOnce(&ServiceProcessTracker::NotifyCrashedOnUIThread,
base::Unretained(this), iter->second));
+ processes_.erase(iter);
}
void AddObserver(ServiceProcessHost::Observer* observer) {
@@ -147,16 +149,22 @@ class UtilityProcessClient : public UtilityProcessHost::Client {
void OnProcessTerminatedNormally() override {
GetServiceProcessTracker().NotifyTerminated(
- process_info_.service_process_id);
+ process_info_->service_process_id);
}
void OnProcessCrashed() override {
- GetServiceProcessTracker().NotifyCrashed(process_info_.service_process_id);
+ // TODO(https://crbug.com/1016027): It is unclear how we can observe
+ // |OnProcessCrashed()| without observing |OnProcessLaunched()| first, but
+ // it can happen on Android. Ignore the notification in this case.
+ if (!process_info_)
+ return;
+
+ GetServiceProcessTracker().NotifyCrashed(process_info_->service_process_id);
}
private:
const std::string service_interface_name_;
- ServiceProcessInfo process_info_;
+ base::Optional<ServiceProcessInfo> process_info_;
DISALLOW_COPY_AND_ASSIGN(UtilityProcessClient);
};