Code:  BrowserContextDestroyer::BrowserContextDestroyer(
    BrowserContext* context,
    const std::set<content::RenderProcessHost*>& hosts)
    : context_(context),
      pending_hosts_(0) {
  for (std::set<content::RenderProcessHost*>::iterator it = hosts.begin();
       it != hosts.end(); ++it) {
    (*it)->AddObserver(this);
    ++pending_hosts_;
   }
 }

Commit Message: 
CWE ID: CWE-20
 BrowserContextDestroyer::BrowserContextDestroyer(
    std::unique_ptr<BrowserContext> context,
    const std::set<content::RenderProcessHost*>& hosts,
    uint32_t otr_contexts_pending_deletion)
    : context_(std::move(context)),
      otr_contexts_pending_deletion_(otr_contexts_pending_deletion),
      finish_destroy_scheduled_(false) {
  DCHECK(hosts.size() > 0 ||
         (!context->IsOffTheRecord() &&
          (otr_contexts_pending_deletion > 0 ||
               context->HasOffTheRecordContext())));

  g_contexts_pending_deletion.Get().push_back(this);

  for (auto* host : hosts) {
    ObserveHost(host);
   }
 }
