Merge pull request #919 from paulcbetts/nullref-in-webview-manager

Fix nullref crash in WebViewManager::RemoveGuest
This commit is contained in:
Cheng Zhao 2014-12-16 13:40:11 -08:00
commit 4fa7e8e914

View file

@ -80,13 +80,19 @@ void WebViewManager::AddGuest(int guest_instance_id,
}
void WebViewManager::RemoveGuest(int guest_instance_id) {
if (!ContainsKey(web_contents_map_, guest_instance_id)) {
return;
}
auto web_contents = web_contents_map_[guest_instance_id].web_contents;
content::BrowserThread::PostTask(
content::BrowserThread::IO, FROM_HERE,
base::Bind(
&WebViewRendererState::RemoveGuest,
base::Unretained(WebViewRendererState::GetInstance()),
web_contents->GetRenderProcessHost()->GetID()));
web_contents_map_.erase(guest_instance_id);
// Remove the record of element in embedder too.