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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 25434002: Don't leave renderer process frozen when canceling JavaScript dialogs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove WebContentsObserver Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 3648 matching lines...) Expand 10 before | Expand all | Expand 10 after
3659 // TODO(brettw) this is a hack. See WebContentsView::SizeContents. 3659 // TODO(brettw) this is a hack. See WebContentsView::SizeContents.
3660 gfx::Size size = GetSizeForNewRenderView(); 3660 gfx::Size size = GetSizeForNewRenderView();
3661 // 0x0 isn't a valid window size (minimal window size is 1x1) but it may be 3661 // 0x0 isn't a valid window size (minimal window size is 1x1) but it may be
3662 // here during container initialization and normal window size will be set 3662 // here during container initialization and normal window size will be set
3663 // later. In case of tab duplication this resizing to 0x0 prevents setting 3663 // later. In case of tab duplication this resizing to 0x0 prevents setting
3664 // normal size later so just ignore it. 3664 // normal size later so just ignore it.
3665 if (!size.IsEmpty()) 3665 if (!size.IsEmpty())
3666 view_->SizeContents(size); 3666 view_->SizeContents(size);
3667 } 3667 }
3668 3668
3669 void WebContentsImpl::CancelModalDialogsForRenderManager() {
3670 // We need to cancel modal dialogs when doing a process swap, since the load
3671 // deferrer would prevent us from swapping out.
3672 if (dialog_manager_)
3673 dialog_manager_->CancelActiveAndPendingDialogs(this);
3674 }
3675
3669 void WebContentsImpl::NotifySwappedFromRenderManager(RenderViewHost* rvh) { 3676 void WebContentsImpl::NotifySwappedFromRenderManager(RenderViewHost* rvh) {
3670 NotifySwapped(rvh); 3677 NotifySwapped(rvh);
3671 3678
3672 // Make sure the visible RVH reflects the new delegate's preferences. 3679 // Make sure the visible RVH reflects the new delegate's preferences.
3673 if (delegate_) 3680 if (delegate_)
3674 view_->SetOverscrollControllerEnabled(delegate_->CanOverscrollContent()); 3681 view_->SetOverscrollControllerEnabled(delegate_->CanOverscrollContent());
3675 3682
3676 view_->RenderViewSwappedIn(render_manager_.current_host()); 3683 view_->RenderViewSwappedIn(render_manager_.current_host());
3677 3684
3678 FrameTreeNode* root = NULL; 3685 FrameTreeNode* root = NULL;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
3859 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const { 3866 gfx::Size WebContentsImpl::GetSizeForNewRenderView() const {
3860 gfx::Size size; 3867 gfx::Size size;
3861 if (delegate_) 3868 if (delegate_)
3862 size = delegate_->GetSizeForNewRenderView(this); 3869 size = delegate_->GetSizeForNewRenderView(this);
3863 if (size.IsEmpty()) 3870 if (size.IsEmpty())
3864 size = view_->GetContainerSize(); 3871 size = view_->GetContainerSize();
3865 return size; 3872 return size;
3866 } 3873 }
3867 3874
3868 } // namespace content 3875 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698