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

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

Issue 12252016: Prevented connecting drag drop events to a SwappedOut RenderViewHost in WebContentsViewGtk (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: A step back... Created 7 years, 10 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
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/render_view_host_manager.h" 5 #include "content/browser/web_contents/render_view_host_manager.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/logging.h" 10 #include "base/logging.h"
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 639
640 // If the new RVH is swapped out already, store it. Otherwise prevent the 640 // If the new RVH is swapped out already, store it. Otherwise prevent the
641 // process from exiting while we're trying to navigate in it. 641 // process from exiting while we're trying to navigate in it.
642 if (swapped_out) { 642 if (swapped_out) {
643 swapped_out_hosts_[instance->GetId()] = new_render_view_host; 643 swapped_out_hosts_[instance->GetId()] = new_render_view_host;
644 } else { 644 } else {
645 new_render_view_host->GetProcess()->AddPendingView(); 645 new_render_view_host->GetProcess()->AddPendingView();
646 } 646 }
647 647
648 bool success = InitRenderView(new_render_view_host, opener_route_id); 648 bool success = InitRenderView(new_render_view_host, opener_route_id);
649 if (success) { 649 if (!swapped_out) {
650 // Don't show the view until we get a DidNavigate from it. 650 if (success) {
651 new_render_view_host->GetView()->Hide(); 651 // Don't show the view until we get a DidNavigate from it.
652 new_render_view_host->GetView()->Hide();
652 653
653 // TODO(nasko): Send a frame tree update when creating the RV 654 // TODO(nasko): Send a frame tree update when creating the RV
654 // once http://crbug.com/153701 is fixed. 655 // once http://crbug.com/153701 is fixed.
655 } else if (!swapped_out) { 656 } else {
656 CancelPending(); 657 CancelPending();
658 }
657 } 659 }
658 } 660 }
659 661
660 // Use this as our new pending RVH if it isn't swapped out. 662 // Use this as our new pending RVH if it isn't swapped out.
661 if (!swapped_out) 663 if (!swapped_out)
662 pending_render_view_host_ = new_render_view_host; 664 pending_render_view_host_ = new_render_view_host;
663 665
664 return new_render_view_host->GetRoutingID(); 666 return new_render_view_host->GetRoutingID();
665 } 667 }
666 668
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost( 971 RenderViewHostImpl* RenderViewHostManager::GetSwappedOutRenderViewHost(
970 SiteInstance* instance) { 972 SiteInstance* instance) {
971 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId()); 973 RenderViewHostMap::iterator iter = swapped_out_hosts_.find(instance->GetId());
972 if (iter != swapped_out_hosts_.end()) 974 if (iter != swapped_out_hosts_.end())
973 return iter->second; 975 return iter->second;
974 976
975 return NULL; 977 return NULL;
976 } 978 }
977 979
978 } // namespace content 980 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | content/browser/web_contents/web_contents_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698