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

Side by Side Diff: content/test/test_render_view_host.cc

Issue 1202593002: Move browser-to-renderer opener plumbing to frame routing IDs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@opener-create-opener-render-views
Patch Set: Remove suppress_opener Created 5 years, 5 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
« no previous file with comments | « content/test/test_render_view_host.h ('k') | content/test/test_web_contents.h » ('j') | 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/test/test_render_view_host.h" 5 #include "content/test/test_render_view_host.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" 9 #include "content/browser/dom_storage/dom_storage_context_wrapper.h"
10 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 10 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 bool swapped_out) 218 bool swapped_out)
219 : RenderViewHostImpl(instance, 219 : RenderViewHostImpl(instance,
220 delegate, 220 delegate,
221 widget_delegate, 221 widget_delegate,
222 routing_id, 222 routing_id,
223 main_frame_routing_id, 223 main_frame_routing_id,
224 swapped_out, 224 swapped_out,
225 false /* hidden */, 225 false /* hidden */,
226 false /* has_initialized_audio_host */), 226 false /* has_initialized_audio_host */),
227 delete_counter_(NULL), 227 delete_counter_(NULL),
228 opener_route_id_(MSG_ROUTING_NONE) { 228 opener_frame_route_id_(MSG_ROUTING_NONE) {
229 // TestRenderWidgetHostView installs itself into this->view_ in its 229 // TestRenderWidgetHostView installs itself into this->view_ in its
230 // constructor, and deletes itself when TestRenderWidgetHostView::Destroy() is 230 // constructor, and deletes itself when TestRenderWidgetHostView::Destroy() is
231 // called. 231 // called.
232 new TestRenderWidgetHostView(this); 232 new TestRenderWidgetHostView(this);
233 } 233 }
234 234
235 TestRenderViewHost::~TestRenderViewHost() { 235 TestRenderViewHost::~TestRenderViewHost() {
236 if (delete_counter_) 236 if (delete_counter_)
237 ++*delete_counter_; 237 ++*delete_counter_;
238 } 238 }
239 239
240 bool TestRenderViewHost::CreateTestRenderView( 240 bool TestRenderViewHost::CreateTestRenderView(
241 const base::string16& frame_name, 241 const base::string16& frame_name,
242 int opener_route_id, 242 int opener_frame_route_id,
243 int proxy_route_id, 243 int proxy_route_id,
244 int32 max_page_id, 244 int32 max_page_id,
245 bool window_was_created_with_opener) { 245 bool window_was_created_with_opener) {
246 FrameReplicationState replicated_state; 246 FrameReplicationState replicated_state;
247 replicated_state.name = base::UTF16ToUTF8(frame_name); 247 replicated_state.name = base::UTF16ToUTF8(frame_name);
248 return CreateRenderView(opener_route_id, proxy_route_id, max_page_id, 248 return CreateRenderView(opener_frame_route_id, proxy_route_id, max_page_id,
249 replicated_state, window_was_created_with_opener); 249 replicated_state, window_was_created_with_opener);
250 } 250 }
251 251
252 bool TestRenderViewHost::CreateRenderView( 252 bool TestRenderViewHost::CreateRenderView(
253 int opener_route_id, 253 int opener_frame_route_id,
254 int proxy_route_id, 254 int proxy_route_id,
255 int32 max_page_id, 255 int32 max_page_id,
256 const FrameReplicationState& replicated_frame_state, 256 const FrameReplicationState& replicated_frame_state,
257 bool window_was_created_with_opener) { 257 bool window_was_created_with_opener) {
258 DCHECK(!IsRenderViewLive()); 258 DCHECK(!IsRenderViewLive());
259 set_renderer_initialized(true); 259 set_renderer_initialized(true);
260 DCHECK(IsRenderViewLive()); 260 DCHECK(IsRenderViewLive());
261 opener_route_id_ = opener_route_id; 261 opener_frame_route_id_ = opener_frame_route_id;
262 RenderFrameHost* main_frame = GetMainFrame(); 262 RenderFrameHost* main_frame = GetMainFrame();
263 if (main_frame) 263 if (main_frame)
264 static_cast<RenderFrameHostImpl*>(main_frame)->SetRenderFrameCreated(true); 264 static_cast<RenderFrameHostImpl*>(main_frame)->SetRenderFrameCreated(true);
265 265
266 return true; 266 return true;
267 } 267 }
268 268
269 bool TestRenderViewHost::IsFullscreenGranted() const { 269 bool TestRenderViewHost::IsFullscreenGranted() const {
270 return RenderViewHostImpl::IsFullscreenGranted(); 270 return RenderViewHostImpl::IsFullscreenGranted();
271 } 271 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() { 331 TestRenderFrameHost* RenderViewHostImplTestHarness::main_test_rfh() {
332 return contents()->GetMainFrame(); 332 return contents()->GetMainFrame();
333 } 333 }
334 334
335 TestWebContents* RenderViewHostImplTestHarness::contents() { 335 TestWebContents* RenderViewHostImplTestHarness::contents() {
336 return static_cast<TestWebContents*>(web_contents()); 336 return static_cast<TestWebContents*>(web_contents());
337 } 337 }
338 338
339 } // namespace content 339 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_render_view_host.h ('k') | content/test/test_web_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698