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

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: Fix. 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..b43a82bc7d69c636a63781f213e1c3809dbae558 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -333,7 +333,12 @@ class SiteProcessMap : public base::SupportsUserData::Data {
SiteProcessMap() {}
void RegisterProcess(const std::string& site, RenderProcessHost* process) {
- map_[site] = process;
+ SiteToProcessMap::iterator i = map_.find(site);
+ if (i != map_.end()) {
+ CHECK_EQ(i->second, process);
Devlin 2017/03/11 01:52:18 Looks like this CHECK is failing on bots :(
nasko 2017/03/13 17:22:03 Yes, I'm purposefully hitting it with my test too
+ } else {
+ map_[site] = process;
+ }
}
RenderProcessHost* FindProcess(const std::string& site) {

Powered by Google App Engine
This is Rietveld 408576698