| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 3408d0ac25759ae0bc6c71969f58b02b2665a53a..997a372b7848a3f914ee6837e63958dcb4d97d87 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -1331,6 +1331,8 @@ void WebContentsImpl::CreateNewWindow(
|
| PAGE_TRANSITION_LINK,
|
| true /* is_renderer_initiated */);
|
| new_contents->OpenURL(open_params);
|
| + } else {
|
| + delete new_contents;
|
| }
|
| }
|
| }
|
| @@ -1376,8 +1378,12 @@ void WebContentsImpl::ShowCreatedWindow(int route_id,
|
| if (contents) {
|
| WebContentsDelegate* delegate = GetDelegate();
|
| if (delegate) {
|
| + bool was_blocked = false;
|
| delegate->AddNewContents(
|
| - this, contents, disposition, initial_pos, user_gesture, NULL);
|
| + this, contents, disposition, initial_pos, user_gesture, &was_blocked);
|
| + if (was_blocked) {
|
| + delete contents;
|
| + }
|
| }
|
| }
|
| }
|
|
|