summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 21:56:05 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 21:56:05 +0000
commit0ff6a754100d4d5e4110c69f4afdeef00d2cdb26 (patch)
tree6507274cb98aba38ff85b84f35d565f4bd842f4c /chrome
parentd6c987134dcbb80e0624b580c37c363bc0c76eb7 (diff)
downloadchromium_src-0ff6a754100d4d5e4110c69f4afdeef00d2cdb26.zip
chromium_src-0ff6a754100d4d5e4110c69f4afdeef00d2cdb26.tar.gz
chromium_src-0ff6a754100d4d5e4110c69f4afdeef00d2cdb26.tar.bz2
Fix race condition if we get the model file in between the time that a RenderProcessHost is created and when it's launched. Also fix the same race condition in the spellcheck code.
Review URL: http://codereview.chromium.org/6907002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83802 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/safe_browsing/client_side_detection_service.cc4
-rw-r--r--chrome/browser/spellcheck_host_impl.cc4
2 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc
index 8bcf7df..2521eb4 100644
--- a/chrome/browser/safe_browsing/client_side_detection_service.cc
+++ b/chrome/browser/safe_browsing/client_side_detection_service.cc
@@ -183,7 +183,9 @@ void ClientSideDetectionService::SetModelStatus(ModelStatus status) {
for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
- SendModelToProcess(i.GetCurrentValue());
+ RenderProcessHost* process = i.GetCurrentValue();
+ if (process->GetHandle())
+ SendModelToProcess(process);
}
}
diff --git a/chrome/browser/spellcheck_host_impl.cc b/chrome/browser/spellcheck_host_impl.cc
index 92386bc..fb81413 100644
--- a/chrome/browser/spellcheck_host_impl.cc
+++ b/chrome/browser/spellcheck_host_impl.cc
@@ -252,7 +252,9 @@ void SpellCheckHostImpl::InformObserverOfInitialization() {
for (RenderProcessHost::iterator i(RenderProcessHost::AllHostsIterator());
!i.IsAtEnd(); i.Advance()) {
- InitForRenderer(i.GetCurrentValue());
+ RenderProcessHost* process = i.GetCurrentValue();
+ if (process)
+ InitForRenderer(process);
}
}