Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 LAZY_INSTANCE_INITIALIZER; | 326 LAZY_INSTANCE_INITIALIZER; |
| 327 | 327 |
| 328 // Map of site to process, to ensure we only have one RenderProcessHost per | 328 // Map of site to process, to ensure we only have one RenderProcessHost per |
| 329 // site in process-per-site mode. Each map is specific to a BrowserContext. | 329 // site in process-per-site mode. Each map is specific to a BrowserContext. |
| 330 class SiteProcessMap : public base::SupportsUserData::Data { | 330 class SiteProcessMap : public base::SupportsUserData::Data { |
| 331 public: | 331 public: |
| 332 typedef base::hash_map<std::string, RenderProcessHost*> SiteToProcessMap; | 332 typedef base::hash_map<std::string, RenderProcessHost*> SiteToProcessMap; |
| 333 SiteProcessMap() {} | 333 SiteProcessMap() {} |
| 334 | 334 |
| 335 void RegisterProcess(const std::string& site, RenderProcessHost* process) { | 335 void RegisterProcess(const std::string& site, RenderProcessHost* process) { |
| 336 map_[site] = process; | 336 SiteToProcessMap::iterator i = map_.find(site); |
| 337 if (i != map_.end()) { | |
| 338 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
| |
| 339 } else { | |
| 340 map_[site] = process; | |
| 341 } | |
| 337 } | 342 } |
| 338 | 343 |
| 339 RenderProcessHost* FindProcess(const std::string& site) { | 344 RenderProcessHost* FindProcess(const std::string& site) { |
| 340 SiteToProcessMap::iterator i = map_.find(site); | 345 SiteToProcessMap::iterator i = map_.find(site); |
| 341 if (i != map_.end()) | 346 if (i != map_.end()) |
| 342 return i->second; | 347 return i->second; |
| 343 return NULL; | 348 return NULL; |
| 344 } | 349 } |
| 345 | 350 |
| 346 void RemoveProcess(RenderProcessHost* host) { | 351 void RemoveProcess(RenderProcessHost* host) { |
| (...skipping 2719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3066 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; | 3071 LOG(ERROR) << "Terminating render process for bad Mojo message: " << error; |
| 3067 | 3072 |
| 3068 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. | 3073 // The ReceivedBadMessage call below will trigger a DumpWithoutCrashing. |
| 3069 // Capture the error message in a crash key value. | 3074 // Capture the error message in a crash key value. |
| 3070 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); | 3075 base::debug::ScopedCrashKey error_key_value("mojo-message-error", error); |
| 3071 bad_message::ReceivedBadMessage(render_process_id, | 3076 bad_message::ReceivedBadMessage(render_process_id, |
| 3072 bad_message::RPH_MOJO_PROCESS_ERROR); | 3077 bad_message::RPH_MOJO_PROCESS_ERROR); |
| 3073 } | 3078 } |
| 3074 | 3079 |
| 3075 } // namespace content | 3080 } // namespace content |
| OLD | NEW |