Commit 7ee1af6b authored by Derek Schuff's avatar Derek Schuff Committed by Commit Bot

PNaCl translation cache: Don't close null nexe fd on renderer shutdown

Check the FD before attempting to close it, but continue to clear out the
pending translation requests.

Bug: 825971
Change-Id: Ia7f452586b6036b19859ed61d8cdbd74334aa0d4
Reviewed-on: https://chromium-review.googlesource.com/981324Reviewed-by: default avatarBill Budge <bbudge@chromium.org>
Commit-Queue: Derek Schuff <dschuff@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545939}
parent 561163b9
...@@ -566,9 +566,11 @@ void PnaclHost::RendererClosing(int render_process_id) { ...@@ -566,9 +566,11 @@ void PnaclHost::RendererClosing(int render_process_id) {
PendingTranslationMap::iterator to_erase(it++); PendingTranslationMap::iterator to_erase(it++);
if (to_erase->first.first == render_process_id) { if (to_erase->first.first == render_process_id) {
// Clean up the open files. // Clean up the open files.
std::unique_ptr<base::File> file(to_erase->second.nexe_fd); if (to_erase->second.nexe_fd) {
to_erase->second.nexe_fd = NULL; std::unique_ptr<base::File> file(to_erase->second.nexe_fd);
CloseBaseFile(std::move(*file.get())); to_erase->second.nexe_fd = NULL;
CloseBaseFile(std::move(*file.get()));
}
std::string key(to_erase->second.cache_key); std::string key(to_erase->second.cache_key);
bool may_be_cached = TranslationMayBeCached(to_erase); bool may_be_cached = TranslationMayBeCached(to_erase);
pending_translations_.erase(to_erase); pending_translations_.erase(to_erase);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment