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

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

Issue 212703005: Preserve Page::openedByDOM state across process swaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nasko comments. (Also a rebase. Oops.) Created 6 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 | Annotate | Revision Log
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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 // WebContentsImpl ------------------------------------------------------------- 303 // WebContentsImpl -------------------------------------------------------------
304 304
305 WebContentsImpl::WebContentsImpl( 305 WebContentsImpl::WebContentsImpl(
306 BrowserContext* browser_context, 306 BrowserContext* browser_context,
307 WebContentsImpl* opener) 307 WebContentsImpl* opener)
308 : delegate_(NULL), 308 : delegate_(NULL),
309 controller_(this, browser_context), 309 controller_(this, browser_context),
310 render_view_host_delegate_view_(NULL), 310 render_view_host_delegate_view_(NULL),
311 opener_(opener), 311 opener_(opener),
312 created_with_opener_(!!opener),
312 #if defined(OS_WIN) 313 #if defined(OS_WIN)
313 accessible_parent_(NULL), 314 accessible_parent_(NULL),
314 #endif 315 #endif
315 frame_tree_(new NavigatorImpl(&controller_, this), 316 frame_tree_(new NavigatorImpl(&controller_, this),
316 this, this, this, this), 317 this, this, this, this),
317 is_loading_(false), 318 is_loading_(false),
318 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING), 319 crashed_status_(base::TERMINATION_STATUS_STILL_RUNNING),
319 crashed_error_code_(0), 320 crashed_error_code_(0),
320 waiting_for_response_(false), 321 waiting_for_response_(false),
321 load_state_(net::LOAD_STATE_IDLE, base::string16()), 322 load_state_(net::LOAD_STATE_IDLE, base::string16()),
(...skipping 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after
3556 rwh_view->SetSize(GetSizeForNewRenderView()); 3557 rwh_view->SetSize(GetSizeForNewRenderView());
3557 3558
3558 // Make sure we use the correct starting page_id in the new RenderView. 3559 // Make sure we use the correct starting page_id in the new RenderView.
3559 UpdateMaxPageIDIfNecessary(render_view_host); 3560 UpdateMaxPageIDIfNecessary(render_view_host);
3560 int32 max_page_id = 3561 int32 max_page_id =
3561 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance()); 3562 GetMaxPageIDForSiteInstance(render_view_host->GetSiteInstance());
3562 3563
3563 if (!static_cast<RenderViewHostImpl*>( 3564 if (!static_cast<RenderViewHostImpl*>(
3564 render_view_host)->CreateRenderView(base::string16(), 3565 render_view_host)->CreateRenderView(base::string16(),
3565 opener_route_id, 3566 opener_route_id,
3566 max_page_id)) { 3567 max_page_id,
3568 created_with_opener_)) {
3567 return false; 3569 return false;
3568 } 3570 }
3569 3571
3570 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 3572 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
3571 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 3573 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
3572 // linux. See crbug.com/83941. 3574 // linux. See crbug.com/83941.
3573 if (rwh_view) { 3575 if (rwh_view) {
3574 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) 3576 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
3575 render_widget_host->WasResized(); 3577 render_widget_host->WasResized();
3576 } 3578 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
3693 3695
3694 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) { 3696 void WebContentsImpl::OnPreferredSizeChanged(const gfx::Size& old_size) {
3695 if (!delegate_) 3697 if (!delegate_)
3696 return; 3698 return;
3697 const gfx::Size new_size = GetPreferredSize(); 3699 const gfx::Size new_size = GetPreferredSize();
3698 if (new_size != old_size) 3700 if (new_size != old_size)
3699 delegate_->UpdatePreferredSize(this, new_size); 3701 delegate_->UpdatePreferredSize(this, new_size);
3700 } 3702 }
3701 3703
3702 } // namespace content 3704 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698