Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(814)

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2739193004: Check for already existing entry when adding to SiteProcessMap. (Closed)
Patch Set: Fixes based on Devlin's review. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 2c48d780f0fd99df89d492dc61abe6e947cd9d78..631388e169c2878fa6a6475bf6a23525467571a1 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -333,7 +333,9 @@ class SiteProcessMap : public base::SupportsUserData::Data {
SiteProcessMap() {}
void RegisterProcess(const std::string& site, RenderProcessHost* process) {
- map_[site] = process;
+ SiteToProcessMap::iterator i = map_.find(site);
Charlie Reis 2017/03/13 19:57:30 This should have a comment, since at first glance
nasko 2017/03/13 21:06:19 Comment added.
+ if (i == map_.end())
+ map_[site] = process;
}
RenderProcessHost* FindProcess(const std::string& site) {

Powered by Google App Engine
This is Rietveld 408576698