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

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

Issue 172063002: Unify frame IDs with RenderFrameHost routing IDs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix type Created 6 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 | Annotate | Revision Log
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/containers/hash_tables.h" 6 #include "base/containers/hash_tables.h"
7 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 7 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
8 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 8 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
9 #include "content/browser/renderer_host/render_view_host_factory.h" 9 #include "content/browser/renderer_host/render_view_host_factory.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 *target_routing_id = 51 *target_routing_id =
52 shell2->web_contents()->GetRenderViewHost()->GetRoutingID(); 52 shell2->web_contents()->GetRenderViewHost()->GetRoutingID();
53 EXPECT_NE(*target_routing_id, 53 EXPECT_NE(*target_routing_id,
54 shell->web_contents()->GetRenderViewHost()->GetRoutingID()); 54 shell->web_contents()->GetRenderViewHost()->GetRoutingID());
55 55
56 // Now, simulate a link click coming from the renderer. 56 // Now, simulate a link click coming from the renderer.
57 GURL extension_url("https://bar.com/files/simple_page.html"); 57 GURL extension_url("https://bar.com/files/simple_page.html");
58 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents()); 58 WebContentsImpl* wc = static_cast<WebContentsImpl*>(shell->web_contents());
59 wc->RequestOpenURL( 59 wc->RequestOpenURL(
60 shell->web_contents()->GetRenderViewHost(), extension_url, 60 shell->web_contents()->GetRenderViewHost(), extension_url,
61 Referrer(), CURRENT_TAB, wc->GetFrameTree()->root()->frame_id(), 61 Referrer(), CURRENT_TAB,
62 wc->GetFrameTree()->GetMainFrame()->GetRoutingID(),
62 false, true); 63 false, true);
63 64
64 // Since the navigation above requires a cross-process swap, there will be a 65 // Since the navigation above requires a cross-process swap, there will be a
65 // pending RenderViewHost. Ensure it exists and is in a different process 66 // pending RenderViewHost. Ensure it exists and is in a different process
66 // than the initial page. 67 // than the initial page.
67 RenderViewHostImpl* pending_rvh = 68 RenderViewHostImpl* pending_rvh =
68 wc->GetRenderManagerForTesting()->pending_render_view_host(); 69 wc->GetRenderManagerForTesting()->pending_render_view_host();
69 EXPECT_TRUE(pending_rvh != NULL); 70 EXPECT_TRUE(pending_rvh != NULL);
70 EXPECT_NE(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(), 71 EXPECT_NE(shell->web_contents()->GetRenderViewHost()->GetProcess()->GetID(),
71 pending_rvh->GetProcess()->GetID()); 72 pending_rvh->GetProcess()->GetID());
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 // Since this test executes on the UI thread and hopping threads might cause 158 // Since this test executes on the UI thread and hopping threads might cause
158 // different timing in the test, let's simulate a CreateNewWidget call coming 159 // different timing in the test, let's simulate a CreateNewWidget call coming
159 // from the IO thread. Use the existing window routing id to cause a 160 // from the IO thread. Use the existing window routing id to cause a
160 // deliberate collision. 161 // deliberate collision.
161 pending_rvh->CreateNewWidget(duplicate_routing_id, blink::WebPopupTypeSelect); 162 pending_rvh->CreateNewWidget(duplicate_routing_id, blink::WebPopupTypeSelect);
162 163
163 // If the above operation doesn't crash, the test has succeeded! 164 // If the above operation doesn't crash, the test has succeeded!
164 } 165 }
165 166
166 } // namespace content 167 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698