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

Side by Side Diff: content/browser/security_exploit_browsertest.cc

Issue 2686943002: New WebContents created via ctrl-click should be in a new process. (Closed)
Patch Set: s/renderer/process/ in the field name + initializing the field and variables. Created 3 years, 8 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/containers/hash_tables.h" 8 #include "base/containers/hash_tables.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); 85 shell2->web_contents()->GetRenderViewHost()->GetRoutingID();
86 EXPECT_NE(*target_routing_id, 86 EXPECT_NE(*target_routing_id,
87 shell->web_contents()->GetRenderViewHost()->GetRoutingID()); 87 shell->web_contents()->GetRenderViewHost()->GetRoutingID());
88 88
89 // Now, simulate a link click coming from the renderer. 89 // Now, simulate a link click coming from the renderer.
90 GURL extension_url("https://bar.com/simple_page.html"); 90 GURL extension_url("https://bar.com/simple_page.html");
91 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents()); 91 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents());
92 wc->GetFrameTree()->root()->navigator()->RequestOpenURL( 92 wc->GetFrameTree()->root()->navigator()->RequestOpenURL(
93 wc->GetFrameTree()->root()->current_frame_host(), extension_url, false, 93 wc->GetFrameTree()->root()->current_frame_host(), extension_url, false,
94 nullptr, std::string(), Referrer(), WindowOpenDisposition::CURRENT_TAB, 94 nullptr, std::string(), Referrer(), WindowOpenDisposition::CURRENT_TAB,
95 false, true); 95 false, false, true);
96 96
97 // Since the navigation above requires a cross-process swap, there will be a 97 // Since the navigation above requires a cross-process swap, there will be a
98 // speculative/pending RenderFrameHost. Ensure it exists and is in a different 98 // speculative/pending RenderFrameHost. Ensure it exists and is in a different
99 // process than the initial page. 99 // process than the initial page.
100 RenderFrameHostImpl* next_rfh; 100 RenderFrameHostImpl* next_rfh;
101 if (IsBrowserSideNavigationEnabled()) 101 if (IsBrowserSideNavigationEnabled())
102 next_rfh = wc->GetRenderManagerForTesting()->speculative_frame_host(); 102 next_rfh = wc->GetRenderManagerForTesting()->speculative_frame_host();
103 else 103 else
104 next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host(); 104 next_rfh = wc->GetRenderManagerForTesting()->pending_frame_host();
105 105
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 // separate task of the message loop, so ensure that the process is still 567 // separate task of the message loop, so ensure that the process is still
568 // considered alive. 568 // considered alive.
569 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection()); 569 EXPECT_TRUE(root->current_frame_host()->GetProcess()->HasConnection());
570 570
571 exit_observer.Wait(); 571 exit_observer.Wait();
572 EXPECT_FALSE(exit_observer.did_exit_normally()); 572 EXPECT_FALSE(exit_observer.did_exit_normally());
573 ResourceDispatcherHost::Get()->SetDelegate(nullptr); 573 ResourceDispatcherHost::Get()->SetDelegate(nullptr);
574 } 574 }
575 575
576 } // namespace content 576 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/public/browser/page_navigator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698